chore: createOpencodeServer expose logLevel (#6202)

This commit is contained in:
Ayush Walekar
2025-12-26 11:09:06 -06:00
committed by GitHub
parent f1ab427f0e
commit 155ba794cf
5 changed files with 17 additions and 2 deletions
+1
View File
@@ -644,6 +644,7 @@ export namespace Config {
$schema: z.string().optional().describe("JSON schema reference for configuration validation"), $schema: z.string().optional().describe("JSON schema reference for configuration validation"),
theme: z.string().optional().describe("Theme name to use for the interface"), theme: z.string().optional().describe("Theme name to use for the interface"),
keybinds: Keybinds.optional().describe("Custom keybind configurations"), keybinds: Keybinds.optional().describe("Custom keybind configurations"),
logLevel: Log.Level.optional().describe("Log level"),
tui: TUI.optional().describe("TUI specific settings"), tui: TUI.optional().describe("TUI specific settings"),
server: Server.optional().describe("Server configuration for opencode serve and web commands"), server: Server.optional().describe("Server configuration for opencode serve and web commands"),
command: z command: z
+4
View File
@@ -1174,6 +1174,10 @@ export type Config = {
*/ */
theme?: string theme?: string
keybinds?: KeybindsConfig keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/** /**
* TUI specific settings * TUI specific settings
*/ */
+4 -1
View File
@@ -28,7 +28,10 @@ export async function createOpencodeServer(options?: ServerOptions) {
options ?? {}, 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, signal: options.signal,
env: { env: {
...process.env, ...process.env,
+4
View File
@@ -1406,6 +1406,10 @@ export type Config = {
*/ */
theme?: string theme?: string
keybinds?: KeybindsConfig keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/** /**
* TUI specific settings * TUI specific settings
*/ */
+4 -1
View File
@@ -28,7 +28,10 @@ export async function createOpencodeServer(options?: ServerOptions) {
options ?? {}, 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, signal: options.signal,
env: { env: {
...process.env, ...process.env,