Skip to content

Commit ea9717d

Browse files
cteroomotegithub-actions[bot]mrubensdaniel-lxs
authored
Add a TUI (#10480)
Co-authored-by: Roo Code <roomote@roocode.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com> Co-authored-by: Daniel <57051444+daniel-lxs@users.noreply.github.com>
1 parent 1e62b5d commit ea9717d

132 files changed

Lines changed: 20537 additions & 3169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/cli/CHANGELOG.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Changelog
2+
3+
All notable changes to the `@roo-code/cli` package will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.0.45] - 2026-01-08
9+
10+
### Changed
11+
12+
- **Major Refactor**: Extracted ~1400 lines from [`App.tsx`](src/ui/App.tsx) into reusable hooks and utilities for better maintainability:
13+
14+
- [`useExtensionHost`](src/ui/hooks/useExtensionHost.ts) - Extension host connection and lifecycle management
15+
- [`useMessageHandlers`](src/ui/hooks/useMessageHandlers.ts) - Message processing and state updates
16+
- [`useTaskSubmit`](src/ui/hooks/useTaskSubmit.ts) - Task submission logic
17+
- [`useGlobalInput`](src/ui/hooks/useGlobalInput.ts) - Global keyboard shortcut handling
18+
- [`useFollowupCountdown`](src/ui/hooks/useFollowupCountdown.ts) - Auto-approval countdown logic
19+
- [`useFocusManagement`](src/ui/hooks/useFocusManagement.ts) - Input focus state management
20+
- [`usePickerHandlers`](src/ui/hooks/usePickerHandlers.ts) - Picker component event handling
21+
- [`uiStateStore`](src/ui/stores/uiStateStore.ts) - UI-specific state (showExitHint, countdown, etc.)
22+
- Tool data utilities ([`extractToolData`](src/ui/utils/toolDataUtils.ts), `formatToolOutput`, etc.)
23+
- [`HorizontalLine`](src/ui/components/HorizontalLine.tsx) component
24+
25+
- **Performance Optimizations**:
26+
27+
- Added RAF-style scroll throttling to reduce state updates
28+
- Stabilized `useExtensionHost` hook return values with `useCallback`/`useMemo`
29+
- Added streaming message debouncing to batch rapid partial updates
30+
- Added shallow array equality checks to prevent unnecessary re-renders
31+
32+
- Simplified [`ModeTool`](src/ui/components/tools/ModeTool.tsx) layout to horizontal with mode suffix
33+
- Simplified logging by removing verbose debug output and adding first/last partial message logging pattern
34+
- Updated Nerd Font icon codepoints in [`Icon`](src/ui/components/Icon.tsx) component
35+
36+
### Added
37+
38+
- `#` shortcut in help trigger for quick access to task history autocomplete
39+
40+
### Fixed
41+
42+
- Fixed a crash in message handling
43+
- Added protected file warning in tool approval prompts
44+
- Enabled `alwaysAllowWriteProtected` for non-interactive mode
45+
46+
### Removed
47+
48+
- Removed unused `renderLogger.ts` utility file
49+
50+
### Tests
51+
52+
- Updated extension-host tests to expect `[Tool Request]` format
53+
- Updated Icon tests to expect single-char Nerd Font icons
54+
55+
## [0.0.44] - 2026-01-08
56+
57+
### Added
58+
59+
- **Tool Renderer Components**: Specialized renderers for displaying tool outputs with optimized formatting for each tool type. Each renderer provides a focused view of its data structure.
60+
61+
- [`FileReadTool`](src/ui/components/tools/FileReadTool.tsx) - Display file read operations with syntax highlighting
62+
- [`FileWriteTool`](src/ui/components/tools/FileWriteTool.tsx) - Show file write/edit operations with diff views
63+
- [`SearchTool`](src/ui/components/tools/SearchTool.tsx) - Render search results with context
64+
- [`CommandTool`](src/ui/components/tools/CommandTool.tsx) - Display command execution with output
65+
- [`BrowserTool`](src/ui/components/tools/BrowserTool.tsx) - Show browser automation actions
66+
- [`ModeTool`](src/ui/components/tools/ModeTool.tsx) - Display mode switching operations
67+
- [`CompletionTool`](src/ui/components/tools/CompletionTool.tsx) - Show task completion status
68+
- [`GenericTool`](src/ui/components/tools/GenericTool.tsx) - Fallback renderer for other tools
69+
70+
- **History Trigger**: New `#` trigger for task history autocomplete with fuzzy search support. Type `#` at the start of a line to browse and resume previous tasks.
71+
72+
- [`HistoryTrigger.tsx`](src/ui/components/autocomplete/triggers/HistoryTrigger.tsx) - Trigger implementation with fuzzy filtering
73+
- Shows task status, mode, and relative timestamps
74+
- Supports keyboard navigation for quick task selection
75+
76+
- **Release Confirmation Prompt**: The release script now prompts for confirmation before creating a release.
77+
78+
### Fixed
79+
80+
- Task history picker selection and navigation issues
81+
- Mode switcher keyboard handling bug
82+
83+
### Changed
84+
85+
- Reorganized test files into `__tests__` directories for better project structure
86+
- Refactored utility modules into dedicated `utils/` directory
87+
88+
## [0.0.43] - 2026-01-07
89+
90+
### Added
91+
92+
- **Toast Notification System**: New toast notifications for user feedback with support for info, success, warning, and error types. Toasts auto-dismiss after a configurable duration and are managed via Zustand store.
93+
94+
- New [`ToastDisplay`](src/ui/components/ToastDisplay.tsx) component for rendering toast messages
95+
- New [`useToast`](src/ui/hooks/useToast.ts) hook for managing toast state and displaying notifications
96+
97+
- **Global Input Sequences Registry**: Centralized system for handling keyboard shortcuts at the application level, preventing conflicts with input components.
98+
99+
- New [`globalInputSequences.ts`](src/ui/utils/globalInputSequences.ts) utility module
100+
- Support for Kitty keyboard protocol (CSI u encoding) for better terminal compatibility
101+
- Built-in sequences for `Ctrl+C` (exit) and `Ctrl+M` (mode cycling)
102+
103+
- **Local Tarball Installation**: The install script now supports installing from a local tarball via the `ROO_LOCAL_TARBALL` environment variable, useful for offline installation or testing pre-release builds.
104+
105+
### Changed
106+
107+
- **MultilineTextInput**: Updated to respect global input sequences, preventing the component from consuming shortcuts meant for application-level handling.
108+
109+
### Tests
110+
111+
- Added comprehensive tests for the toast notification system
112+
- Added tests for global input sequence matching
113+
114+
## [0.0.42] - 2025-01-07
115+
116+
The cli is alive!

