chore: createOpencodeServer expose `logLevel` (#6202)
parent
c1d21f9b11
commit
1c35e59e4f
|
|
@ -644,6 +644,7 @@ export namespace Config {
|
|||
$schema: z.string().optional().describe("JSON schema reference for configuration validation"),
|
||||
theme: z.string().optional().describe("Theme name to use for the interface"),
|
||||
keybinds: Keybinds.optional().describe("Custom keybind configurations"),
|
||||
logLevel: Log.Level.optional().describe("Log level"),
|
||||
tui: TUI.optional().describe("TUI specific settings"),
|
||||
server: Server.optional().describe("Server configuration for opencode serve and web commands"),
|
||||
command: z
|
||||
|
|
|
|||
|
|
@ -1174,6 +1174,10 @@ export type Config = {
|
|||
*/
|
||||
theme?: string
|
||||
keybinds?: KeybindsConfig
|
||||
/**
|
||||
* Log level
|
||||
*/
|
||||
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
|
||||
/**
|
||||
* TUI specific settings
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@ export async function createOpencodeServer(options?: ServerOptions) {
|
|||
options ?? {},
|
||||
)
|
||||
|
||||
const proc = spawn(`opencode`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
|
||||
const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`]
|
||||
if (options.config?.logLevel) args.push(`--log-level=${options.config.logLevel}`)
|
||||
|
||||
const proc = spawn(`opencode`, args, {
|
||||
signal: options.signal,
|
||||
env: {
|
||||
...process.env,
|
||||
|
|
|
|||
|
|
@ -1409,6 +1409,10 @@ export type Config = {
|
|||
*/
|
||||
theme?: string
|
||||
keybinds?: KeybindsConfig
|
||||
/**
|
||||
* Log level
|
||||
*/
|
||||
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
|
||||
/**
|
||||
* TUI specific settings
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@ export async function createOpencodeServer(options?: ServerOptions) {
|
|||
options ?? {},
|
||||
)
|
||||
|
||||
const proc = spawn(`opencode`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
|
||||
const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`]
|
||||
if (options.config?.logLevel) args.push(`--log-level=${options.config.logLevel}`)
|
||||
|
||||
const proc = spawn(`opencode`, args, {
|
||||
signal: options.signal,
|
||||
env: {
|
||||
...process.env,
|
||||
|
|
|
|||
Loading…
Reference in New Issue