Problem
Running agentctx profile with no subcommand prints the usage block to stdout and then returns exit code 1:
- File / line:
packages/agentctx/src/cli/profile-cmd.ts:29-33
case undefined:
case "--help":
case "help":
env.io.out(PROFILE_USAGE); // → stdout
return command === undefined ? 1 : 0; // no subcommand → exit 1
This is inconsistent with the rest of the CLI in two ways:
-
Every other "missing required argument" path writes usage to stderr (env.io.err), not stdout, while returning 1 — e.g. search with no query (cli/search.ts:42-44), show with no id (cli/show.ts:36-38), and even profile's own edit/clear subcommands (cli/profile-cmd.ts:95, :140). A non-zero exit that prints to stdout is the odd one out; scripts checking $? get an error code while the diagnostic went to stdout instead of stderr.
-
The top-level no-command case returns 0 (cli/main.ts:46-51 prints HELP to stdout and returns 0), so the two "no command given" entry points disagree on exit code.
The result is real but minor: agentctx profile looks like a help invocation (usage on stdout) yet signals failure (exit 1), and the stream/exit-code pairing doesn't match the conventions used everywhere else.
What done looks like
agentctx profile with no subcommand routes its usage output through the same channel/exit-code convention as the rest of the CLI: either treat it as an error (usage → env.io.err, exit 1, matching search/show) or as help (usage → stdout, exit 0, matching the top-level --help). Pick one and apply it consistently.
agentctx profile --help / agentctx profile help continue to print usage to stdout and exit 0.
- A test in
test/cli/ asserts the chosen stream and exit code for the no-subcommand invocation.
Problem
Running
agentctx profilewith no subcommand prints the usage block to stdout and then returns exit code 1:packages/agentctx/src/cli/profile-cmd.ts:29-33This is inconsistent with the rest of the CLI in two ways:
Every other "missing required argument" path writes usage to stderr (
env.io.err), not stdout, while returning 1 — e.g.searchwith no query (cli/search.ts:42-44),showwith no id (cli/show.ts:36-38), and evenprofile's ownedit/clearsubcommands (cli/profile-cmd.ts:95,:140). A non-zero exit that prints to stdout is the odd one out; scripts checking$?get an error code while the diagnostic went to stdout instead of stderr.The top-level no-command case returns 0 (
cli/main.ts:46-51printsHELPto stdout and returns 0), so the two "no command given" entry points disagree on exit code.The result is real but minor:
agentctx profilelooks like a help invocation (usage on stdout) yet signals failure (exit 1), and the stream/exit-code pairing doesn't match the conventions used everywhere else.What done looks like
agentctx profilewith no subcommand routes its usage output through the same channel/exit-code convention as the rest of the CLI: either treat it as an error (usage →env.io.err, exit 1, matchingsearch/show) or as help (usage → stdout, exit 0, matching the top-level--help). Pick one and apply it consistently.agentctx profile --help/agentctx profile helpcontinue to print usage to stdout and exit 0.test/cli/asserts the chosen stream and exit code for the no-subcommand invocation.