diff --git a/src/__tests__/commands/init.test.ts b/src/__tests__/commands/init.test.ts index 11e3b6249a..6cf43728ef 100644 --- a/src/__tests__/commands/init.test.ts +++ b/src/__tests__/commands/init.test.ts @@ -54,11 +54,11 @@ describe('handleInitCommand', () => { }); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all --yes ${cliSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${cliSkillFlags}`, expect.objectContaining({ stdio: ['ignore', 'pipe', 'pipe'] }) ); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all --yes ${workflowSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${workflowSkillFlags}`, expect.objectContaining({ stdio: ['ignore', 'pipe', 'pipe'] }) ); // Build skills are intentionally no longer installed by init. diff --git a/src/__tests__/commands/setup.test.ts b/src/__tests__/commands/setup.test.ts index 5e28f2841b..9b2e1724a8 100644 --- a/src/__tests__/commands/setup.test.ts +++ b/src/__tests__/commands/setup.test.ts @@ -89,7 +89,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('skills', {}); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all ${cliSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${cliSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -98,7 +98,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('skills', { agent: 'cursor' }); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --agent cursor ${cliSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes --agent cursor ${cliSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -107,7 +107,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('core', {}); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all ${cliSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${cliSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -116,7 +116,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('build', {}); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all ${buildSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${buildSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -156,7 +156,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('firecrawl-developer-index', {}); expect(execSync).toHaveBeenCalledWith( - 'npx -y skills add firecrawl/skills --full-depth --global --all --skill firecrawl-developer-index', + 'npx -y skills add firecrawl/skills --full-depth --global --yes --skill firecrawl-developer-index', expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -165,7 +165,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('developer-index', {}); expect(execSync).toHaveBeenCalledWith( - 'npx -y skills add firecrawl/skills --full-depth --global --all --skill firecrawl-developer-index', + 'npx -y skills add firecrawl/skills --full-depth --global --yes --skill firecrawl-developer-index', expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -174,7 +174,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('build', {}); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all ${buildSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${buildSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); @@ -182,7 +182,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('firecrawl-build', {}); expect(execSync).toHaveBeenCalledWith( - 'npx -y skills add firecrawl/skills --full-depth --global --all --skill firecrawl-build', + 'npx -y skills add firecrawl/skills --full-depth --global --yes --skill firecrawl-build', expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -191,7 +191,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand('workflows', {}); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all ${workflowSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${workflowSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); }); @@ -232,7 +232,7 @@ describe('handleSetupCommand', () => { await handleSetupCommand(undefined, { yes: true }); expect(execSync).toHaveBeenCalledWith( - `npx -y skills add firecrawl/skills --full-depth --global --all --yes ${cliSkillFlags}`, + `npx -y skills add firecrawl/skills --full-depth --global --yes ${cliSkillFlags}`, expect.objectContaining({ stdio: 'inherit' }) ); expect(execFileSync).toHaveBeenCalledWith( diff --git a/src/commands/skills-install.ts b/src/commands/skills-install.ts index f7867b2e4c..041f6ffb1b 100644 --- a/src/commands/skills-install.ts +++ b/src/commands/skills-install.ts @@ -139,12 +139,18 @@ export function buildSkillsInstallArgs( args.push('--global'); } - const installToAllAgents = options.agent ? false : (options.all ?? true); + // `skills add --all` means "ALL skills to all agents" and overrides any + // --skill filter, so a skill-scoped install must never pass it. Scoped + // installs use --yes instead: same promptless install to every detected + // agent, but the --skill list is respected. + const skillScoped = Boolean(options.skills?.length); + const installToAllAgents = + !skillScoped && (options.agent ? false : (options.all ?? true)); if (installToAllAgents) { args.push('--all'); } - if (options.yes) { + if (options.yes || skillScoped) { args.push('--yes'); }