Skip to content

feat(cli): Implement dpack CLI Binary with Progress Tracking#8

Merged
TKanX merged 11 commits intomainfrom
feature/7-implement-cli-binary-dpack
Apr 1, 2026
Merged

feat(cli): Implement dpack CLI Binary with Progress Tracking#8
TKanX merged 11 commits intomainfrom
feature/7-implement-cli-binary-dpack

Conversation

@TKanX
Copy link
Copy Markdown
Member

@TKanX TKanX commented Apr 1, 2026

Summary:

Implemented the dpack command-line interface (CLI) to expose the core packing engine. Added robust argument parsing, configuration mapping, and a rich interactive terminal UI. Introduced a zero-cost Progress trait to the core pipeline for real-time phase tracking without compromising library performance.

Changes:

  • CLI Application (bin/dpack): Created the standalone dpack binary using clap, featuring nested subcommands for different packing scopes (full, pocket, interface, list).
  • Configuration Mapping: Implemented robust translation logic (config.rs) to map CLI arguments into core ReadConfig and PackConfig structs.
  • Interactive UI (ui.rs): Built a responsive terminal UI using indicatif and console, including startup banners, load spinners, and live multi-progress bars for phase execution.
  • Pipeline Progress Trait: Defined a Progress trait (progress.rs) and genericized the pack orchestrator to broadcast phase-level metrics (e.g., edges, candidates, elimination counts).
  • Zero-cost Abstraction: Provided a default no-op () implementation of the Progress trait, ensuring zero runtime overhead when the library is used programmatically without a UI.
  • Build Configuration: Added optional CLI dependencies (anyhow, clap, indicatif, console) behind a cli feature flag in Cargo.toml.

@TKanX TKanX self-assigned this Apr 1, 2026
Copilot AI review requested due to automatic review settings April 1, 2026 00:41
@TKanX TKanX added the enhancement ✨ New feature or request label Apr 1, 2026
@TKanX TKanX linked an issue Apr 1, 2026 that may be closed by this pull request
4 tasks
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Progress trait (with a () no-op implementation) and threaded progress callbacks through the packing phases.
  • Implemented a new dpack CLI binary with clap argument parsing, config mapping, and an indicatif-based progress UI.
  • Updated Cargo.toml to add CLI dependencies behind a cli feature 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.

Comment thread src/pack/phase/mod.rs
Comment thread src/pack/phase/mod.rs
Comment thread Cargo.toml
@TKanX TKanX merged commit 4209483 into main Apr 1, 2026
6 checks passed
@TKanX TKanX deleted the feature/7-implement-cli-binary-dpack branch April 1, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CLI Binary (dpack)

2 participants