Skip to content

feat(cli): unified future entry — agent/tui/channel/loop embedded, slim build/install, future-* crate names - #116

Merged
huichen merged 3 commits into
mainfrom
claude/unified-cli
Aug 7, 2026
Merged

huichen merged 3 commits into
mainfrom
claude/unified-cli

Conversation

@huichen

@huichen huichen commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

future <cmd> is now the primary entry point for every Rust component — agent/tui/channel/loop run in-process through the unified future CLI (same code as the standalone binaries, which remain buildable via cargo build -p <crate> and runnable via make run-*).

future agent [args]     # runs the agent gRPC server (≡ future-agent)
future tui [args]       # terminal UI (≡ future-tui)
future channel [args]   # IM channel bridge (≡ future-channel)
future loop [args]      # loop control plane (≡ future-loop)

Changes

Unified CLI

  • cli dispatches the embedded components before entering its own tokio runtime (each builds its own runtime; nested runtimes would panic)
  • The old future agent status group is removed; future agent --help shows the agent's clap options
  • agent/tui/channel/loop entry points moved into their libs (future_agent::cli::run_from_args, future_channel::run, future_loop::console::run, existing future_tui::index::run); loop error hints adapt the program name (future loop vs future-loop)

Crate naming — all five component crates are now future-*

  • tui-rust → future-tui, cli-rust → future-cli (lib cli_rust → future_cli); every -p tui-rust / -p cli-rust reference updated (Makefile, test harnesses, examples, CI, Cargo.lock)

Build/install surface

  • make build = build-cli build-gui (deleted build-agent/tui/channels/loop)
  • make install = install-cli install-gui install-skills (deleted install-nogui/agent/tui/channels/loop; /future-loop skill folded into install-skills)
  • scripts/install.sh: Linux = make install-cli install-skills; macOS links the loop skill inline (no cargo build)

GUI — single Tauri sidecar

  • Only future is bundled (externalBin: ["binaries/future"]); agent_supervisor spawns future agent --grpc-addr ... — the agent code was previously duplicated in both future-agent and future (~13 MB saved in release)
  • build.yml / ci.yml / portable readmes updated

Deterministic agent wire format

  • agent/Cargo.toml explicitly enables serde_json preserve_order; without it the session-list JSON key order silently depended on cargo feature unification (build-graph dependent) and flipped the golden harness

Test cleanup

  • test-cli-rust/test-tui-rust merged into test-cli/test-tui (were aliases listed twice in make test)
  • Golden harnesses renamed diff-ts-rust.sh → golden-diff.sh (TS retired; these are golden regression gates, not live TS diffs); cli harness --record now recaptures from the Rust CLI
  • Harness normalize hardened for the now-relative session list UPDATED column

Docs — README (en/zh), build-and-install (en/zh), loop-control-plane (en/zh), tui (en/zh), wiki CLI/Feishu/DingTalk, installers, portable readmes

Verification

  • cargo build --workspace ✓
  • cargo test -p future-cli -p future-tui 604 passed; agent/loop/channel suites pass ✓
  • Golden gates: CLI 158/158, TUI render 97/97 ✓
  • cargo clippy --workspace --all-targets -- -D warnings clean, cargo fmt --check clean ✓
  • GUI cargo check (gui/src-tauri) ✓; future agent --grpc-addr ... spawn path smoke-tested ✓
  • make -n parses for all retained targets ✓

chenhui added 3 commits August 7, 2026 14:11
…m build/install surface

`future <cmd>` is now the primary entry for every Rust component:
  future agent|tui|channel|loop <args>   (same code as the standalone binaries,
  which remain buildable via cargo and runnable via make run-*)

- cli: dispatch embedded components before the CLI runtime (they build their
  own tokio runtimes); the old `future agent status` group is removed
- agent/tui/channel/loop: entry points moved into their libs so each runs
  standalone or embedded; loop error hints adapt the program name
- crates renamed to future-*: tui-rust->future-tui, cli-rust->future-cli
  (lib cli_rust->future_cli); all -p tui-rust/-p cli-rust refs updated
- Makefile: build = build-cli build-gui; install = install-cli install-gui
  install-skills (loop skill folded into install-skills); deleted
  install-nogui/agent/tui/channels/loop and build-agent/tui/channels/loop
- GUI bundles a single Tauri sidecar (future) — the agent starts via
  `future agent`; agent serde_json preserve_order made explicit so the
  session-list JSON key order is deterministic across build modes
- test targets de-rust-ified (test-cli/test-tui, was test-cli-rust/-tui-rust);
  golden harnesses renamed diff-ts-rust.sh -> golden-diff.sh (TS retired;
  --record now recaptures from the Rust CLI)
- docs: README, build-and-install, loop-control-plane, tui, wiki,
  installers, portable readmes all updated to the unified CLI
…build

future-loop was the last crate generating gRPC code in build.rs on every
build, which required protoc on PATH. Now that the unified `future` CLI
depends on future-loop (cli/Cargo.toml), any CLI build — including CI's
`cargo test -p future-cli` — failed without protoc installed.

Switch agent_client.rs to future_rpc::proto (the single proto codegen owner,
PR #112) like agent/channels/cli/tui already do; delete build.rs and the
prost-build/tonic-build/prost build deps. protoc is optional again for all
normal builds.
@huichen
huichen merged commit 874c7a7 into main Aug 7, 2026
17 checks passed
@huichen
huichen deleted the claude/unified-cli branch August 7, 2026 06:31
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.

1 participant