Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit ff931da

Browse files
authored
Merge pull request #5 from Zoo-Code-Org/remove-roo-cloud
Remove Roo Code Cloud and Router remnants
2 parents 96d6e43 + 5c75bf6 commit ff931da

199 files changed

Lines changed: 2063 additions & 6457 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/README.md

Lines changed: 35 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -130,101 +130,65 @@ printf '{"command":"start","requestId":"1","prompt":"1+1=?"}\n' | roo --print --
130130
printf '{"command":"start","requestId":"1","taskId":"018f7fc8-7c96-7f7c-98aa-2ec4ff7f6d87","prompt":"1+1=?"}\n' | roo --print --stdin-prompt-stream --output-format stream-json
131131
```
132132

133-
### Roo Code Cloud Authentication
133+
### Legacy Roo Auth Token Cleanup
134134

135-
To use Roo Code Cloud features (like the provider proxy), you need to authenticate:
135+
Normal CLI usage is login-free. Use `--provider` with your own API key, or set the provider environment variable directly.
136136

137-
```bash
138-
# Log in to Roo Code Cloud (opens browser)
139-
roo auth login
137+
Roo Code Router has been removed from the CLI. The remaining `auth` commands only help inspect or delete any legacy Roo auth token still stored from older releases:
140138

141-
# Check authentication status
139+
```bash
140+
# Check whether a legacy Roo auth token is still stored
142141
roo auth status
143142

144-
# Log out
143+
# Remove an old stored Roo auth token
145144
roo auth logout
146145
```
147146

148-
The `auth login` command:
149-
150-
1. Opens your browser to authenticate with Roo Code Cloud
151-
2. Receives a secure token via localhost callback
152-
3. Stores the token in `~/.config/roo/credentials.json`
153-
154-
Tokens are valid for 90 days. The CLI will prompt you to re-authenticate when your token expires.
155-
156-
**Authentication Flow:**
157-
158-
```
159-
┌──────┐ ┌─────────┐ ┌───────────────┐
160-
│ CLI │ │ Browser │ │ Roo Code Cloud│
161-
└──┬───┘ └────┬────┘ └───────┬───────┘
162-
│ │ │
163-
│ Open auth URL │ │
164-
│─────────────────>│ │
165-
│ │ │
166-
│ │ Authenticate │
167-
│ │─────────────────────>│
168-
│ │ │
169-
│ │<─────────────────────│
170-
│ │ Token via callback │
171-
│<─────────────────│ │
172-
│ │ │
173-
│ Store token │ │
174-
│ │ │
175-
```
147+
If you never used Roo Code Router, you can ignore this section entirely.
176148

177149
## Options
178150

