Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/__tests__/commands/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 10 additions & 10 deletions src/__tests__/commands/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })
);
});
Expand All @@ -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' })
);
});
Expand All @@ -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' })
);
});
Expand All @@ -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' })
);
});
Expand Down Expand Up @@ -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' })
);
});
Expand All @@ -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' })
);
});
Expand All @@ -174,15 +174,15 @@ 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' })
);

vi.mocked(execSync).mockClear();
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' })
);
});
Expand All @@ -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' })
);
});
Expand Down Expand Up @@ -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(
Expand Down
10 changes: 8 additions & 2 deletions src/commands/skills-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
Loading