Implement rustez-cli beyond placeholder binary#21
Merged
Conversation
Approved brainstorming design for implementing the rustez-cli binary beyond its placeholder: command grammar, JSON envelope, exit-code taxonomy, credential and host-key handling, and test plan. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Task-by-task TDD plan implementing the approved CLI design: clap grammar, JSON envelope, exit-code taxonomy/classifier, credential + host-key handling, command handlers, and an ignored vSRX integration test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make --comment and --confirm-minutes mutually exclusive in clap so an audit comment can't be silently dropped on a confirmed commit. Add a clarifying comment on the bare confirming-commit flow.
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.
Summary
Closes #20. Replaces the
Hello, world!placeholder inrustez-cliwith a full command-line interface that works as both a human CLI and a stable machine-readable interface for bridge/integration use.facts,rpc <cmd> [--format text|xml], andconfig apply|diff|commit-check|commit|confirm|rollback, all sharing a flattened set of connection options.--json): identical{ok, command, host, data, error}shape across every command. Success → stdout, failure → stderr.classify(RustEzError, Phase)classifier (no library changes).-pflag (with stderr warning) >$RUSTEZ_PASSWORD> key-file > interactive TTY prompt > usage error on non-TTY.--host-key-fingerprint/--known-hosts/--accept-any-host-keyare mutually exclusive; none set → library defaultRejectAll.--commentand--confirm-minutesare mutually exclusive so an audit comment can't be silently dropped on a confirmed commit.No changes to the
rustezcore library — the CLI is built entirely on existing primitives.Test Plan
cargo test -p rustez-cli— 26 unit tests pass (arg parsing, error classifier/exit codes, JSON+text rendering, credential precedence, host-key mapping)cargo check(workspace) andcargo clippy -p rustez-cliclean--helplists all commands; missing required args → exit 1;config applywith unreadable file → exit 1 with correct text and JSONkind:usagefailure envelopeRUSTEZ_VSRX_HOST=<IP> RUSTEZ_VSRX_USER=<USER> RUSTEZ_VSRX_PASS=<PASS> cargo test -p rustez-cli -- --ignored🤖 Generated with Claude Code