179-
| Option | Description | Default |
180-
| --------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------- |
181-
| `[prompt]` | Your prompt (positional argument, optional) | None |
182-
| `--prompt-file <path>` | Read prompt from a file instead of command line argument | None |
183-
| `--create-with-session-id <session-id>` | Create a new task using the provided session ID (UUID) | None |
184-
| `-w, --workspace <path>` | Workspace path to operate in | Current directory |
185-
| `-p, --print` | Print response and exit (non-interactive mode) | `false` |
186-
| `--stdin-prompt-stream` | Read NDJSON control commands from stdin (requires `--print`) | `false` |
187-
| `-e, --extension <path>` | Path to the extension bundle directory | Auto-detected |
188-
| `-d, --debug` | Enable debug output (includes detailed debug information, prompts, paths, etc) | `false` |
189-
| `-a, --require-approval` | Require manual approval before actions execute | `false` |
190-
| `-k, --api-key <key>` | API key for the LLM provider | From env var |
191-
| `--provider <provider>` | API provider (roo, anthropic, openai, openrouter, etc.) | `openrouter` (or `roo` if authenticated) |
192-
| `-m, --model <model>` | Model to use | `anthropic/claude-opus-4.6` |
193-
| `--mode <mode>` | Mode to start in (code, architect, ask, debug, etc.) | `code` |
194-
| `--terminal-shell <path>` | Absolute shell path for inline terminal command execution | Auto-detected shell |
195-
| `-r, --reasoning-effort <effort>` | Reasoning effort level (unspecified, disabled, none, minimal, low, medium, high, xhigh) | `medium` |
196-
| `--consecutive-mistake-limit <n>` | Consecutive error/repetition limit before guidance prompt (`0` disables the limit) | `10` |
197-
| `--ephemeral` | Run without persisting state (uses temporary storage) | `false` |
198-
| `--oneshot` | Exit upon task completion | `false` |
199-
| `--output-format <format>` | Output format with `--print`: `text`, `json`, or `stream-json` | `text` |
151+
| Option | Description | Default |
152+
| --------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------- |
153+
| `[prompt]` | Your prompt (positional argument, optional) | None |
154+
| `--prompt-file <path>` | Read prompt from a file instead of command line argument | None |
155+
| `--create-with-session-id <session-id>` | Create a new task using the provided session ID (UUID) | None |
156+
| `-w, --workspace <path>` | Workspace path to operate in | Current directory |
157+
| `-p, --print` | Print response and exit (non-interactive mode) | `false` |
158+
| `--stdin-prompt-stream` | Read NDJSON control commands from stdin (requires `--print`) | `false` |
159+
| `-e, --extension <path>` | Path to the extension bundle directory | Auto-detected |
160+
| `-d, --debug` | Enable debug output (includes detailed debug information, prompts, paths, etc) | `false` |
161+
| `-a, --require-approval` | Require manual approval before actions execute | `false` |
162+
| `-k, --api-key <key>` | API key for the LLM provider | From env var |
163+
| `--provider <provider>` | API provider (anthropic, openai-native, gemini, openrouter, vercel-ai-gateway) | `openrouter` |
164+
| `-m, --model <model>` | Model to use | `anthropic/claude-opus-4.6` |
165+
| `--mode <mode>` | Mode to start in (code, architect, ask, debug, etc.) | `code` |
166+
| `--terminal-shell <path>` | Absolute shell path for inline terminal command execution | Auto-detected shell |
167+
| `-r, --reasoning-effort <effort>` | Reasoning effort level (unspecified, disabled, none, minimal, low, medium, high, xhigh) | `medium` |
168+
| `--consecutive-mistake-limit <n>` | Consecutive error/repetition limit before guidance prompt (`0` disables the limit) | `10` |
169+
| `--ephemeral` | Run without persisting state (uses temporary storage) | `false` |
170+
| `--oneshot` | Exit upon task completion | `false` |
171+
| `--output-format <format>` | Output format with `--print`: `text`, `json`, or `stream-json` | `text` |
200172

201173
## Auth Commands
202174

203-
| Command | Description |
204-
| ----------------- | ---------------------------------- |
205-
| `roo auth login` | Authenticate with Roo Code Cloud |
206-
| `roo auth logout` | Clear stored authentication token |
207-
| `roo auth status` | Show current authentication status |
175+
| Command | Description |
176+
| ----------------- | ------------------------------------ |
177+
| `roo auth logout` | Clear a stored legacy Roo auth token |
178+
| `roo auth status` | Show legacy Roo token status |
208179

209180
## Environment Variables
210181

211182
The CLI will look for API keys in environment variables if not provided via `--api-key`:
212183

213184
| Provider | Environment Variable |
214185
| ----------------- | --------------------------- |
215-
| roo | `ROO_API_KEY` |
216186
| anthropic | `ANTHROPIC_API_KEY` |
217187
| openai-native | `OPENAI_API_KEY` |
218188
| openrouter | `OPENROUTER_API_KEY` |
219189
| gemini | `GOOGLE_API_KEY` |
220190
| vercel-ai-gateway | `VERCEL_AI_GATEWAY_API_KEY` |
221191

222-
**Authentication Environment Variables:**
223-
224-
| Variable | Description |
225-
| ----------------- | -------------------------------------------------------------------- |
226-
| `ROO_WEB_APP_URL` | Override the Roo Code Cloud URL (default: `https://app.roocode.com`) |
227-
228192
## Architecture
229193

230194
```
@@ -268,7 +232,7 @@ The CLI will look for API keys in environment variables if not provided via `--a
268232

269233
```bash
270234
# Run directly from source (no build required)
271-
pnpm dev --provider roo --api-key $ROO_API_KEY --print "Hello"
235+
pnpm dev --provider openrouter --api-key $OPENROUTER_API_KEY --print "Hello"
272236

273237
# Run tests
274238
pnpm test
@@ -280,10 +244,10 @@ pnpm check-types
280244
pnpm lint
281245
```
282246

283-
By default the `start` script points `ROO_CODE_PROVIDER_URL` at `http://localhost:8080/proxy` for local development. To point at the production API instead, override the environment variable:
247+
By default the dev script still points `ROO_CODE_PROVIDER_URL` at `http://localhost:8080/proxy` for local extension-host development. The CLI provider selection itself should use a non-Router provider such as OpenRouter. To point the backend URL at production instead, override the environment variable:
284248

