Skip to content
Open
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
7 changes: 7 additions & 0 deletions .changeset/scoped-llms-duplicate-prefix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'incur': patch
---

Fixed `--llms` and `--llms-full` markdown output when scoped to a command group (e.g. `cli auth --llms`) to no longer duplicate the group prefix in command signatures (`cli auth auth login` → `cli auth login`).

The scoped name already carries the prefix, so command collection now runs with an empty prefix to match the unscoped and JSON/YAML manifest output.
7 changes: 5 additions & 2 deletions src/Cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,11 @@ describe('--llms', () => {
cli.command('ping', { description: 'Health check', run: () => ({}) })

const { output } = await serve(cli, ['auth', '--llms'])
expect(output).toContain('test auth auth login')
expect(output).toContain('test auth auth logout')
expect(output).toContain('test auth login')
expect(output).toContain('test auth logout')
// The scoped prefix must not be duplicated in the command signature.
expect(output).not.toContain('test auth auth login')
expect(output).not.toContain('test auth auth logout')
expect(output).not.toContain('ping')
})

Expand Down
8 changes: 6 additions & 2 deletions src/Cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,9 @@ async function serveImpl(
if (llmsFull) {
if (!formatExplicit || formatFlag === 'md') {
const groups = new Map<string, string>()
const cmds = collectSkillCommands(scopedCommands, prefix, groups, scopedRoot)
// Command names are relative to the scope; `scopedName` already carries
// the prefix, so pass `[]` to avoid prepending it twice.
const cmds = collectSkillCommands(scopedCommands, [], groups, scopedRoot)
const scopedName = prefix.length > 0 ? `${name} ${prefix.join(' ')}` : name
writeln(Skill.generate(scopedName, cmds, groups))
return
Expand All @@ -645,7 +647,9 @@ async function serveImpl(

if (!formatExplicit || formatFlag === 'md') {
const groups = new Map<string, string>()
const cmds = collectSkillCommands(scopedCommands, prefix, groups, scopedRoot)
// Command names are relative to the scope; `scopedName` already carries
// the prefix, so pass `[]` to avoid prepending it twice.
const cmds = collectSkillCommands(scopedCommands, [], groups, scopedRoot)
const scopedName = prefix.length > 0 ? `${name} ${prefix.join(' ')}` : name
writeln(Skill.index(scopedName, cmds, scopedDescription))
return
Expand Down
12 changes: 6 additions & 6 deletions src/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1513,9 +1513,9 @@ describe('--llms', () => {

| Command | Description |
|---------|-------------|
| \`app auth auth login\` | Log in to the service |
| \`app auth auth logout\` | Log out of the service |
| \`app auth auth status\` | Show authentication status |
| \`app auth login\` | Log in to the service |
| \`app auth logout\` | Log out of the service |
| \`app auth status\` | Show authentication status |

Run \`app auth --llms-full\` for full manifest. Run \`app auth <command> --schema\` for argument details.
"
Expand All @@ -1531,9 +1531,9 @@ describe('--llms', () => {

| Command | Description |
|---------|-------------|
| \`app project deploy project deploy create <env>\` | Create a deployment |
| \`app project deploy project deploy rollback <deployId>\` | Rollback a deployment |
| \`app project deploy project deploy status <deployId>\` | Check deployment status |
| \`app project deploy create <env>\` | Create a deployment |
| \`app project deploy rollback <deployId>\` | Rollback a deployment |
| \`app project deploy status <deployId>\` | Check deployment status |

Run \`app project deploy --llms-full\` for full manifest. Run \`app project deploy <command> --schema\` for argument details.
"
Expand Down