Skip to content

fix: print CLI usage errors and reject empty inputs - #8

Merged
EauDoon merged 1 commit into
mainfrom
devloop/cycle-03-cli-usage-help
Aug 29, 2026
Merged

fix: print CLI usage errors and reject empty inputs#8
EauDoon merged 1 commit into
mainfrom
devloop/cycle-03-cli-usage-help

Conversation

@EauDoon

@EauDoon EauDoon commented Aug 29, 2026

Copy link
Copy Markdown
Owner

What

Improve the Agent Action Stack CLI around help text and edge-case inputs.

  • Document options, help flags, the prove scenario, and exit codes in aas help.
  • aas demo --help / -h now print help (exit 0) instead of treating --help as an unsupported option.
  • Unknown commands, unknown flags, unexpected arguments, and empty --response/--fault values fail as usage errors (exit 2) with a hint to run aas help.
  • --json still prints usage failures as JSON on stderr.
  • Missing child CLIs fail closed with a bootstrap hint before spawn.
  • Empty prove scenarios are rejected before MandateBound is invoked.

Why

aas demo --help previously dumped {"error":{"message":"Unsupported demo option: --help"}}. Unknown commands printed help with no indication of what was wrong, empty option values and missing child tools produced confusing child-process errors, and help text did not describe flags or exit codes.

How tested

  • node --check bin/aas.mjs bin/aas-gui.mjs scripts/bootstrap.mjs
  • npm test (32 passing, including new coverage for help tokens, usage errors, empty scenario, and missing child tools)

Devin Review

Unknown commands, flags, empty option values, empty prove scenarios,
and missing child tools now fail closed with a usage or bootstrap hint.
`aas demo --help` prints help instead of an unsupported-option error.
@EauDoon
EauDoon merged commit bc1f323 into main Aug 29, 2026
2 of 5 checks passed
@EauDoon
EauDoon deleted the devloop/cycle-03-cli-usage-help branch August 29, 2026 21:44

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Devin Review

Comment thread bin/aas.mjs
const command = argv[0] ?? "help";
if (command === "help" || command === "--help" || command === "-h") {
const asJson = has(argv, "--json");
if (isHelpToken(command) || (command === "demo" && demoRequestsHelp(argv.slice(1)))) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Help hides malformed demo commands

A standalone help flag makes main skip validation of every other demo argument. Malformed commands then print help and exit successfully.

Prompt for agents
Validate demo arguments before taking the help-success path, while preserving the rule that --help or -h used as a value remains a missing-value error. A standalone help flag can request help only when all remaining arguments are structurally valid. Add tests combining help with unknown, unexpected, and duplicate options so malformed demo commands retain exit code 2.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant