feat: add raw stream logging flags

This commit is contained in:
Peter Steinberger
2026-01-09 03:45:14 +00:00
parent 69546d563d
commit 8e27ea7371
8 changed files with 149 additions and 8 deletions

View File

@@ -50,6 +50,8 @@ type GatewayRunOpts = {
verbose?: boolean;
wsLog?: unknown;
compact?: boolean;
rawStream?: boolean;
rawStreamPath?: unknown;
};
type GatewayRunParams = {
@@ -300,6 +302,14 @@ async function runGatewayCommand(
}
setGatewayWsLogStyle(wsLogStyle);
if (opts.rawStream) {
process.env.CLAWDBOT_RAW_STREAM = "1";
}
const rawStreamPath = toOptionString(opts.rawStreamPath);
if (rawStreamPath) {
process.env.CLAWDBOT_RAW_STREAM_PATH = rawStreamPath;
}
const cfg = loadConfig();
const portOverride = parsePort(opts.port);
if (opts.port !== undefined && portOverride === null) {
@@ -565,6 +575,8 @@ function addGatewayRunCommand(
"auto",
)
.option("--compact", 'Alias for "--ws-log compact"', false)
.option("--raw-stream", "Log raw model stream events to jsonl", false)
.option("--raw-stream-path <path>", "Raw stream jsonl path")
.action(async (opts) => {
await runGatewayCommand(opts, params);
});