feat(cli): add first-class digs alias binary for digstore - #16
Merged
Conversation
`digs <args>` now behaves IDENTICALLY to `digstore <args>` — same subcommands, flags, --json, help, and exit codes (issue #434). - Add a second `[[bin]] digs` target sharing ONE codepath: `main()` is extracted into `digstore_cli::run()`, and both `src/main.rs` and `src/bin/digs.rs` are thin shims over it (no duplicated logic). - Parse argv with the invoked binary's name (arg0 file-stem, via the new `invoked_bin_name()`) as clap's program + bin name, so `digs --help`/`--version`/errors read `digs`, not a hardcoded `digstore` (nor the raw absolute arg0 path). - `completion` + `--help-json` emit the invoked name too, so `digs completion <shell>` binds to `digs` and `digs --help-json` reports `"name":"digs"`. - release.yml builds + publishes `digs` alongside `digstore` in both asset shapes (bare per-OS binaries for the universal installer, and the linux .tar.gz for apt), so both ship everywhere digstore ships. - SPEC.md documents the alias. New integration suite proves both bins build, share a byte-identical command surface, and each reflects its own invoked name. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Jul 12, 2026
Merged
MichaelTaylor3d
added a commit
to DIG-Network/docs.dig.net
that referenced
this pull request
Jul 12, 2026
…#35) digs ships as a real installed binary alongside digstore everywhere digstore ships (cargo-install, the universal installer, the apt .deb). digs <args> is identical to digstore <args> (same commands, flags, and --json output). Notes this on the CLI install page and the command reference intro. Refs DIG-Network/dig_ecosystem#434, DIG-Network/digs#16 Co-authored-by: Claude <noreply@anthropic.com>
MichaelTaylor3d
added a commit
to DIG-Network/apt.dig.net
that referenced
this pull request
Jul 12, 2026
digstore's release tarball will carry `digs` (a first-class alias binary, `digs <args>` == `digstore <args>`, digstore#16) alongside `digstore` at the archive root. stage_deb now accepts extra NAME:SRC pairs to install additional binaries under /usr/bin, and config.sh declares PKG_digstore_EXTRA_BINS="digs" so build-deb.sh extracts and packages it too. Extraction of an extra binary is non-fatal (extract_binary now returns 1 instead of erroring when the archive-relative path is absent), matching the existing "skip, don't fail" resilience contract for missing upstream assets — so the pipeline stays green against releases that predate digstore#16 and picks up `digs` automatically once it ships. Refs #434 (DIG-Network/dig_ecosystem), DIG-Network/digs#16. Co-authored-by: Claude <noreply@anthropic.com>
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.
TLDR
digs <args>now behaves identically todigstore <args>— a first-class installed alias binary (not a shell alias), shipped alongsidedigstoreeverywhere. Closes DIG-Network/dig_ecosystem#434.What changed
[[bin]] digstarget incrates/digstore-cli/Cargo.toml, sharing ONE codepath:main()'s body was extracted intodigstore_cli::run();src/main.rsand the newsrc/bin/digs.rsare thin shims over it (DRY — no duplicated logic).run()parses argv with the invoked binary's name (arg0 file-stem, via the newinvoked_bin_name()) as clap's program + bin name, sodigs --help/--version/errors readdigs— not a hardcodeddigstore, and not the raw absolute arg0 path.completion+--help-jsonemit the invoked name too:digs completion <shell>binds completions todigs, anddigs --help-jsonreports"name":"digs".digsbesidedigstorein BOTH asset shapes: bare per-OS binaries (digs-<ver>-<os>-<arch>for dig-installer's RawBinary matcher) and the linux.tar.gz(now carrying bothdigstore+digsat root, for apt's.deb).tests/cli_digs_alias.rsproves parity.Note on scope: human-facing example/hint text (
after_helpblocks, "next: digstore …" hints) intentionally keeps the canonicaldigstorename — those commands work verbatim underdigssince the surface is identical, and rewriting every hint to be dynamic would thread the bin-name through the whole output layer for no behavioral gain.publish-binary.ymlis untouched: it is the hub compile-worker S3 sync (needs onlydigstore compile), not the per-OS release-asset workflow.How verified (this session, Windows + short CARGO_TARGET_DIR)
cargo fmt -p digstore-cli -- --checkclean; clippycargo clippy -p digstore-cli --all-targets -- -D warningsclean.cargo test -p digstore-cli— 271 lib unit tests + every integration suite pass, 0 failures (themain→run()refactor is behavior-preserving).digs 0.13.0vsdigstore 0.13.0, same semver),Usage: digs, byte-identical--help-jsoncommand tree/globals/exit-codes (onlynamediffers),digs completion bashcontains zerodigstorereferences, anddigs --json status→ identicalNO_STORE/exit-3 envelope.cargo install --path crates/digstore-cli --force --lockedproduced BOTH~/.cargo/bin/digstore.exeanddigs.exe(identical 32,075,776 bytes);digs --version==digstore --versionsemver; and a real init → add → commit → log → status flow completed under the installeddigs(produced a real capsule).Blast radius (gitnexus)
impacton the touched entrypoint symbols is LOW:print_help_jsonis called only from themainflow;completion::runhas no symbol-level upstream.detect_changesconfirms the changed symbols are exactlymain,completion::run,print_help_json+ the two docs — the 9 "affected processes" are all theMain → Xentry flows, unchanged in behavior (verified by the green suite).Version bump
0.12.0 → 0.13.0(minor): a new, backwards-compatible capability (a new binary), no change to existingdigstorebehavior.