Skip to content

docs(cli): proposal — command-descriptor registry for help + stash manifest --json#558

Merged
coderdan merged 1 commit into
mainfrom
docs/cli-help-and-manifest-proposal
Jul 6, 2026
Merged

docs(cli): proposal — command-descriptor registry for help + stash manifest --json#558
coderdan merged 1 commit into
mainfrom
docs/cli-help-and-manifest-proposal

Conversation

@coderdan

@coderdan coderdan commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Proposal / for discussion (a plan doc under docs/plans/, no code yet).

Why

The docs V2 CLI reference is generated from the stash CLI (cipherstash/docs#45). Building it surfaced two problems worth fixing at the source:

  1. Help drifts from the implementation. The top-level help is a hand-written HELP string in packages/cli/src/bin/main.ts, separate from the command modules — so it lags real behaviour. (The published stash@0.16.0 --help still lists db install while main.ts has already moved it to eql install; docs generated from the published --help were a whole command surface behind.)
  2. Per-command help is inconsistent. auth implements its own --help; eql/db/most commands fall through to the top-level help. And there's no machine-readable output for docs/agents.

What the proposal covers

A command-descriptor registry (one descriptor per command: summary, long, examples, flags → points at the existing handler) that renders:

  • the top-level --help (replacing the hand-written string),
  • consistent stash <command> --help for every command,
  • stash manifest --json — the structured, versioned surface the docs generator and agents consume.

Includes: the manifest JSON contract (exactly what cipherstash/docs#45 already targets — swapping to it deletes the docs-side --help parser), an auth worked example, the GitHub-CLI/cobra prior art and content split (per-command reference in the CLI; cross-command concepts in docs), and an incremental, non-breaking migration (add registry + manifest --json first → unblocks docs → migrate help rendering group by group).

Full doc: docs/plans/cli-help-and-manifest.md.

Ask

Sanity-check the approach and the manifest schema. Once the additive step (registry + manifest --json) lands, the docs flip from --help-scraping to the manifest with no format change.

Related: cipherstash/docs#45 (the generator + hybrid supplement model).

https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA

Summary by CodeRabbit

  • Documentation
    • Added a proposal outlining a more structured stash CLI help system.
    • Describes consistent help output for commands and a machine-readable manifest for documentation and automation.
    • Includes an example metadata format, migration approach, and open questions for implementation.

…anifest --json`

Proposes replacing the hand-written HELP string in packages/cli/src/bin/main.ts
with a per-command descriptor registry that renders the top-level help,
consistent per-command `--help`, and a `stash manifest --json`. Fixes help/impl
drift and inconsistent per-command help (auth has it, db/eql don't), and gives
the docs generator (cipherstash/docs#45) and agents a structured, versioned
command surface. Includes the manifest JSON contract, an `auth` worked example,
GitHub-CLI prior art, and an incremental migration plan.

Claude-Session: https://claude.ai/code/session_01CqDNqLSEEkCi7xAJFq7HJA
@coderdan coderdan requested a review from a team as a code owner July 5, 2026 13:51
@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1ed5f4b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new documentation file proposing a command-descriptor registry for the stash CLI, replacing hand-written help text with structured descriptors, and introducing a stash manifest --json output for machine-readable command metadata consumed by docs generation.

Changes

Proposal Document

Layer / File(s) Summary
Problem statement and design overview
docs/plans/cli-help-and-manifest.md
Frames the proposal scope and defines replacing the static HELP string with a descriptor registry and renderers for top-level/per-command help and JSON manifest output.
Manifest contract and worked example
docs/plans/cli-help-and-manifest.md
Specifies the stash manifest --json JSON structure and shows a worked auth login example feeding help, JSON, and docs outputs from shared descriptor data.
Docs integration, migration plan, and open questions
docs/plans/cli-help-and-manifest.md
Describes docs generation switching to consume the manifest, lists prior art, gives an incremental migration sequence, and raises open questions on argument parsing and content placement.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: tobyhede

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the proposal document’s main change: a command-descriptor registry for help output and stash manifest --json.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/cli-help-and-manifest-proposal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/plans/cli-help-and-manifest.md`:
- Around line 83-85: Add a shell language tag to the markdown code fence in the
manifest example so it satisfies markdownlint MD040 and reads as a Bash snippet.
Update the fenced block around the `npx stash@<latest> manifest --json` example
in the docs file to use `bash` for the code fence.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f2cebd28-7fcc-4323-a7da-b3bcc03e7bc6

📥 Commits

Reviewing files that changed from the base of the PR and between 93b2929 and 1ed5f4b.

📒 Files selected for processing (1)
  • docs/plans/cli-help-and-manifest.md

Comment on lines +83 to +85
```
npx stash@<latest> manifest --json
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language tag to this code fence.

Markdownlint flags this block (MD040), and marking it as shell improves readability.

Suggested fix
-```
+```bash
 npx stash@<latest> manifest --json

</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 83-83: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/plans/cli-help-and-manifest.md` around lines 83 - 85, Add a shell
language tag to the markdown code fence in the manifest example so it satisfies
markdownlint MD040 and reads as a Bash snippet. Update the fenced block around
the `npx stash@<latest> manifest --json` example in the docs file to use `bash`
for the code fence.

Source: Linters/SAST tools

@coderdan coderdan merged commit 7f67e11 into main Jul 6, 2026
9 checks passed
@coderdan coderdan deleted the docs/cli-help-and-manifest-proposal branch July 6, 2026 03:27
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.

2 participants