From 64b410992f29c827496b0414ca33d8b9805849ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Wed, 8 Oct 2025 22:53:41 +0200 Subject: [PATCH 1/2] fix: Use process.stdout.write instead of console.log for export output This makes sure that all of the output is written before the command exits. --- packages/opencode/src/cli/cmd/export.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/export.ts b/packages/opencode/src/cli/cmd/export.ts index 996522b5a303..024565789d4e 100644 --- a/packages/opencode/src/cli/cmd/export.ts +++ b/packages/opencode/src/cli/cmd/export.ts @@ -66,7 +66,7 @@ export const ExportCommand = cmd({ })), } - console.log(JSON.stringify(exportData, null, 2)) + process.stdout.write(JSON.stringify(exportData, null, 2)) } catch (error) { UI.error(`Session not found: ${sessionID!}`) process.exit(1) From b5a679ca63de138f2b6207f747cecc85dd28ff3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Thu, 9 Oct 2025 07:22:00 +0200 Subject: [PATCH 2/2] fix: Add newline after JSON export output --- packages/opencode/src/cli/cmd/export.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/opencode/src/cli/cmd/export.ts b/packages/opencode/src/cli/cmd/export.ts index 024565789d4e..c8825c83d291 100644 --- a/packages/opencode/src/cli/cmd/export.ts +++ b/packages/opencode/src/cli/cmd/export.ts @@ -67,6 +67,7 @@ export const ExportCommand = cmd({ } process.stdout.write(JSON.stringify(exportData, null, 2)) + process.stdout.write("\n") } catch (error) { UI.error(`Session not found: ${sessionID!}`) process.exit(1)