Skip to content

Commit 394c3d5

Browse files
committed
cli: skip agent registry init when --agent flag is used
1 parent 32c2aae commit 394c3d5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cli/src/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ async function main(): Promise<void> {
168168
initialMode,
169169
} = parseArgs()
170170

171+
const isPublishCommand = process.argv.includes('publish')
172+
const hasAgentOverride = Boolean(agent && agent.trim().length > 0)
173+
171174
await initializeApp({ cwd })
172175

173176
// Detect if user is at home directory or outside a project (should show project picker)
@@ -178,10 +181,12 @@ async function main(): Promise<void> {
178181
projectRoot === '/' || projectRoot === homeDir || gitRoot === null
179182

180183
// Initialize agent registry (loads user agents via SDK)
181-
await initializeAgentRegistry()
184+
if (isPublishCommand || !hasAgentOverride) {
185+
await initializeAgentRegistry()
186+
}
182187

183188
// Handle publish command before rendering the app
184-
if (process.argv.includes('publish')) {
189+
if (isPublishCommand) {
185190
const publishIndex = process.argv.indexOf('publish')
186191
const agentIds = process.argv.slice(publishIndex + 1)
187192
const result = await handlePublish(agentIds)

0 commit comments

Comments
 (0)