Skip to content

feat(list): add --json flag for machine-readable output#558

Merged
quuu merged 1 commit intovercel-labs:mainfrom
elliotllliu:feat/list-json-flag
Mar 11, 2026
Merged

feat(list): add --json flag for machine-readable output#558
quuu merged 1 commit intovercel-labs:mainfrom
elliotllliu:feat/list-json-flag

Conversation

@elliotllliu
Copy link
Copy Markdown
Contributor

Closes #527

Summary

Adds a --json flag to skills list (and skills ls) that outputs structured JSON to stdout. This enables editor extensions, CI scripts, and other tooling to reliably consume skill data without parsing ANSI-colored text.

Output format

$ npx skills list --json
[
  {
    "name": "my-skill",
    "path": "/Users/alice/.agents/skills/my-skill",
    "scope": "global",
    "agents": ["Claude Code", "Cursor", "Cline", "...all agents, untruncated"]
  }
]

Key properties (per #527):

  • No ANSI escape codes in output
  • Full, untruncated agent list (no +N more truncation)
  • Empty array [] when no skills found (exit code 0)
  • Works with -g and -a flags

Changes

File Change
src/list.ts Parse --json option, output JSON array before human-readable path
src/cli.ts Add --json to help text and examples
src/list.test.ts 5 new tests (option parsing + CLI integration)

Tests

All 28 list tests pass (5 new).

Add a --json flag to 'skills list' that outputs structured JSON to
stdout. The JSON output contains no ANSI escape codes and includes
the full, untruncated agent list for each skill.

Closes vercel-labs#527

Output format:
  [{name, path, scope, agents}]

Changes:
- src/list.ts: parse --json option, emit JSON array before human output
- src/cli.ts: document --json in help text and examples
- src/list.test.ts: 5 new tests (parseListOptions + CLI integration)
@quuu
Copy link
Copy Markdown
Collaborator

quuu commented Mar 11, 2026

thanks for this!

@quuu quuu merged commit f6e7048 into vercel-labs:main Mar 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add --json flag to skills list

2 participants