feat(cli): rich ask list command with --json output#50
Merged
Conversation
Port printTable/printSkillTree from @tanstack/intent (MIT) into packages/cli/src/display/ as formatTable/formatSkillTree (pure) with thin consola-backed emitters. These will back the rich ask list output. Includes unit tests covering empty/single/multi cases. Refs rich-list-command-20260409 T-2, T-3
Defines the typed contract shared by the upcoming text renderer and JSON emitter. Entries carry name/version/format/source/location with optional itemCount (docs) or skills (intent-skills). Includes round-trip tests and negative cases. Refs rich-list-command-20260409 T-4
Reads .ask/ask.lock as source of truth so intent-skills entries (no filesystem copy) appear alongside docs entries. Adds readIntentSkillsMap helper for grouping AGENTS.md intent-skills entries by package. Updates generateAgentsMd to filter to docs-only so intent-skills entries are not duplicated in the docs marker block. Tests cover docs/github, npm-tarball vs installPath, intent-skills with zero filesystem files, and deterministic sort order. Refs rich-list-command-20260409 T-5
buildListModel reads listDocs and shapes the entries into a schema-typed ListModel. detectConflicts is a pure helper over entries, sorted for deterministic output. Tests cover docs-only, intent-only, mixed, and unit cases for conflict detection. Refs rich-list-command-20260409 T-6
formatList returns a deterministic string (header, table, skill tree, conflicts, warnings), with renderList as a thin consola wrapper. The legacy empty message is preserved byte-for-byte so existing contracts stay stable. Tests cover empty/docs-only/intent-only/mixed/conflict scenarios. Refs rich-list-command-20260409 T-7
Adds the new ask list top-level command backed by buildListModel + renderList with a --json flag emitting a ListModelSchema-valid JSON document. The legacy ask docs list wrapper prints a deprecation warning and forwards to the shared runList helper so existing automation keeps working for one release cycle. Integration tests spawn the compiled CLI against a seeded fixture and cover: 1. ask list → rich table 2. ask docs list → same body + deprecation warning 3. ask list --json → JSON parses against ListModelSchema The child process env is scrubbed to PATH/HOME/NO_COLOR/FORCE_COLOR because bun test leaks BUN_* variables that put consola into a silent mode on macOS. Refs rich-list-command-20260409 T-8, T-9
Records the rich-list-command-20260409 contract change (ask list canonical, ask docs list deprecated) and the bun:test child_process env scrubbing requirement discovered while wiring the CLI integration test. Refs rich-list-command-20260409 T-10
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Requires human review: Refactors core documentation discovery logic to be lock-backed and restructures the list command. Large change set with architectural implications requires human review.
This was referenced Apr 9, 2026
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes
ask listto a top-level command with a rich table view and a--jsonflag. The legacyask docs listcontinues to work as a deprecated wrapper for one release cycle. Surfacesintent-skillsentries (no filesystem copy) alongsidedocsentries by driving listing off.ask/ask.lockinstead of the filesystem scan.Closes #47
Architecture
Three-layer split under
packages/cli/src/list/:model.ts): Zod schema shared between renderer and JSON outputaggregate.ts): readslistDocs(lock-backed) + detects name conflictsrender.ts): text rendering withdisplay/table.tsanddisplay/tree.tshelpers ported from @tanstack/intent (MIT attribution in header)listDocsinstorage.tsnow reads.ask/ask.lockas source of truth, enriched withformat/source/location/skills.generateAgentsMdfilters toformat === 'docs'so intent-skills don't leak into the docs marker block.Key Changes
Verification Checklist
Test plan
Summary by cubic
Adds a top-level
ask listwith a rich table and optional--jsonoutput, driven by.ask/ask.lockso it lists bothdocsandintent-skills.ask docs listis deprecated and kept for one release. Implements #47.New Features
listDocs, includingformat,source,location, anditemCountorskills.--jsonemitsListModelSchema-valid JSON for automation.packages/cli/src/display/{table,tree}.ts(from@tanstack/intent) withconsolaemitters.Migration
ask listinstead ofask docs list(wrapper warns and forwards; removal next release).ask list --jsonand validate withListModelSchema.Written for commit e0ce16f. Summary will update on new commits.