Skip to content

fix: improve local command discovery - #36

Open
chaim0m wants to merge 2 commits into
mainfrom
codex/dci-local-version-command
Open

fix: improve local command discovery#36
chaim0m wants to merge 2 commits into
mainfrom
codex/dci-local-version-command

Conversation

@chaim0m

@chaim0m chaim0m commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make dci version a first-class local command instead of interpreting version as an API hostname
  • keep root help compact by showing common commands and explicit discovery paths
  • return concise unknown-command errors with close-match suggestions and exit code 2
  • emit one UNKNOWN_COMMAND JSON envelope in agent mode
  • advertise the complete machine-readable catalog when dci commands is available

Test methods

Automated validation run on this branch:

go test ./...
go vet ./...

Manual validation:

go build -o /tmp/dci-pr36 .
/tmp/dci-pr36 version
/tmp/dci-pr36 --help
/tmp/dci-pr36 list-bugets
echo $?
DCI_AGENT_MODE=1 /tmp/dci-pr36 list-bugets
echo $?

version should return locally without a network lookup. Root help should remain short. The typo should suggest list-budgets, avoid printing the complete catalog, and exit 2; agent mode should emit one JSON error.

Could this break things?

Risk: low-medium. Scripts that scrape the former very long root help, or assert the old unknown-command text, will see a change. Successful API commands are untouched. Treating version as a local command fixes the current accidental request to https://version; only an unusual workflow that intentionally used version as a host token would behave differently.

@chaim0m
chaim0m marked this pull request as ready for review August 2, 2026 13:38
@chaim0m
chaim0m requested a review from apgiorgi as a code owner August 2, 2026 13:38
@chaim0m chaim0m changed the title fix: handle version as a local command fix: improve local command discovery Aug 2, 2026
@chaim0m
chaim0m changed the base branch from main to codex/dci-command-safety August 2, 2026 13:56
@chaim0m
chaim0m force-pushed the codex/dci-command-safety branch from 6f2cbb4 to 8f765db Compare August 2, 2026 14:21
@chaim0m
chaim0m force-pushed the codex/dci-local-version-command branch from fa8a4be to 225b213 Compare August 2, 2026 14:24
@chaim0m
chaim0m changed the base branch from codex/dci-command-safety to main August 2, 2026 14:24
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