From b841a55f9b704707d2d0ed08550daec140ba35a0 Mon Sep 17 00:00:00 2001 From: Javis Date: Mon, 9 Mar 2026 21:34:35 +0800 Subject: [PATCH] fix(cli): check publish command at argv[2] position only The CLI's publish command detection used process.argv.includes('publish') which matches 'publish' anywhere in the arguments, not just as a subcommand. This means a user prompt like 'publish my changes' triggers the publish flow and exits the session instead of starting a chat. The fix makes isPublishCommand consistent with isLoginCommand by checking only argv[2] (the subcommand position). Before: codebuff "publish my changes" # triggers handlePublish() and exits After: codebuff "publish my changes" # starts a chat session with the prompt Fixes #465 --- cli/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/index.tsx b/cli/src/index.tsx index 23fbd079a3..3b274c286d 100644 --- a/cli/src/index.tsx +++ b/cli/src/index.tsx @@ -189,7 +189,7 @@ async function main(): Promise { } = parseArgs() const isLoginCommand = process.argv[2] === 'login' - const isPublishCommand = process.argv.includes('publish') + const isPublishCommand = process.argv[2] === 'publish' const hasAgentOverride = Boolean(agent?.trim()) await initializeApp({ cwd })