Skip to content

feat(devkit): add completions, version, config subcommands and piped input support#423

Open
RennyThompson wants to merge 1 commit into
StellarCommons:mainfrom
RennyThompson:feat/devkit-cli-v2-completions-version-config-piped-input
Open

feat(devkit): add completions, version, config subcommands and piped input support#423
RennyThompson wants to merge 1 commit into
StellarCommons:mainfrom
RennyThompson:feat/devkit-cli-v2-completions-version-config-piped-input

Conversation

@RennyThompson

Copy link
Copy Markdown

Summary

Implements four CLI v2 features assigned to @RennyThompson:

Files changed

File Purpose
packages/devkit/Cargo.toml Add clap_complete dep; enable clap env feature
packages/devkit/build.rs Capture git SHA, build time, rustc version, target triple at compile time
src/cli/completions.rs ShellType enum + CompletionsArgs
src/cli/version.rs BuildInfo struct + VersionArgs
src/cli/config.rs Config struct (env + file loading) + ConfigArgs
src/cli/mod.rs New Commands variants; InputSource (File/Stdin); DataQualityReport; FeeSummary
src/utilities/mod.rs Expose csv_reader and json_reader
src/utilities/csv_reader.rs Read/write CSV fee data; stdin support
src/utilities/json_reader.rs Read/write JSON fee data; stdin support
src/lib.rs Re-export utilities module

Testing

Each new module includes inline unit tests covering happy paths, edge cases, and error conditions.

…nfig, piped input

Closes StellarCommons#400 — Add completions subcommand with bash/zsh/fish support via clap_complete
Closes StellarCommons#401 — Add version subcommand with build metadata (commit, timestamp, rustc, target)
Closes StellarCommons#402 — Add config subcommand showing active key/value pairs with env/default source
Closes StellarCommons#403 — Add piped stdin support to validate and inspect subcommands

Changes:
- packages/devkit/Cargo.toml: add clap_complete dependency; enable clap env feature
- packages/devkit/build.rs: capture git SHA, build timestamp, rustc version, target at compile time
- src/cli/completions.rs: ShellType enum + CompletionsArgs that generates shell scripts via clap_complete
- src/cli/version.rs: BuildInfo struct with display/JSON output; VersionArgs with --json/--check flags
- src/cli/config.rs: Config struct loading from env vars + optional file; ConfigArgs run() displays table
- src/cli/mod.rs: add Completions/Version/Config/Validate/Inspect variants to Commands enum;
  add InputSource enum (File | Stdin) with load_csv/load_json helpers; add DataQualityReport
  and FeeSummary structs used by validate/inspect dispatch
- src/utilities/mod.rs: new module exporting csv_reader and json_reader
- src/utilities/csv_reader.rs: read_csv_file, read_csv_stdin, read_csv_str, write_csv_str/file
- src/utilities/json_reader.rs: read_json_file, read_json_stdin, read_json_str, write_json_str/file
- src/lib.rs: expose utilities module
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@RennyThompson Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant