Skip to content

Commit 6304cb6

Browse files
committed
fix(cli): allow interactive skill add without name
1 parent 7524cc0 commit 6304cb6

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ ai-devkit lint --feature lint-command
6565
ai-devkit lint --feature lint-command --json
6666

6767
# Install a skill
68-
ai-devkit skill add <skill-registry> <skill-name>
68+
ai-devkit skill add <skill-registry> [skill-name]
6969

7070
# Store a memory
7171
ai-devkit memory store

packages/cli/src/__tests__/commands/skill.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('skill command', () => {
3535
jest.clearAllMocks();
3636
mockAddSkill.mockImplementation(async () => undefined);
3737
jest.spyOn(process, 'exit').mockImplementation((() => undefined) as any);
38+
jest.spyOn(process.stderr, 'write').mockImplementation((() => true) as any);
3839
});
3940

4041
it('parses skill add with registry only and forwards undefined skill name', async () => {
@@ -47,6 +48,7 @@ describe('skill command', () => {
4748
global: undefined,
4849
environments: undefined,
4950
});
51+
expect(process.stderr.write).not.toHaveBeenCalled();
5052
});
5153

5254
it('parses skill add with explicit skill name and forwards both args', async () => {
@@ -83,6 +85,6 @@ describe('skill command', () => {
8385
const addCommand = skillCommand?.commands.find(command => command.name() === 'add');
8486

8587
expect(addCommand?.usage()).toContain('<registry-repo>');
86-
expect(addCommand?.usage()).toContain('<skill-name>');
88+
expect(addCommand?.usage()).toContain('[skill-name]');
8789
});
8890
});

packages/cli/src/commands/skill.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function registerSkillCommand(program: Command): void {
1111
.description('Manage Agent Skills');
1212

1313
skillCommand
14-
.command('add <registry-repo> <skill-name>')
14+
.command('add <registry-repo> [skill-name]')
1515
.description('Install a skill from a registry (e.g., ai-devkit skill add anthropics/skills frontend-design)')
1616
.option('-g, --global', 'Install skill into configured global skill paths (~/<path>)')
1717
.option('-e, --env <environment...>', 'Target environment(s) for global install (e.g., --global --env claude)')
@@ -46,7 +46,7 @@ export function registerSkillCommand(program: Command): void {
4646

4747
if (skills.length === 0) {
4848
ui.warning('No skills installed in this project.');
49-
ui.info('Install a skill with: ai-devkit skill add <registry>/<repo> <skill-name>');
49+
ui.info('Install a skill with: ai-devkit skill add <registry>/<repo> [skill-name]');
5050
return;
5151
}
5252

@@ -128,7 +128,7 @@ export function registerSkillCommand(program: Command): void {
128128
columnStyles: [chalk.cyan, chalk.dim, chalk.white]
129129
});
130130

131-
ui.text(`\nInstall with: ai-devkit skill add <registry> <skill-name>`, { breakline: true });
131+
ui.text(`\nInstall with: ai-devkit skill add <registry> [skill-name]`, { breakline: true });
132132
} catch (error: any) {
133133
ui.error(`Failed to search skills: ${error.message}`);
134134
process.exit(1);

0 commit comments

Comments
 (0)