Skip to content

tui: integrate ckb-tui into ckb-cli - #683

Merged
chenyukang merged 15 commits into
nervosnetwork:developfrom
Officeyutong:ckb-tui-integration
Sep 24, 2026
Merged

chenyukang merged 15 commits into
nervosnetwork:developfrom
Officeyutong:ckb-tui-integration

Conversation

@Officeyutong

@Officeyutong Officeyutong commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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

image image

@Officeyutong
Officeyutong marked this pull request as ready for review August 6, 2026 05:00
Comment thread Cargo.toml Outdated
[target.'cfg(unix)'.dependencies]
tui = "0.6.0"
termion = "1.5"
ckb-tui = { path = "./ckb-tui" }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now using git repo to reference ckb-tui

Comment thread src/main.rs Outdated
.process(sub_matches, debug)
})
}
("tui", Some(sub_matches)) => TuiSubCommand::new().process(sub_matches, debug),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 2 Low severity

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 tui subcommand (src/subcommands/tui.rs) delegating to ckb-tui, and register it in mod.rs/main.rs.
  • Swap the local tui/termion dependencies for a ckb-tui Cargo git dependency (large transitive dependency churn in Cargo.lock, e.g. cursive, crossterm, dual clap 3/4).
  • Unrelated: change deploy snapshot timestamps to nanosecond precision with a legacy-compatible regex and tests; add submodules: true to 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.

Comment thread src/subcommands/tui.rs Outdated
Comment thread Cargo.toml
Comment thread src/subcommands/deploy/mod.rs
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@chenyukang
chenyukang merged commit d1e482b into nervosnetwork:develop Sep 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants