@putao520/aiw 0.5.47 → 0.5.49
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 +57 -21
- 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
|

|
|
@@ -89,36 +89,38 @@ aiw auto -p auto "implement feature" # Auto CLI + auto provider
|
|
|
89
89
|
### Auto Mode (Automatic Failover)
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
# Auto mode tries
|
|
92
|
+
# Auto mode tries CLI+Provider combinations in configured order, switches on failure
|
|
93
93
|
aiw auto "fix this bug"
|
|
94
94
|
|
|
95
|
-
#
|
|
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
|
|
95
|
+
# Configure CLI+Provider execution order
|
|
102
96
|
aiw config cli-order # TUI to manage order (↑/↓ move, r reset, q save)
|
|
103
97
|
```
|
|
104
98
|
|
|
105
99
|
**How it works**:
|
|
106
|
-
1. Reads `
|
|
107
|
-
2. Tries each CLI in order (e.g., codex → gemini → claude)
|
|
108
|
-
3.
|
|
109
|
-
4. Switches to next
|
|
100
|
+
1. Reads `auto_execution_order` from `~/.aiw/config.json`
|
|
101
|
+
2. Tries each CLI+Provider combination in order (e.g., codex+auto → gemini+auto → claude+auto)
|
|
102
|
+
3. Judges success/failure by exit code (0 = success)
|
|
103
|
+
4. Switches to next combination if current fails
|
|
104
|
+
5. Failed combinations enter 30-second cooldown period
|
|
110
105
|
|
|
111
106
|
**Configuration** (`~/.aiw/config.json`):
|
|
112
107
|
```json
|
|
113
108
|
{
|
|
114
|
-
"
|
|
109
|
+
"auto_execution_order": [
|
|
110
|
+
{"cli": "codex", "provider": "auto"},
|
|
111
|
+
{"cli": "gemini", "provider": "auto"},
|
|
112
|
+
{"cli": "claude", "provider": "glm"},
|
|
113
|
+
{"cli": "claude", "provider": "local"},
|
|
114
|
+
{"cli": "claude", "provider": "official"}
|
|
115
|
+
]
|
|
115
116
|
}
|
|
116
117
|
```
|
|
117
118
|
|
|
118
|
-
**
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
119
|
+
**Features**:
|
|
120
|
+
- Same CLI can be configured with multiple providers (e.g., claude+glm → claude+local → claude+official)
|
|
121
|
+
- Each CLI+Provider combination has independent cooldown (30 seconds after failure)
|
|
122
|
+
- Provider "auto" means use the CLI's default provider selection
|
|
123
|
+
- Order can be fully customized via TUI or direct config editing
|
|
122
124
|
|
|
123
125
|
### Role Injection (-r)
|
|
124
126
|
|
|
@@ -140,6 +142,36 @@ aiw claude -C /path/to/project "implement feature"
|
|
|
140
142
|
aiw claude -r common -C ~/myproject "fix the bug"
|
|
141
143
|
```
|
|
142
144
|
|
|
145
|
+
### Git Worktree (Isolated Execution)
|
|
146
|
+
|
|
147
|
+
**New in v0.5.49**: AIW automatically creates a git worktree for isolated AI CLI execution.
|
|
148
|
+
|
|
149
|
+
When you run AIW in a git repository, it:
|
|
150
|
+
1. Validates the directory is a git repository
|
|
151
|
+
2. Creates a worktree at `/tmp/aiw-worktree-<8hex>`
|
|
152
|
+
3. Executes the AI CLI in the isolated worktree
|
|
153
|
+
4. Outputs worktree information after task completion
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# AIW automatically creates worktree for git repositories
|
|
157
|
+
aiw codex -C /path/to/repo "implement feature"
|
|
158
|
+
|
|
159
|
+
# After completion, AIW outputs:
|
|
160
|
+
# === AIW WORKTREE END ===
|
|
161
|
+
# Worktree: /tmp/aiw-worktree-a1b2c3d4
|
|
162
|
+
# Branch: main
|
|
163
|
+
# Commit: abc123def456
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Benefits**:
|
|
167
|
+
- 🛡️ **Isolation**: AI CLI works in a temporary worktree, keeping your working directory clean
|
|
168
|
+
- 🔍 **Traceability**: Worktree path, branch, and commit are logged for review
|
|
169
|
+
- 🧹 **No Cleanup**: Worktree remains for manual review; you can merge changes or delete it
|
|
170
|
+
|
|
171
|
+
**Error Handling**:
|
|
172
|
+
- Non-git directory → AIW refuses to run with clear error message
|
|
173
|
+
- Worktree already exists → AIW reports the conflict and exits
|
|
174
|
+
|
|
143
175
|
### Transparent Parameter Forwarding
|
|
144
176
|
|
|
145
177
|
```bash
|
|
@@ -272,14 +304,18 @@ aiw update
|
|
|
272
304
|
```json
|
|
273
305
|
{
|
|
274
306
|
"user_roles_dir": "~/.claude/roles",
|
|
275
|
-
"
|
|
307
|
+
"auto_execution_order": [
|
|
308
|
+
{"cli": "codex", "provider": "auto"},
|
|
309
|
+
{"cli": "gemini", "provider": "auto"},
|
|
310
|
+
{"cli": "claude", "provider": "auto"}
|
|
311
|
+
]
|
|
276
312
|
}
|
|
277
313
|
```
|
|
278
314
|
|
|
279
315
|
| Option | Type | Description |
|
|
280
316
|
|--------|------|-------------|
|
|
281
317
|
| `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
|
-
| `
|
|
318
|
+
| `auto_execution_order` | array | CLI+Provider combinations for auto mode. Each entry has `cli` (codex/gemini/claude) and `provider` (provider name or "auto"). Use `aiw config cli-order` TUI to manage |
|
|
283
319
|
|
|
284
320
|
This allows you to manage all your roles in a single location, such as `~/.claude/roles/`, and share them across different tools.
|
|
285
321
|
|
|
@@ -318,6 +354,6 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
318
354
|
|
|
319
355
|
---
|
|
320
356
|
|
|
321
|
-
**AIW** - Unified Gateway for AI CLI & MCP | v0.5.
|
|
357
|
+
**AIW** - Unified Gateway for AI CLI & MCP | v0.5.48
|
|
322
358
|
|
|
323
359
|
[GitHub](https://github.com/putao520/agentic-warden) | [NPM](https://www.npmjs.com/package/@putao520/aiw)
|