feat: add kilo help --all command and auto-generated CLI reference docs#8504
Merged
Conversation
…or text Add a 'kilo help' command that outputs the full CLI reference as Markdown or plain text, with support for scoping to a single command. - Extract command registrations into src/cli/commands.ts barrel - Implement generateHelp() in src/kilocode/help.ts using yargs internals - Add HelpCommand with --all, --format, and [command] positional - 8 tests covering markdown/text output, scoping, ANSI stripping, errors
Add generateCommandTable() to help.ts and a generation script that produces two artifacts: a Markdoc partial for the command table and a full CLI reference page. Both are generated by script/generate.ts and auto-committed by the generate.yml workflow on push to dev. Replace hand-written command table in cli.md with the generated partial and add a nav entry for the new CLI Command Reference page. Closes #572
…add AttachStub - Add missing await on .rejects.toThrow() assertion (false-positive risk) - Gate generateHelp on options.all so callers get empty output when neither all nor command is set - Sanitize process.cwd() paths in generated CLI reference (was leaking developer's local path into published docs) - Add AttachCommand stub to test commands array for full coverage
…, remove marker Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019c868e-3120-7158-a07f-dadb49eff19d
…kspaceServeCommand Amp-Thread-ID: https://ampcode.com/threads/T-019ca02f-4446-772c-bc1a-c2176fcb4047 Co-authored-by: Amp <amp@ampcode.com>
…path Amp-Thread-ID: https://ampcode.com/threads/T-019ca02f-4446-772c-bc1a-c2176fcb4047 Co-authored-by: Amp <amp@ampcode.com>
- Restore JSON→SQLite migration code accidentally removed from middleware - Replace console.warn with Log.Default.warn in help.ts - Fix Windows path: use path.resolve(import.meta.dir) instead of new URL().pathname - Revert unrelated process.stderr.write→console.error change - Require --all flag explicitly; kilo help with no args shows usage hint Amp-Thread-ID: https://ampcode.com/threads/T-019ca5c0-c077-76ab-9e52-4a2a7e8ed1a7 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ca5c0-c077-76ab-9e52-4a2a7e8ed1a7 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ca5c0-c077-76ab-9e52-4a2a7e8ed1a7 Co-authored-by: Amp <amp@ampcode.com>
Contributor
Author
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)The incremental Previously reported issue for the sync-test robustness at Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 667,585 tokens |
…ommands in help --all
207e81c to
7901bb6
Compare
… cli-reference The shell-completion entrypoint was registered via .completion() in index.ts but missing from the commands array used by generateHelp(). This meant kilo help --all and cli-reference.md never included it. Add a synthetic CommandModule entry for completion to commands.ts and remove the now-redundant manual row in generateCommandTable().
… typecheck UpgradeCommand and UninstallCommand are plain object literals (no cmd() wrapper) whose handler param types don't satisfy CommandModule<any, any>. Remove the annotation and let TypeScript infer the union type — consumers already cast via loadCommands().
alex-alecu
reviewed
Apr 8, 2026
The .help('help', ...) method registers yargs' built-in help command
which shadows the custom HelpCommand registered on the same 'help' path.
This means 'kilo help --all' never reaches the custom handler.
Fix by:
- Replacing .help('help', ...) with .help(false) + .option('help', ...)
to disable the built-in command while keeping --help/-h flags
- Adding early-exit handlers in middleware for --help and --version
to skip expensive initialization (telemetry, DB migration)
Contributor
alex-alecu
approved these changes
Apr 8, 2026
jliounis
pushed a commit
to jliounis/kilocode
that referenced
this pull request
May 18, 2026
feat: add kilo help --all command and auto-generated CLI reference docs
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.

Re-opens #6116 (from maphew/kilocode) with
mainmerged in and conflict resolved.Closes #6114
Summary
kilo help --allcommand that outputs full CLI reference in markdown or plain text formatgenerateCommandTable()function that produces a markdown command table from the command barrelscript/generate.ts: a Markdoc partial for the command table and a full CLI Command Reference pagecli.mdwith the generated partialCredit
The quick-reference table format was inspired by @Githubguy132010's contribution in #6294 — thanks for the idea!
Changes
kilo helpcommandsrc/kilocode/help.ts— CoregenerateHelp()+ newgenerateCommandTable()functionssrc/kilocode/help-command.ts—HelpCommandyargs CommandModulesrc/cli/commands.ts— Barrel file exporting all CommandModule objectssrc/index.ts— Replaced 19 individual.command()calls with barrel import + loopAuto-generated docs
script/generate-cli-docs.ts— Generation script (runs with--conditions=browser)src/kilocode/generate-cli-docs.ts— Entrypoint that writes both generated filesscript/generate.ts— Added CLI docs generation step before formatpackages/kilo-docs/markdoc/partials/cli-commands-table.md— Generated command table partialpackages/kilo-docs/pages/code-with-ai/platforms/cli-reference.md— Generated full reference pageDocs site updates
packages/kilo-docs/pages/code-with-ai/platforms/cli.md— Replaced hand-written table with{% partial %}packages/kilo-docs/lib/nav/code-with-ai.ts— Added "Command Reference" subLink under CLIUsage
Testing
test/kilocode/help.test.ts(no mocks) — markdown/text output, subcommands, filtering, ANSI stripping, table generation, edge casesbun turbo typecheck)cli-referencepage