Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,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"),
command: z
.record(z.string(), Command)
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/js/src/gen/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,10 @@ export type Config = {
*/
theme?: string
keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/**
* TUI specific settings
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/js/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/js/src/v2/gen/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,10 @@ export type Config = {
*/
theme?: string
keybinds?: KeybindsConfig
/**
* Log level
*/
logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"
/**
* TUI specific settings
*/
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/js/src/v2/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down