apps/cli/README.md

Lines changed: 92 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ By default, the CLI prompts for approval before executing actions:
7171
```bash
7272
export OPENROUTER_API_KEY=sk-or-v1-...
7373

74-
roo "What is this project?" --workspace ~/Documents/my-project
74+
roo ~/Documents/my-project -P "What is this project?"
75+
```
76+
77+
You can also run without a prompt and enter it interactively in TUI mode:
78+
79+
```bash
80+
roo ~/Documents/my-project
7581
```
7682

7783
In interactive mode:
@@ -86,32 +92,84 @@ In interactive mode:
8692
For automation and scripts, use `-y` to auto-approve all actions:
8793

8894
```bash
89-
roo -y "Refactor the utils.ts file" --workspace ~/Documents/my-project
95+
roo ~/Documents/my-project -y -P "Refactor the utils.ts file"
9096
```
9197

9298
In non-interactive mode:
9399

94100
- Tool, command, browser, and MCP actions are auto-approved
95-
- Followup questions show a 10-second timeout, then auto-select the first suggestion
101+
- Followup questions show a 60-second timeout, then auto-select the first suggestion
96102
- Typing any key cancels the timeout and allows manual input
97103

104+
### Roo Code Cloud Authentication
105+
106+
To use Roo Code Cloud features (like the provider proxy), you need to authenticate:
107+
108+
```bash
109+
# Log in to Roo Code Cloud (opens browser)
110+
roo auth login
111+
112+
# Check authentication status
113+
roo auth status
114+
115+
# Log out
116+
roo auth logout
117+
```
118+
119+
The `auth login` command:
120+
121+
1. Opens your browser to authenticate with Roo Code Cloud
122+
2. Receives a secure token via localhost callback
123+
3. Stores the token in `~/.config/roo/credentials.json`
124+
125+
Tokens are valid for 90 days. The CLI will prompt you to re-authenticate when your token expires.
126+
127+
**Authentication Flow:**
128+
129+
```
130+
┌──────┐ ┌─────────┐ ┌───────────────┐
131+
│ CLI │ │ Browser │ │ Roo Code Cloud│
132+
└──┬───┘ └────┬────┘ └───────┬───────┘
133+
│ │ │
134+
│ Open auth URL │ │
135+
│─────────────────>│ │
136+
│ │ │
137+
│ │ Authenticate │
138+
│ │─────────────────────>│
139+
│ │ │
140+
│ │<─────────────────────│
141+
│ │ Token via callback │
142+
│<─────────────────│ │
143+
│ │ │
144+
│ Store token │ │
145+
│ │ │
146+
```
147+
98148
## Options
99149

