@@ -118,7 +118,7 @@ Examples:
118118 $ codebuff --cwd my-project # Start in specific directory
119119 $ codebuff --trace # Enable subagent trace logging to .agents/traces/*.log
120120 $ codebuff --create nextjs my-app # Create and scaffold a new Next.js project
121- $ codebuff -- publish my-agent # Publish agent template to store
121+ $ codebuff publish my-agent # Publish agent template to store
122122 $ codebuff --agent file_picker "find relevant files for authentication"
123123 $ codebuff --agent reviewer --params '{"focus": "security"}' "review this code"
124124
@@ -129,9 +129,7 @@ For all commands and options, run 'codebuff' and then type 'help'.
129129 program . parse ( )
130130
131131 const options = program . opts ( )
132- const args = program . args
133-
134- // Handle template creation
132+ const args = program . args // Handle template creation
135133 if ( options . create ) {
136134 const template = options . create
137135 const projectDir = args [ 0 ] || '.'
@@ -141,8 +139,8 @@ For all commands and options, run 'codebuff' and then type 'help'.
141139 }
142140
143141 // Handle publish command
144- if ( options . publish ) {
145- const agentName = options . publish
142+ if ( args [ 0 ] === ' publish' ) {
143+ const agentName = args [ 1 ]
146144 await handlePublish ( agentName )
147145 process . exit ( 0 )
148146 }
@@ -213,7 +211,10 @@ For all commands and options, run 'codebuff' and then type 'help'.
213211
214212 // Remove the first argument if it's the compiled binary path which bun weirdly injects (starts with /$bunfs)
215213 const filteredArgs = args [ 0 ] ?. startsWith ( '/$bunfs' ) ? args . slice ( 1 ) : args
216- const initialInput = filteredArgs . join ( ' ' )
214+
215+ // If first arg is a command like 'publish', don't treat it as initial input
216+ const isCommand = filteredArgs [ 0 ] === 'publish'
217+ const initialInput = isCommand ? '' : filteredArgs . join ( ' ' )
217218
218219 codebuff ( {
219220 initialInput,
0 commit comments