tui: integrate ckb-tui into ckb-cli - #683
Conversation
# Conflicts: # Cargo.lock # src/subcommands/molecule.rs # src/utils/rpc/types.rs
| [target.'cfg(unix)'.dependencies] | ||
| tui = "0.6.0" | ||
| termion = "1.5" | ||
| ckb-tui = { path = "./ckb-tui" } |
There was a problem hiding this comment.
[P1] Keep source installs buildable
The normal clone command in the README leaves this submodule uninitialized, so cargo install --path . --locked fails because ckb-tui/Cargo.toml is missing. CI masks this with submodules: true. Please make ordinary clones buildable or update and test the documented clone flow.
There was a problem hiding this comment.
Now using git repo to reference ckb-tui
| .process(sub_matches, debug) | ||
| }) | ||
| } | ||
| ("tui", Some(sub_matches)) => TuiSubCommand::new().process(sub_matches, debug), |
There was a problem hiding this comment.
[P2] Reuse the global RPC URL
main already resolves --url, API_URL, and the config file into ckb_url, but this dispatch discards it, so tui falls back to 127.0.0.1:8114 unless --rpc-url is repeated. Please pass the resolved URL into TuiSubCommand and treat --rpc-url as an explicit override.
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It pulls a large external TUI stack via an unstable pinned Cargo git dependency (major supply-chain/reproducibility impact) and bundles an unrelated deploy change, which warrants human review.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
This PR replaces the in-tree terminal UI implementation with the external ckb-tui crate and exposes it through a new ckb-cli tui subcommand. The old src/subcommands/tui/{mod,state,util,widgets}.rs modules are deleted, a thin TuiSubCommand wrapper is added that forwards CLI arguments to ckb_tui::start_ckb_tui, and the build/CI wiring is updated. It also includes an unrelated change to deployment snapshot naming.
Changes:
- Add
tuisubcommand (src/subcommands/tui.rs) delegating tockb-tui, and register it inmod.rs/main.rs. - Swap the local
tui/termiondependencies for ackb-tuiCargo git dependency (large transitive dependency churn inCargo.lock, e.g.cursive,crossterm, dualclap3/4). - Unrelated: change deploy snapshot timestamps to nanosecond precision with a legacy-compatible regex and tests; add
submodules: trueto CI/packaging workflows.
| File | Description |
|---|---|
| src/subcommands/tui.rs | New TuiSubCommand; arg refresh-interval uses an inconsistent underscore long flag. |
| src/subcommands/tui/{mod,state,util,widgets}.rs | Removes the old in-tree TUI implementation (clean removal, no stale refs). |
| src/subcommands/mod.rs | Registers the new tui module/export. |
| src/main.rs | Wires up the tui subcommand; clones ckb_url so it can be reused. |
| src/subcommands/deploy/mod.rs | Out-of-scope snapshot naming change (nanosecond precision + regex/tests). |
| Cargo.toml | Adds ckb-tui as a git dependency (not a submodule, contrary to the description). |
| Cargo.lock | Large dependency-graph update from the new git dependency. |
| .github/workflows/ci.yaml, package.yaml | Add submodules: true steps that are no-ops (no submodule exists). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>


This PR integrates ckb-tui into ckb-cli by introducing a new subcommand

ckb-cli tui