100-
| Option | Description | Default |
101-
| --------------------------------- | ------------------------------------------------------------------------------ | ----------------- |
102-
| `-w, --workspace <path>` | Workspace path to operate in | Current directory |
103-
| `-e, --extension <path>` | Path to the extension bundle directory | Auto-detected |
104-
| `-v, --verbose` | Enable verbose output (show VSCode and extension logs) | `false` |
105-
| `-d, --debug` | Enable debug output (includes detailed debug information, prompts, paths, etc) | `false` |
106-
| `-x, --exit-on-complete` | Exit the process when task completes (useful for testing) | `false` |
107-
| `-y, --yes` | Non-interactive mode: auto-approve all actions | `false` |
108-
| `-k, --api-key <key>` | API key for the LLM provider | From env var |
109-
| `-p, --provider <provider>` | API provider (anthropic, openai, openrouter, etc.) | `openrouter` |
110-
| `-m, --model <model>` | Model to use | Provider default |
111-
| `-M, --mode <mode>` | Mode to start in (code, architect, ask, debug, etc.) | `code` |
112-
| `-r, --reasoning-effort <effort>` | Reasoning effort level (none, minimal, low, medium, high, xhigh) | `medium` |
113-
114-
By default, the CLI runs in quiet mode (suppressing VSCode/extension logs) and only shows assistant output. Use `-v` to see all logs, or `-d` for detailed debug information.
150+
| Option | Description | Default |
151+
| --------------------------------- | --------------------------------------------------------------------------------------- | ----------------------------- |
152+
| `[workspace]` | Workspace path to operate in (positional argument) | Current directory |
153+
| `-P, --prompt <prompt>` | The prompt/task to execute (optional in TUI mode) | None |
154+
| `-e, --extension <path>` | Path to the extension bundle directory | Auto-detected |
155+
| `-d, --debug` | Enable debug output (includes detailed debug information, prompts, paths, etc) | `false` |
156+
| `-x, --exit-on-complete` | Exit the process when task completes (useful for testing) | `false` |
157+
| `-y, --yes` | Non-interactive mode: auto-approve all actions | `false` |
158+
| `-k, --api-key <key>` | API key for the LLM provider | From env var |
159+
| `-p, --provider <provider>` | API provider (anthropic, openai, openrouter, etc.) | `openrouter` |
160+
| `-m, --model <model>` | Model to use | `anthropic/claude-sonnet-4.5` |
161+
| `-M, --mode <mode>` | Mode to start in (code, architect, ask, debug, etc.) | `code` |
162+
| `-r, --reasoning-effort <effort>` | Reasoning effort level (unspecified, disabled, none, minimal, low, medium, high, xhigh) | `medium` |
163+
| `--ephemeral` | Run without persisting state (uses temporary storage) | `false` |
164+
| `--no-tui` | Disable TUI, use plain text output | `false` |
165+
166+
## Auth Commands
167+
168+
| Command | Description |
169+
| ----------------- | ---------------------------------- |
170+
| `roo auth login` | Authenticate with Roo Code Cloud |
171+
| `roo auth logout` | Clear stored authentication token |
172+
| `roo auth status` | Show current authentication status |
115173

116174
## Environment Variables
117175

@@ -123,9 +181,13 @@ The CLI will look for API keys in environment variables if not provided via `--a
123181
| openai | `OPENAI_API_KEY` |
124182
| openrouter | `OPENROUTER_API_KEY` |
125183
| google/gemini | `GOOGLE_API_KEY` |
126-
| mistral | `MISTRAL_API_KEY` |
127-
| deepseek | `DEEPSEEK_API_KEY` |
128-
| bedrock | `AWS_ACCESS_KEY_ID` |
184+
| ... | ... |
185+
186+
**Authentication Environment Variables:**
187+
188+
| Variable | Description |
189+
| ----------------- | -------------------------------------------------------------------- |
190+
| `ROO_WEB_APP_URL` | Override the Roo Code Cloud URL (default: `https://app.roocode.com`) |
129191

130192
## Architecture
131193

@@ -166,12 +228,6 @@ The CLI will look for API keys in environment variables if not provided via `--a
166228
- CLI → Extension: `emit("webviewMessage", {...})`
167229
- Extension → CLI: `emit("extensionWebviewMessage", {...})`
168230

169-
## Current Limitations
170-
171-
- **No TUI**: Output is plain text (no React/Ink UI yet)
172-
- **No configuration file**: Settings are passed via command line flags
173-
- **No persistence**: Each run is a fresh session
174-
175231
## Development
176232

177233
```bash
@@ -190,42 +246,17 @@ pnpm lint
190246

191247
## Releasing
192248

193-
To create a new release, run the release script from the monorepo root:
249+
To create a new release, execute the /cli-release slash command:
194250

195251
```bash
196-
# Release using version from package.json
197-
./apps/cli/scripts/release.sh
198-
199-
# Release with a specific version
200-
./apps/cli/scripts/release.sh 0.1.0
252+
roo ~/Documents/Roo-Code -P "/cli-release" -y
201253
```
202254

203-
The script will:
204-
205-
1. Build the extension and CLI
206-
2. Create a platform-specific tarball (for your current OS/architecture)
207-
3. Create a GitHub release with the tarball attached
208-
209-
**Prerequisites:**
210-
211-
- GitHub CLI (`gh`) installed and authenticated (`gh auth login`)
212-
- pnpm installed
213-
214-
## Troubleshooting
215-
216-
### Extension bundle not found
217-
218-
Make sure you've built the main extension first:
219-
220-
```bash
221-
cd src
222-
pnpm bundle
223-
```
224-
225-
### Module resolution errors
226-
227-
The CLI expects the extension to be a CommonJS bundle. Make sure the extension's esbuild config outputs CommonJS.
228-
229-
### "vscode" module not found
255+
The workflow will:
230256

231-
The CLI intercepts `require('vscode')` calls. If you see this error, the module resolution interception may have failed.
257+
1. Bump the version
258+
2. Update the CHANGELOG
259+
3. Build the extension and CLI
260+
4. Create a platform-specific tarball (for your current OS/architecture)
261+
5. Test the install script
262+
6. Create a GitHub release with the tarball attached

0 commit comments

Comments
 (0)