Skip to content

A TUI for Amp#1447

Merged
LNSD merged 18 commits intoedgeandnode:mainfrom
abarmat:abarmat/tui
Dec 17, 2025
Merged

A TUI for Amp#1447
LNSD merged 18 commits intoedgeandnode:mainfrom
abarmat:abarmat/tui

Conversation

@abarmat
Copy link
Contributor

@abarmat abarmat commented Dec 16, 2025

Amp : Command & Control

I started this as an experiment since I wanted to play with Amp and I love TUIs.

The first feature was a dataset viewer but then I got carried away and added more features, that's why you will see a quite big ui.rs. Review this PR considering that I will refactor the UI into components to encapsulate drawing to the terminal and event handling.

Summary

This PR introduces ampcc, a new Terminal User Interface (TUI) application for Amp, and extracts the admin client into a separate reusable crate.

  • Terminal-based user interface for interacting with Amp nodes
  • Splash screen with logo display
  • Multiple panes with active pane concept and Tab/mouse navigation
  • Dataset schema viewer pane
  • Workers and jobs display when connected to a node
  • Loading indicator for async operations
  • Scrollable content views with scrollbars when content overflows
  • Syntax highlighting for manifest files using syntect
  • Custom theme using The Graph color palette
  • Performance optimization with state-based UI redrawing
  • Error display in footer area

Admin Client Extraction

  • Extracted admin client code from ampctl into a new admin-client crate
  • Modules included: auth, datasets, jobs, manifests, providers, workers
  • Enables code reuse between ampctl and the new ampcc TUI

Added

  • crates/bin/ampcc/ - New TUI application (app.rs, config.rs, main.rs, registry.rs, ui.rs)
  • crates/admin-client/ - Extracted admin client library
tui

Implement the ampcc TUI application in Rust and refactor the ampctl client logic into a shared crate for reuse.

- Extract admin-client crate from ampctl to centralize API interaction logic
- Implement ampcc using ratatui with 3-pane layout (sidebar, content, header)
- Add async background data fetching for responsive UI non-blocking navigation
- Support dataset listing with search/filtering and JSON manifest viewing
- Update ampctl to depend on and use the new admin-client crate
- Add support for connecting to the registry
This actually doesn't test for state changes but marks as redraw when handling events
@CLAassistant
Copy link

CLAassistant commented Dec 16, 2025

CLA assistant check
All committers have signed the CLA.

@LNSD
Copy link
Contributor

LNSD commented Dec 16, 2025

Thanks for the PR, @abarmat. The split of the admin-client into a separate crate is something that I have been deferring. Finally, the time has come 🙌🏼

I would suggest creating a crates/clients/ directory where we place the different system clients (e.g., crates/clients/admin for the admin-client crate and crates/clients/flight for the flight-client crate).

@LNSD
Copy link
Contributor

LNSD commented Dec 16, 2025

Note that one of the unit tests is failing because it requires all the workspace crate names to be listed here to pass:

const AMP_CRATES: &[&str] = &[
"admin_api",
"amp_client",
"ampctl",
"ampd",
"ampsync",
"ampup",
"arrow_to_postgres",
"auth_http",
"common",
"controller",
"dataset_store",
"datasets_common",
"datasets_derived",
"datasets_raw",
"dump",
"eth_beacon_datasets",
"evm_rpc_datasets",
"firehose_datasets",
"js_runtime",
"metadata_db",
"monitoring",
"server",
"solana_datasets",
"tests",
"worker",
];

@abarmat
Copy link
Contributor Author

abarmat commented Dec 16, 2025

@LNSD I fixed the test and moved the admin and flight clients to the /crates/clients folder. Unsure about if this change breaks any external dependencies.

@abarmat
Copy link
Contributor Author

abarmat commented Dec 16, 2025

@LNSD I'm checking the reason why the tests are failing

@LNSD
Copy link
Contributor

LNSD commented Dec 17, 2025

The current test failures are unrelated to the changes. The CI is unable to access the secrets because your PR is from a fork.

Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

The failing tests are unrelated to the PR changes. Thanks for your contribution @abarmat.

LGTM ✅

@LNSD LNSD merged commit 890a65b into edgeandnode:main Dec 17, 2025
6 of 8 checks passed
@LNSD
Copy link
Contributor

LNSD commented Dec 17, 2025

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.

4 participants