You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The shipped CLI surface lives in `src/main.rs`, which only wires `init`,
`input`, and `render`. The legacy `app.rs` and `args.rs` prototypes were
not in the module tree and had no inbound references, so this change deletes
those orphaned files instead of widening scope into a larger refactor.
It also aligns the TUI enhancement plan with that reality so the document no
longer describes the removed prototypes as current tracked structure.
Constraint: Must preserve shipped CLI parsing and slash-command behavior
Rejected: Refactor main.rs into smaller modules now | widens scope beyond behavior-safe cleanup
Rejected: Leave TUI plan wording untouched | leaves low-risk stale documentation behind
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep this slice deletion-first; do not reintroduce alternate CLI surfaces without wiring them into main.rs and its tests
Tested: cargo test -p rusty-claude-cli defaults_to_repl_when_no_args
Tested: cargo test -p rusty-claude-cli parses_login_and_logout_subcommands
Tested: cargo test -p rusty-claude-cli parses_direct_agents_mcp_and_skills_slash_commands
Tested: cargo test -p rusty-claude-cli direct_slash_commands_surface_shared_validation_errors
Tested: cargo test -p rusty-claude-cli parses_resume_flag_with_multiple_slash_commands -- --nocapture
Tested: cargo test -p rusty-claude-cli resumed_binary_accepts_slash_commands_with_arguments -- --nocapture
Tested: cargo check -p rusty-claude-cli
Tested: git diff --check
Not-tested: cargo clippy -p rusty-claude-cli --all-targets -- -D warnings (pre-existing failures in rust/crates/runtime/* and existing warnings outside this diff)
|**Alt App**|`app.rs` (398 lines) | An earlier `CliApp` prototype with `ConversationClient`, stream event handling, `TerminalRenderer`, output format support | ⚠️ Appears unused/legacy |
29
31
30
32
### Key Dependencies
31
33
@@ -56,7 +58,7 @@ This plan covers a comprehensive analysis of the current terminal user interface
56
58
8.**Streaming is char-by-char with artificial delay** — `stream_markdown` sleeps 8ms per whitespace-delimited chunk
57
59
9.**No color theme customization** — hardcoded `ColorTheme::default()`
58
60
10.**No resize handling** — no terminal size awareness for wrapping, truncation, or layout
59
-
11.**Dual app structs** — `app.rs` has a separate `CliApp`that duplicates`LiveCli` from `main.rs`
61
+
11.**Historical dual app split** — the repo previously carried a separate `CliApp`prototype alongside`LiveCli`; the prototype is gone, but the monolithic `main.rs` still needs extraction
60
62
12.**No pager for long outputs** — `/status`, `/config`, `/memory` can overflow the viewport
61
63
13.**Tool results not collapsible** — large bash outputs flood the screen
62
64
14.**No thinking/reasoning indicator** — when the model is in "thinking" mode, no visual distinction
@@ -73,8 +75,8 @@ This plan covers a comprehensive analysis of the current terminal user interface
73
75
| Task | Description | Effort |
74
76
|---|---|---|
75
77
| 0.1 |**Extract `LiveCli` into `app.rs`** — Move the entire `LiveCli` struct, its impl, and helpers (`format_*`, `render_*`, session management) out of `main.rs` into focused modules: `app.rs` (core), `format.rs` (report formatting), `session_manager.rs` (session CRUD) | M |
76
-
| 0.2 |**Remove or merge the legacy `CliApp`** — The existing `app.rs` has an unused `CliApp`with its own `ConversationClient`-based rendering. Either delete it or merge its unique features (stream event handler pattern) into the active `LiveCli`| S |
77
-
| 0.3 |**Extract `main.rs` arg parsing** — The current `parse_args()` is a hand-rolled parser that duplicates the clap-based `args.rs`. Consolidate on the hand-rolled parser (it's more feature-complete) and move it to `args.rs`, or adopt clap fully| S |
78
+
| 0.2 |**Keep the legacy `CliApp` removed** — The old `CliApp`prototype has already been deleted; if any unique ideas remain valuable (for example stream event handler patterns), reintroduce them intentionally inside the active `LiveCli` extraction rather than restoring the old file wholesale| S |
79
+
| 0.3 |**Extract `main.rs` arg parsing** — The current `parse_args()` is still a hand-rolled parser in `main.rs`. If parsing is extracted later, do it into a newly-introduced module intentionally rather than reviving the removed prototype `args.rs` by accident| S |
78
80
| 0.4 |**Create a `tui/` module** — Introduce `crates/rusty-claude-cli/src/tui/mod.rs` as the namespace for all new TUI components: `status_bar.rs`, `layout.rs`, `tool_panel.rs`, etc. | S |
79
81
80
82
### Phase 1: Status Bar & Live HUD
@@ -214,7 +216,7 @@ crates/rusty-claude-cli/src/
214
216
| Terminal compatibility issues (tmux, SSH, Windows) | Rely on crossterm's abstraction; test in degraded environments |
215
217
| Performance regression with rich rendering | Profile before/after; keep the fast path (raw streaming) always available |
216
218
| Scope creep into Phase 6 | Ship Phases 0–3 as a coherent release before starting Phase 6 |
217
-
|`app.rs` vs `main.rs` confusion |Phase 0.2 explicitly resolves this by removing the legacy `CliApp`|
219
+
|Historical `app.rs` vs `main.rs` confusion |Keep the legacy prototype removed and avoid reintroducing a second app surface accidentally during extraction|
0 commit comments