feat(cli): Implement dpack CLI Binary with Progress Tracking#8
Merged
Conversation
…led phase callbacks
…ous input options
… better readability
4 tasks
There was a problem hiding this comment.
Pull request overview
This PR introduces a dpack command-line binary that exposes the existing side-chain packing engine with an interactive terminal UI, and adds a Progress callback trait to the core packing pipeline to report phase-level progress.
Changes:
- Added a
Progresstrait (with a()no-op implementation) and threaded progress callbacks through the packing phases. - Implemented a new
dpackCLI binary withclapargument parsing, config mapping, and anindicatif-based progress UI. - Updated
Cargo.tomlto add CLI dependencies behind aclifeature and register the new binary target.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pack/progress.rs | Defines Progress callbacks and the no-op () implementation. |
| src/pack/phase/mod.rs | Genericizes pack over a Progress type and emits progress/stats for each phase. |
| src/pack/mod.rs | Wires the new progress module and re-exports Progress. |
| src/lib.rs | Re-exports Progress at the crate root. |
| src/bin/dpack/main.rs | Adds the dpack entry point: parse args, read/write structures, invoke packing with/without UI progress. |
| src/bin/dpack/args.rs | Defines the CLI surface (subcommands and flags). |
| src/bin/dpack/config.rs | Maps CLI args into ReadConfig/PackConfig and resolves scope/output formats. |
| src/bin/dpack/ui.rs | Implements banners, spinners, and phase progress display via indicatif. |
| Cargo.toml | Adds cli feature deps, registers dpack bin, and updates package metadata/categories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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:
Implemented the
dpackcommand-line interface (CLI) to expose the core packing engine. Added robust argument parsing, configuration mapping, and a rich interactive terminal UI. Introduced a zero-costProgresstrait to the core pipeline for real-time phase tracking without compromising library performance.Changes:
bin/dpack): Created the standalonedpackbinary usingclap, featuring nested subcommands for different packing scopes (full,pocket,interface,list).config.rs) to map CLI arguments into coreReadConfigandPackConfigstructs.ui.rs): Built a responsive terminal UI usingindicatifandconsole, including startup banners, load spinners, and live multi-progress bars for phase execution.Progresstrait (progress.rs) and genericized thepackorchestrator to broadcast phase-level metrics (e.g., edges, candidates, elimination counts).()implementation of theProgresstrait, ensuring zero runtime overhead when the library is used programmatically without a UI.anyhow,clap,indicatif,console) behind aclifeature flag inCargo.toml.