diff --git a/cli/package.json b/cli/package.json index 6c28f3cb..49a70db4 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.2.77", + "version": "0.2.78", "type": "module", "bin": { "spawn": "cli.js" diff --git a/cli/src/commands.ts b/cli/src/commands.ts index f0a48d77..4f6e31e0 100644 --- a/cli/src/commands.ts +++ b/cli/src/commands.ts @@ -1418,8 +1418,10 @@ function printGroupedList( // ── Agent Info ───────────────────────────────────────────────────────────────── -export async function cmdAgentInfo(agent: string): Promise { - const [manifest, agentKey] = await validateAndGetEntity(agent, "agent"); +export async function cmdAgentInfo(agent: string, preloadedManifest?: Manifest): Promise { + const [manifest, agentKey] = preloadedManifest + ? [preloadedManifest, agent] + : await validateAndGetEntity(agent, "agent"); const agentDef = manifest.agents[agentKey]; printInfoHeader(agentDef); @@ -1544,8 +1546,10 @@ function printAgentList( } } -export async function cmdCloudInfo(cloud: string): Promise { - const [manifest, cloudKey] = await validateAndGetEntity(cloud, "cloud"); +export async function cmdCloudInfo(cloud: string, preloadedManifest?: Manifest): Promise { + const [manifest, cloudKey] = preloadedManifest + ? [preloadedManifest, cloud] + : await validateAndGetEntity(cloud, "cloud"); const c = manifest.clouds[cloudKey]; printInfoHeader(c); diff --git a/cli/src/index.ts b/cli/src/index.ts index 597263a7..b35dfaff 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -129,15 +129,15 @@ function showUnknownCommandError(name: string, manifest: { agents: Record { const manifest = await loadManifestWithSpinner(); - // Direct key match - if (manifest.agents[name]) { await cmdAgentInfo(name); return; } - if (manifest.clouds[name]) { await cmdCloudInfo(name); return; } + // Direct key match — pass pre-loaded manifest to avoid a redundant spinner + if (manifest.agents[name]) { await cmdAgentInfo(name, manifest); return; } + if (manifest.clouds[name]) { await cmdCloudInfo(name, manifest); return; } // Try resolving display names and case-insensitive matches const resolvedAgent = resolveAgentKey(manifest, name); - if (resolvedAgent) { await cmdAgentInfo(resolvedAgent); return; } + if (resolvedAgent) { await cmdAgentInfo(resolvedAgent, manifest); return; } const resolvedCloud = resolveCloudKey(manifest, name); - if (resolvedCloud) { await cmdCloudInfo(resolvedCloud); return; } + if (resolvedCloud) { await cmdCloudInfo(resolvedCloud, manifest); return; } showUnknownCommandError(name, manifest); }