chore: createOpencodeServer expose `logLevel` (#6202)

thinking-toggle-wip
Ayush Walekar 2025-12-26 22:39:06 +05:30 committed by Aiden Cline
parent c1d21f9b11
commit 1c35e59e4f
5 changed files with 17 additions and 2 deletions

View File

@ -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

View File

@ -1174,6 +1174,10 @@ export type Config = {
*/
theme?: string
keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/**
* TUI specific settings
*/

View File

@ -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,

View File

@ -1409,6 +1409,10 @@ export type Config = {
*/
theme?: string
keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/**
* TUI specific settings
*/

View File

@ -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,