ai-cli 0.0.13 → 0.1.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 DELETED
@@ -1,299 +0,0 @@
1
- # ai-cli
2
-
3
- Minimal terminal AI assistant.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g ai-cli
9
- ```
10
-
11
- ## Setup
12
-
13
- ```bash
14
- ai init
15
- ```
16
-
17
- Get your API key from [Vercel AI Gateway](https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys&title=Go+to+AI+Gateway)
18
-
19
- ## Usage
20
-
21
- ```bash
22
- ai # interactive mode
23
- ai "hello" # single message
24
- ai -m gpt-5 "hello" # use specific model
25
- ai --image ./img.png "what?" # analyze image (single message)
26
- ai -l # list models
27
- echo "explain this" | ai # pipe input
28
- ai --system "respond in Spanish" "hola" # custom system prompt
29
-
30
- # in interactive mode, ctrl+v to paste image from clipboard
31
- ```
32
-
33
- ## Headless Mode
34
-
35
- Run the full agent non-interactively. Useful for CI pipelines, scripts, and automation.
36
-
37
- ```bash
38
- ai -p "explain this codebase" # output to stdout
39
- ai -p --json "write tests for src/auth.ts" > result.json # structured JSON
40
- ai -p --force "fix all type errors" # skip confirmations
41
- ai -p --no-save "what dependencies are outdated?" # ephemeral (no history)
42
- git diff | ai -p "review this for bugs" # pipe + headless
43
- ai -p -m gpt-5 --force "refactor the database layer" # combine flags
44
- ai -p --plan "how should I refactor auth?" # plan mode (read-only)
45
- ai -p -r <chatId> "continue" # resume a session
46
- ai -p --timeout 60 "fix type errors" # abort after 60s
47
- ai -p -q "explain this codebase" # suppress stderr status
48
- ```
49
-
50
- Exit codes: `0` success, `1` error, `2` agent stuck.
51
-
52
- **Note:** When `--timeout` fires during a tool execution (e.g., mid-file-write), the agent is interrupted immediately. The workspace may contain partial changes. Combine with version control or review the working tree after a timeout.
53
-
54
- JSON output format:
55
-
56
- ```json
57
- {
58
- "output": "...",
59
- "model": "anthropic/claude-sonnet-4.5",
60
- "tokens": 1234,
61
- "cost": 0.05,
62
- "exitCode": 0,
63
- "chatId": "abc123",
64
- "usage": {
65
- "inputTokens": 800,
66
- "outputTokens": 434,
67
- "cacheReadTokens": 0,
68
- "cacheWriteTokens": 0,
69
- "reasoningTokens": 0
70
- }
71
- }
72
- ```
73
-
74
- On error, includes an `error` field with the message.
75
-
76
- ## Options
77
-
78
- - `-m, --model` - model (default: anthropic/claude-sonnet-4.5)
79
- - `--image` - attach image file
80
- - `-r, --resume` - resume a previous chat by ID
81
- - `--plan` - start in plan mode (think before acting)
82
- - `-p, --print` - headless mode: full agent, output to stdout, then exit
83
- - `--json` - structured JSON output (implies --print)
84
- - `--system` - append custom text to the system prompt
85
- - `--fast` - enable Anthropic fast mode (speed=fast)
86
- - `--force` - auto-approve all tool actions (--print only)
87
- - `--no-save` - don't persist the chat to history (--print only)
88
- - `--timeout` - abort after N seconds (--print only)
89
- - `-q, --quiet` - suppress stderr status output (--print only)
90
- - `-l, --list` - list models
91
- - `--no-color` - disable color output
92
- - `-v, --version` - show version
93
- - `-h, --help` - help
94
-
95
- ## Commands
96
-
97
- ### Chat
98
- - `/new` - new chat
99
- - `/chats` - list chats
100
- - `/chat <n>` - load chat
101
- - `/delete` - delete chat
102
- - `/clear` - clear screen
103
-
104
- ### Files
105
- - `/copy` - copy response
106
- - `/rollback` - undo changes
107
-
108
- ### Context
109
- - `/usage` - token usage and cost
110
- - `/compress` - compress history
111
- - `/plan` - toggle plan mode (think before acting)
112
- - `/review` - review loop (auto-reviews changes for bugs)
113
-
114
- ### Model
115
- - `/model` - select model interactively
116
- - `/model <query>` - switch to matching model
117
-
118
- ### System
119
- - `/info` - version, model, balance, storage
120
- - `/processes` - background processes
121
- - `/memory` - saved memories
122
- - `/mcp` - mcp servers
123
- - `/settings` - preferences
124
- - `/permissions` - tool permission rules
125
- - `/alias` - shortcuts
126
- - `/purge` - delete all chats
127
- - `/help` - commands
128
-
129
- ## Skills
130
-
131
- Skills extend the AI with specialized capabilities. They follow the [Agent Skills](https://agentskills.io) open standard.
132
-
133
- ### Managing Skills
134
-
135
- ```bash
136
- /skills # list installed
137
- /skills add <url> # install from git
138
- /skills remove <name> # uninstall
139
- /skills show <name> # view content
140
- /skills create <name> # create new
141
- /skills path # show directory
142
- ```
143
-
144
- ### Installing Skills
145
-
146
- Shorthand (like skills.sh):
147
-
148
- ```bash
149
- /skills add vercel-labs/agent-skills/skills/react-best-practices
150
- /skills add anthropics/skills/skills/pdf
151
- /skills add owner/repo
152
- ```
153
-
154
- Full GitHub URL:
155
-
156
- ```bash
157
- /skills add https://github.com/anthropics/skills/tree/main/skills/pdf
158
- ```
159
-
160
- Local path:
161
-
162
- ```bash
163
- /skills add /path/to/skill
164
- ```
165
-
166
- ### Creating Skills
167
-
168
- ```bash
169
- /skills create my-skill
170
- ```
171
-
172
- Creates `~/.ai-cli/skills/my-skill/SKILL.md`
173
-
174
- ## Rules
175
-
176
- Custom instructions loaded into every conversation:
177
-
178
- - `~/.ai-cli/AGENTS.md` - global rules
179
- - `./AGENTS.md` - project rules
180
-
181
- Manage with `/rules`:
182
-
183
- ```bash
184
- /rules show # view rules
185
- /rules edit # open in editor
186
- /rules clear # remove rules
187
- /rules path # show path
188
- ```
189
-
190
- ## Review Loop
191
-
192
- After the coding agent finishes making file changes, a separate review agent automatically inspects all modifications for severe and high-priority bugs. If it finds issues, it fixes them and re-reviews, up to a configurable number of passes.
193
-
194
- The review agent runs in its own isolated context with a strict system prompt -- it has no attachment to the code it's reviewing and is intentionally more critical than the coding agent.
195
-
196
- Enabled by default. Toggle with:
197
-
198
- ```bash
199
- /review on # enable
200
- /review off # disable
201
- /review # show status
202
- ```
203
-
204
- Configure max iterations in `~/.ai-cli/config.json`:
205
-
206
- ```json
207
- {
208
- "review": {
209
- "enabled": true,
210
- "maxIterations": 3
211
- }
212
- }
213
- ```
214
-
215
- ## Tools
216
-
217
- The AI can:
218
-
219
- **files** - read, write, edit, delete, copy, rename, search
220
-
221
- **commands** - run shell commands, background processes
222
-
223
- **memory** - save facts across sessions ("remember X")
224
-
225
- **web** - search, fetch urls, check weather
226
-
227
- ## MCP
228
-
229
- Connect to external tools via [Model Context Protocol](https://modelcontextprotocol.io):
230
-
231
- ```bash
232
- /mcp # list servers
233
- /mcp add weather http https://mcp.example.com
234
- /mcp add db stdio npx @example/mcp-db
235
- /mcp remove weather # remove server
236
- /mcp reload # reconnect all
237
- ```
238
-
239
- ### Transports
240
-
241
- - **http** - HTTP endpoint
242
- - **sse** - server-sent events
243
- - **stdio** - spawn local process
244
-
245
- ### Config
246
-
247
- Servers stored in `~/.ai-cli/mcp.json`:
248
-
249
- ```json
250
- {
251
- "servers": {
252
- "weather": {
253
- "type": "http",
254
- "url": "https://mcp.example.com"
255
- },
256
- "db": {
257
- "type": "stdio",
258
- "command": "npx",
259
- "args": ["@example/mcp-db"]
260
- }
261
- }
262
- }
263
- ```
264
-
265
- Environment variables expand with `${VAR}` or `${VAR:-default}`.
266
-
267
- MCP tools are prefixed with server name (e.g., `weather_get_forecast`).
268
-
269
- ## Models
270
-
271
- Supports fuzzy matching:
272
-
273
- ```bash
274
- ai -m claude-4 # → anthropic/claude-sonnet-4
275
- ai -m gpt-5 # → openai/gpt-5
276
- ai -m sonnet # → finds sonnet model
277
- ```
278
-
279
- ## Storage
280
-
281
- All data in `~/.ai-cli/`:
282
-
283
- ```
284
- ~/.ai-cli/
285
- ├── config.json # settings and api key
286
- ├── mcp.json # mcp servers
287
- ├── chats/ # chat history
288
- ├── memories.json # saved memories
289
- ├── skills/ # installed skills
290
- └── AGENTS.md # global rules
291
- ```
292
-
293
- ## Environment
294
-
295
- Alternatively set your API key:
296
-
297
- ```bash
298
- export AI_GATEWAY_API_KEY=your-key
299
- ```