rush-ai 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,135 +1,230 @@
1
+ <div align="center">
2
+
1
3
  # rush-ai
2
4
 
3
- Rush CLI — Command-line interface for the Rush AI platform.
5
+ **Command-line interface for the Rush AI platform**
6
+
7
+ *Create tasks, manage agents, stream results, and integrate IDE plugins — all from the terminal*
8
+
9
+ [![npm version](https://img.shields.io/npm/v/rush-ai.svg)](https://www.npmjs.com/package/rush-ai)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
+
12
+ </div>
13
+
14
+ ---
4
15
 
5
16
  ## Quick Start
6
17
 
7
18
  ```bash
8
- pnpm --filter rush-ai build
9
- pnpm --filter rush-ai test
19
+ npm install -g rush-ai
20
+
21
+ rush-ai auth login
22
+ rush-ai agent list
23
+ rush-ai task create -a <agent> -p "Build a landing page"
24
+ rush-ai task watch <task-id>
10
25
  ```
11
26
 
12
- ## Testing Strategy
27
+ ## Features
28
+
29
+ - **Task lifecycle** — Create, watch (SSE streaming), cancel, and download artifacts
30
+ - **Agent management** — Browse agents, inspect skills and MCP servers
31
+ - **MCP integration** — Discover MCP servers, list tools, run as MCP stdio server
32
+ - **IDE plugins** — Install, update, diagnose plugins for Claude Code and Cursor
33
+ - **Multi-profile** — Switch between environments (test, production, custom)
34
+ - **Shell completion** — Bash, Zsh, and Fish auto-completion
35
+ - **CI-friendly** — `--json` output, `--ci` mode, non-zero exit codes on failure
13
36
 
14
- rush-ai 采用三层测试策略,在不同阶段用最合适的方式验证代码正确性。
37
+ ## Installation
15
38
 
16
- ### L1: 单元测试(本地,秒级反馈)
39
+ **Requirements:** Node.js >= 18.0.0
17
40
 
18
- 验证 CLI 自身逻辑,完全不依赖外部服务。
41
+ ```bash
42
+ npm install -g rush-ai # Global install
43
+ npx rush-ai <command> # Or use npx directly
44
+ ```
19
45
 
20
- **覆盖范围:**
46
+ ## Commands
47
+
48
+ | Command | Alias | Description |
49
+ |---------|-------|-------------|
50
+ | `auth login` | - | Log in via browser (PKCE) or API key |
51
+ | `auth status` | - | Show current authentication status |
52
+ | `auth logout` | - | Log out and clear credentials |
53
+ | `agent list` | `agent ls` | List available agents |
54
+ | `agent info <name>` | - | Show agent details, skills, and MCP servers |
55
+ | `task create` | - | Create a task for an agent |
56
+ | `task send <id>` | - | Send a follow-up message to a task |
57
+ | `task status <id>` | - | Check task status |
58
+ | `task result <id>` | - | Get task result and file summary |
59
+ | `task files <id>` | - | List and download task artifacts |
60
+ | `task list` | `task ls` | List tasks |
61
+ | `task watch <id>` | - | Stream task execution in real-time (SSE) |
62
+ | `task cancel <id>` | - | Cancel a running task |
63
+ | `mcp serve` | - | Start MCP stdio server |
64
+ | `mcp list` | `mcp ls` | List available MCP servers |
65
+ | `mcp list-tools <id>` | - | List tools provided by an MCP server |
66
+ | `plugin install <name>` | - | Install an IDE plugin |
67
+ | `plugin update <name>` | - | Update an installed plugin |
68
+ | `plugin uninstall <name>` | - | Remove a plugin |
69
+ | `plugin list` | `plugin ls` | List available and installed plugins |
70
+ | `plugin status <name>` | - | Show plugin installation status |
71
+ | `plugin doctor [name]` | - | Diagnose plugin issues |
72
+ | `config show` | - | Show current configuration |
73
+ | `config set <key> <value>` | - | Set a config value (`api`, `collectMetrics`, `currentTeam`) |
74
+ | `config use <profile>` | - | Switch active profile |
75
+ | `config create <profile>` | - | Create a new profile |
76
+ | `config delete <profile>` | - | Delete a profile |
77
+ | `config list` | `config ls` | List all profiles |
78
+ | `completion install` | - | Auto-install shell completion |
79
+ | `completion bash\|zsh\|fish` | - | Print completion script |
80
+ | `doctor` | - | Run environment, auth, and connectivity diagnostics |
81
+
82
+ ### Global Options
83
+
84
+ | Option | Description |
85
+ |--------|-------------|
86
+ | `--json` | Output as JSON (machine-readable) |
87
+ | `--ci` | CI mode: JSON output, no interactive prompts, strict exit codes |
88
+ | `--verbose` | Show detailed output including HTTP requests |
89
+ | `--debug` | Debug-level output (implies `--verbose`) |
90
+ | `--no-color` | Disable color output |
91
+ | `-f, --format <type>` | Output format: `table`, `json`, `csv` |
21
92
 
22
- - 命令解析(commander 参数、flag、子命令路由)
23
- - 输出格式化(table / `--json` / `--stream`)
24
- - 配置管理(`~/.rush/` 读写、token 存取)
25
- - 错误处理(未认证提示、网络错误、API 错误码映射)
26
- - stdin 管道输入解析
93
+ ## Usage
27
94
 
28
- **技术方案:** vitest,mock HTTP 层(`lib/client.ts`),不启动任何服务。
95
+ ### Authentication
29
96
 
30
97
  ```bash
31
- pnpm --filter rush-ai test
98
+ # Browser login (PKCE flow — opens browser)
99
+ rush-ai auth login
100
+
101
+ # API key login
102
+ rush-ai auth login --api-key <key>
103
+
104
+ # Check status
105
+ rush-ai auth status --verify
32
106
  ```
33
107
 
34
- ### L2: 本地联调测试(本地,秒级反馈)
108
+ ### Working with Tasks
35
109
 
36
- CLI 对本地运行的 Agent 服务做真实调用,验证请求/响应链路。
110
+ ```bash
111
+ # Create a task
112
+ rush-ai task create -a rush -p "Add a contact form to the homepage"
37
113
 
38
- **前置条件:**
114
+ # Stream output in real-time
115
+ rush-ai task watch <task-id>
39
116
 
40
- - `pnpm dev:agent` 运行在 `localhost:4000`(需 `.env.local` 配好凭证)
41
- - `pnpm dev` 同时启动 web + agent
117
+ # Get result and download files
118
+ rush-ai task result <task-id>
119
+ rush-ai task files <task-id> --download-all -o ./output
42
120
 
43
- **覆盖范围:**
121
+ # Send follow-up message
122
+ rush-ai task send <task-id> -p "Change the button color to blue"
44
123
 
45
- - auth 认证流程
46
- - `agent list` / `agent info` 真实返回
47
- - `task create` + `task status` + `task result` 异步链路
48
- - SSE 流式输出(`task watch`)
124
+ # Pipe prompt from stdin
125
+ echo "Refactor the auth module" | rush-ai task create -a rush
49
126
 
50
- **技术方案:** vitest e2e 配置,测试前检查 `localhost` health,不可用则 skip。
127
+ # List recent tasks
128
+ rush-ai task list -l 10 -s completed
129
+ ```
130
+
131
+ ### Discovering Agents and MCP Servers
51
132
 
52
133
  ```bash
53
- # 需要先启动 agent
54
- pnpm dev:agent &
134
+ # Browse agents
135
+ rush-ai agent list
136
+ rush-ai agent info rush
55
137
 
56
- pnpm --filter rush-ai test:e2e
138
+ # Browse MCP servers and their tools
139
+ rush-ai mcp list --search "database"
140
+ rush-ai mcp list-tools <server-id>
57
141
  ```
58
142
 
59
- ### L3: 冒烟测试(CI / 手动,分钟级)
60
-
61
- 对真实环境做最终确认,验证完整 CLI 链路:`auth → agent list → task create → task result → task files → task list`。
143
+ ### IDE Plugin Management
62
144
 
63
- **触发时机:**
145
+ ```bash
146
+ # Install plugin for Claude Code
147
+ rush-ai plugin install claude-code
64
148
 
65
- - PR 合入后,CI 构建部署完成
66
- - 手动触发,指定目标环境
149
+ # Check plugin health
150
+ rush-ai plugin doctor claude-code
67
151
 
68
- **覆盖范围:**
152
+ # Update plugin
153
+ rush-ai plugin update claude-code --force
154
+ ```
69
155
 
70
- - 核心 happy path 全链路验证
71
- - 网络 / 鉴权 / 代理等环境相关的集成验证
72
- - production build 模式下的 API 行为
156
+ ### Multi-Profile Configuration
73
157
 
74
158
  ```bash
75
- RUSH_API_BASE_URL=https://rush-test.zhenguanyu.com \
76
- RUSH_AUTH_TOKEN=$CI_TEST_TOKEN \
77
- pnpm --filter rush-ai test:smoke
159
+ # Create profiles for different environments
160
+ rush-ai config create production --api https://rush.example.com
161
+ rush-ai config create staging --api https://rush-test.example.com
162
+
163
+ # Switch between profiles
164
+ rush-ai config use production
165
+ rush-ai config list
78
166
  ```
79
167
 
80
- ## Scripts
168
+ ### CI/CD Integration
81
169
 
82
- | Script | Description |
83
- |--------|-------------|
84
- | `test` | L1 单元测试 |
85
- | `test:e2e` | L2 本地联调测试 |
86
- | `test:smoke` | L3 冒烟测试 |
87
- | `test:all` | L1 + L2 |
88
- | `test:watch` | 单元测试 watch 模式 |
89
- | `typecheck` | TypeScript 类型检查 |
90
- | `build` | 构建 |
170
+ ```bash
171
+ # Non-interactive auth via API key
172
+ RUSH_API_KEY=$KEY rush-ai task create -a rush -p "Run tests" --ci
173
+
174
+ # Script-friendly JSON output
175
+ rush-ai task status <id> --json | jq '.status'
176
+
177
+ # Pipe results
178
+ rush-ai task result <id> --json | jq -r '.result'
179
+ ```
91
180
 
92
181
  ## Environment Variables
93
182
 
94
183
  | Variable | Description | Default |
95
184
  |----------|-------------|---------|
96
- | `RUSH_API_BASE_URL` | API 目标地址 | `http://localhost:3000` |
97
- | `RUSH_AUTH_TOKEN` | 认证 token(跳过 CAS 交互登录) | |
98
- | `RUSH_TEST_AGENT` | E2E 测试用的 Agent 名称 | `rush` |
185
+ | `RUSH_API_KEY` | API key for non-interactive auth (skips browser login) | - |
186
+ | `RUSH_API_URL` | API base URL override | `https://rush.zhenguanyu.com` |
187
+ | `RUSH_PROFILE` | Override active profile | - |
188
+ | `NO_COLOR` | Disable colored output | - |
189
+ | `DEBUG` | Enable debug logging | - |
99
190
 
100
- ## Development Verification Flow
191
+ ## Configuration
101
192
 
102
- 每完成一个命令实现:
193
+ Config files are stored in `~/.rush/`:
103
194
 
104
- ```bash
105
- pnpm --filter rush-ai typecheck # 类型检查
106
- pnpm --filter rush-ai test # L1 单元测试
107
- pnpm --filter rush-ai build # 确保能构建
195
+ ```
196
+ ~/.rush/
197
+ ├── auth.json # Credentials (token, refresh token, expiry)
198
+ ├── config.json # Global settings (profiles, metrics, team)
199
+ └── plugins/
200
+ └── installed.json # Plugin manifest
108
201
  ```
109
202
 
110
- 涉及 API 交互改动时(需先启动 dev:agent):
203
+ ## Development
111
204
 
112
205
  ```bash
113
- pnpm --filter rush-ai test:e2e # L2 本地联调
114
- ```
206
+ # Install dependencies
207
+ pnpm install
115
208
 
116
- PR 合入后(CI 自动或手动):
209
+ # Build
210
+ pnpm --filter rush-ai build
117
211
 
118
- ```bash
119
- pnpm --filter rush-ai test:smoke # L3 部署冒烟
120
- ```
212
+ # Type check
213
+ pnpm --filter rush-ai typecheck
121
214
 
122
- ## Project Structure
215
+ # Run unit tests
216
+ pnpm --filter rush-ai test
123
217
 
218
+ # Run E2E tests (requires web + agent: pnpm dev)
219
+ pnpm dev &
220
+ pnpm --filter rush-ai test:e2e
221
+
222
+ # Run smoke tests (against deployed environment)
223
+ RUSH_API_BASE_URL=https://rush-test.zhenguanyu.com \
224
+ RUSH_AUTH_TOKEN=$TOKEN \
225
+ pnpm --filter rush-ai test:smoke
124
226
  ```
125
- packages/rush-ai/
126
- ├── src/
127
- │ ├── commands/ # CLI commands (agent, auth, mcp, plugin, task)
128
- │ ├── e2e/ # E2E & smoke test files
129
- │ ├── output/ # Output formatting (table, json, stream)
130
- │ └── util/ # Shared utilities (client, config, auth, errors)
131
- ├── vitest.config.ts # L1 unit test config
132
- ├── vitest.e2e.config.ts # L2 e2e test config
133
- ├── vitest.smoke.config.ts # L3 smoke test config
134
- └── package.json
135
- ```
227
+
228
+ ## License
229
+
230
+ MIT
File without changes
File without changes
File without changes