Ghost stack 11 — self-describing ghost manifest for CLI discovery#200
Draft
nahiyankhan wants to merge 1 commit into
Draft
Ghost stack 11 — self-describing ghost manifest for CLI discovery#200nahiyankhan wants to merge 1 commit into
ghost manifest for CLI discovery#200nahiyankhan wants to merge 1 commit into
Conversation
Add a ghost manifest --format json command that emits a self-describing manifest of every command and flag, so a host agent can discover the CLI in one call instead of scraping --help. Terminal help, the docs-site manifest, and this command all derive from one shared buildCliManifest() (exported from @anarchitecture/ghost/cli). Placed in the advanced group so the default help stays curated. Also removes a dead constant and unused test bindings.
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.
Stacks on #199 (
ghost/10-gather-match-rationale).What
Adds
ghost manifest --format json— a self-describing manifest of every command and flag, so a host agent can learn the CLI in one call instead of scraping--help. Mirrors the agent-discovery pattern (think OpenAPI-for-the-CLI), done at Ghost's scale.{ "apiVersion": 1, "type": "manifest", "data": { "tool": "ghost", "commands": [...], "globalOptions": [...] } }How
buildCliManifest(cli, toolName)incommand-discovery.ts, exported from@anarchitecture/ghost/cli. The terminal help, the docs-site manifest (scripts/dump-cli-help.mjs), and the new command now all derive from one shape — they can't drift (guarded bycheck:cli-manifest).commands/manifest-command.ts, registered incli.ts.defaultHelp: false): hidden from the defaultghost --help, shown underghost --help --all. Near-zero surface cost.dump-cli-help.mjsshrinks 48 → ~7 lines by consuming the shared builder.Housekeeping
INDEX_FILENAMEconstant and unused test bindings (clears pre-existing biome warnings).Tests
--formatrejection (exit 2).pnpm checkclean incl. manifest drift in sync.Changeset:
minor(new command + new public export).