From 875ee2cdc26f22435acc9299d8a7fc9e69849037 Mon Sep 17 00:00:00 2001 From: barry <91018388+barry166@users.noreply.github.com> Date: Tue, 23 Jun 2026 18:31:42 +0800 Subject: [PATCH] Advertise built-in per-command help in CLI footer Issue #85 pointed out that the top-level help footer sent users to the docs even though every command already supports local --help output. This updates the footer to promote built-in per-command help first, keeps the docs link as secondary reference, and adds a dispatch-level test for the new wording.\n\nConstraint: Keep this a help-text-only change with no command behavior changes\nRejected: Expand the footer into a longer usage section | unnecessary for the narrowly scoped issue\nConfidence: high\nScope-risk: narrow\nReversibility: clean\nDirective: Keep top-level help text aligned with actual command discovery paths when adding or changing CLI commands\nTested: npm test --workspace @agentctxhq/agentctx; npm run typecheck --workspace @agentctxhq/agentctx; npm run build --workspace @agentctxhq/agentctx; npm run lint\nNot-tested: Installed global CLI output outside the workspace --- packages/agentctx/src/cli/main.ts | 4 ++-- packages/agentctx/test/cli/commands.test.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/agentctx/src/cli/main.ts b/packages/agentctx/src/cli/main.ts index 85b55ef..d330aba 100644 --- a/packages/agentctx/src/cli/main.ts +++ b/packages/agentctx/src/cli/main.ts @@ -35,8 +35,8 @@ Commands: mcp MCP stdio server exposing the ctx_* tools (started by Claude Code) hook hook dispatcher invoked by Claude Code (not for direct use) -Run any command with --help semantics via the docs: - https://github.com/agentctxhq/agentctx`; +Run \`agentctx --help\` for command-specific options. +Docs: https://github.com/agentctxhq/agentctx`; export async function main(argv: string[], env: CliEnv = defaultEnv()): Promise { const [command, ...args] = argv; diff --git a/packages/agentctx/test/cli/commands.test.ts b/packages/agentctx/test/cli/commands.test.ts index 81f58e4..0b0ed25 100644 --- a/packages/agentctx/test/cli/commands.test.ts +++ b/packages/agentctx/test/cli/commands.test.ts @@ -230,6 +230,7 @@ describe("dispatch", () => { it("prints help and version without touching the filesystem", async () => { expect(await main([], t.env)).toBe(0); expect(await main(["--version"], t.env)).toBe(0); + expect(t.stdout[0]).toContain("Run `agentctx --help` for command-specific options."); expect(existsSync(t.env.agentctxHome)).toBe(false); });