285249
```bash
286-
ROO_CODE_PROVIDER_URL=https://api.roocode.com/proxy pnpm dev --provider roo --api-key $ROO_API_KEY --print "Hello"
250+
ROO_CODE_PROVIDER_URL=https://api.roocode.com/proxy pnpm dev --provider openrouter --api-key $OPENROUTER_API_KEY --print "Hello"
287251
```
288252

289253
## Releasing
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
vi.mock("@/lib/storage/index.js", () => ({
2+
loadToken: vi.fn(),
3+
loadCredentials: vi.fn(),
4+
getCredentialsPath: vi.fn(() => "/tmp/roo/cli-credentials.json"),
5+
hasToken: vi.fn(),
6+
clearToken: vi.fn(),
7+
}))
8+
9+
vi.mock("@/lib/auth/index.js", () => ({
10+
isTokenExpired: vi.fn(),
11+
isTokenValid: vi.fn(),
12+
getTokenExpirationDate: vi.fn(),
13+
}))
14+
15+
import { status } from "../status.js"
16+
import { logout } from "../logout.js"
17+
import { loadToken, loadCredentials, getCredentialsPath, hasToken, clearToken } from "@/lib/storage/index.js"
18+
import { isTokenExpired, isTokenValid, getTokenExpirationDate } from "@/lib/auth/index.js"
19+
20+
describe("auth commands", () => {
21+
beforeEach(() => {
22+
vi.clearAllMocks()
23+
})
24+
25+
it("reports missing Roo auth tokens as normal for standard CLI usage", async () => {
26+
vi.mocked(loadToken).mockResolvedValue(null)
27+
const consoleLog = vi.spyOn(console, "log").mockImplementation(() => {})
28+
29+
const result = await status()
30+
31+
expect(result).toEqual({ authenticated: false })
32+
expect(consoleLog.mock.calls.flat().join("\n")).toContain("Normal CLI usage does not require login.")
33+
expect(consoleLog.mock.calls.flat().join("\n")).toContain("Roo Code Router has been removed")
34+
})
35+
36+
it("reports optional Roo auth token details when available", async () => {
37+
const token = "header.payload.signature"
38+
const expiresAt = new Date("2026-05-01T00:00:00.000Z")
39+
40+
vi.mocked(loadToken).mockResolvedValue(token)
41+
vi.mocked(loadCredentials).mockResolvedValue({ token, createdAt: "2026-04-01T00:00:00.000Z" })
42+
vi.mocked(isTokenValid).mockReturnValue(true)
43+
vi.mocked(isTokenExpired).mockReturnValue(false)
44+
vi.mocked(getTokenExpirationDate).mockReturnValue(expiresAt)
45+
vi.mocked(getCredentialsPath).mockReturnValue("/tmp/roo/cli-credentials.json")
46+
const consoleLog = vi.spyOn(console, "log").mockImplementation(() => {})
47+
48+
const result = await status({ verbose: true })
49+
50+
expect(result.authenticated).toBe(true)
51+
expect(consoleLog.mock.calls.flat().join("\n")).toContain("Legacy Roo auth token still stored")
52+
expect(consoleLog.mock.calls.flat().join("\n")).toContain("/tmp/roo/cli-credentials.json")
53+
})
54+
55+
it("removes stored Roo auth tokens", async () => {
56+
vi.mocked(hasToken).mockResolvedValue(true)
57+
const consoleLog = vi.spyOn(console, "log").mockImplementation(() => {})
58+
59+
const result = await logout()
60+
61+
expect(result).toEqual({ success: true, wasLoggedIn: true })
62+
expect(clearToken).toHaveBeenCalledTimes(1)
63+
expect(consoleLog.mock.calls.flat().join("\n")).toContain("Removed stored legacy Roo auth token")
64+
})
65+
66+
it("treats missing Roo auth tokens as already logged out", async () => {
67+
vi.mocked(hasToken).mockResolvedValue(false)
68+
const consoleLog = vi.spyOn(console, "log").mockImplementation(() => {})
69+
70+
const result = await logout()
71+
72+
expect(result).toEqual({ success: true, wasLoggedIn: false })
73+
expect(clearToken).not.toHaveBeenCalled()
74+
expect(consoleLog.mock.calls.flat().join("\n")).toContain("No legacy Roo auth token stored.")
75+
})
76+
})
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
export * from "./login.js"
21
export * from "./logout.js"
32
export * from "./status.js"

0 commit comments

Comments
 (0)