@putao520/aiw 0.5.36 → 0.5.39
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 +65 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|

|
|
7
7
|

|
|
8
8
|

|
|
@@ -62,6 +62,10 @@ aiw claude "explain this code"
|
|
|
62
62
|
aiw codex "write tests"
|
|
63
63
|
aiw gemini "translate to Chinese"
|
|
64
64
|
|
|
65
|
+
# Auto mode: automatic failover across AI CLIs
|
|
66
|
+
aiw auto "fix this bug" # Try CLIs in order, auto-switch on failure
|
|
67
|
+
aiw auto -p auto "implement feature" # Auto-switch CLIs + auto-select provider
|
|
68
|
+
|
|
65
69
|
# Route to multiple AI CLIs
|
|
66
70
|
aiw all "review this code" # All available CLIs
|
|
67
71
|
aiw "claude|gemini" "compare approaches" # Specific CLIs
|
|
@@ -75,9 +79,47 @@ aiw claude -p openrouter "explain this"
|
|
|
75
79
|
aiw claude -p glm "explain this"
|
|
76
80
|
aiw claude -p anthropic "explain this"
|
|
77
81
|
|
|
82
|
+
# Auto-select compatible provider
|
|
83
|
+
aiw claude -p auto "explain this" # Randomly select compatible provider
|
|
84
|
+
aiw auto -p auto "implement feature" # Auto CLI + auto provider
|
|
85
|
+
|
|
78
86
|
# Provider config: ~/.aiw/providers.json
|
|
79
87
|
```
|
|
80
88
|
|
|
89
|
+
### Auto Mode (Automatic Failover)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Auto mode tries AI CLIs in configured order, switches on failure
|
|
93
|
+
aiw auto "fix this bug"
|
|
94
|
+
|
|
95
|
+
# With specific provider
|
|
96
|
+
aiw auto -p openrouter "implement feature"
|
|
97
|
+
|
|
98
|
+
# With auto provider (max compatibility)
|
|
99
|
+
aiw auto -p auto "write tests"
|
|
100
|
+
|
|
101
|
+
# Configure CLI execution order
|
|
102
|
+
aiw config cli-order # TUI to manage order (↑/↓ move, r reset, q save)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**How it works**:
|
|
106
|
+
1. Reads `cli_execution_order` from `~/.aiw/config.json`
|
|
107
|
+
2. Tries each CLI in order (e.g., codex → gemini → claude)
|
|
108
|
+
3. Uses built-in LLM (Ollama) to judge success/failure
|
|
109
|
+
4. Switches to next CLI if current fails (or halts if error is non-retryable)
|
|
110
|
+
|
|
111
|
+
**Configuration** (`~/.aiw/config.json`):
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"cli_execution_order": ["codex", "gemini", "claude"]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Constraints**:
|
|
119
|
+
- Must include all 3 CLIs (codex, gemini, claude)
|
|
120
|
+
- Order can be changed but cannot remove/disable CLIs
|
|
121
|
+
- LLM judgment is mandatory (no timeout-based fallback)
|
|
122
|
+
|
|
81
123
|
### Role Injection (-r)
|
|
82
124
|
|
|
83
125
|
```bash
|
|
@@ -218,17 +260,38 @@ aiw update
|
|
|
218
260
|
|
|
219
261
|
| File | Purpose |
|
|
220
262
|
|------|---------|
|
|
263
|
+
| `~/.aiw/config.json` | AIW global configuration |
|
|
221
264
|
| `~/.aiw/providers.json` | AI provider configurations |
|
|
222
265
|
| `~/.aiw/mcp.json` | MCP server configurations |
|
|
223
266
|
| `~/.aiw/role/*.md` | Custom role prompts |
|
|
224
267
|
| `~/.aiw/settings.json` | Plugin marketplace settings |
|
|
225
268
|
| `~/.aiw/plugins.json` | Installed plugin records |
|
|
226
269
|
|
|
270
|
+
### Global Configuration (~/.aiw/config.json)
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"user_roles_dir": "~/.claude/roles",
|
|
275
|
+
"cli_execution_order": ["codex", "gemini", "claude"]
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
| Option | Type | Description |
|
|
280
|
+
|--------|------|-------------|
|
|
281
|
+
| `user_roles_dir` | string | Custom directory for user roles (supports `~` expansion). If set, AIW will load user roles from this directory instead of `~/.aiw/role/` |
|
|
282
|
+
| `cli_execution_order` | array | Execution order for auto mode (must include all 3: codex, gemini, claude). Use `aiw config cli-order` TUI to manage |
|
|
283
|
+
|
|
284
|
+
This allows you to manage all your roles in a single location, such as `~/.claude/roles/`, and share them across different tools.
|
|
285
|
+
|
|
227
286
|
## Quick Reference
|
|
228
287
|
|
|
229
288
|
```bash
|
|
230
289
|
# AI CLI routing
|
|
231
290
|
aiw <cli> [-r role] [-p provider] [-C cwd] [cli-args...] "prompt"
|
|
291
|
+
aiw auto [-p provider] "prompt" # Auto mode with failover
|
|
292
|
+
|
|
293
|
+
# Configuration
|
|
294
|
+
aiw config cli-order # Manage CLI execution order (TUI)
|
|
232
295
|
|
|
233
296
|
# MCP commands
|
|
234
297
|
aiw mcp serve # Start MCP server
|
|
@@ -255,6 +318,6 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
255
318
|
|
|
256
319
|
---
|
|
257
320
|
|
|
258
|
-
**AIW** - Unified Gateway for AI CLI & MCP | v0.5.
|
|
321
|
+
**AIW** - Unified Gateway for AI CLI & MCP | v0.5.39
|
|
259
322
|
|
|
260
323
|
[GitHub](https://github.com/putao520/agentic-warden) | [NPM](https://www.npmjs.com/package/@putao520/aiw)
|