ai-cli 0.0.2-beta.0 → 0.0.3

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.
Files changed (3) hide show
  1. package/README.md +163 -85
  2. package/dist/ai.mjs +316 -530
  3. package/package.json +28 -25
package/README.md CHANGED
@@ -1,145 +1,223 @@
1
1
  # ai-cli
2
2
 
3
- AI CLI using Vercel AI Gateway
3
+ minimal terminal AI assistant
4
4
 
5
- ## Installation
5
+ ## install
6
6
 
7
7
  ```bash
8
8
  npm install -g ai-cli
9
9
  ```
10
10
 
11
- ## Setup
11
+ ## setup
12
12
 
13
13
  ```bash
14
14
  ai init
15
15
  ```
16
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)
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
18
 
19
- ## Usage
19
+ ## usage
20
20
 
21
21
  ```bash
22
22
  ai # interactive mode
23
23
  ai "hello" # single message
24
24
  ai -m gpt-5 "hello" # use specific model
25
- ai --image ./img.png "what?" # analyze image
26
- ai -l # list available models
25
+ ai --image ./img.png "what?" # analyze image (single message)
26
+ ai -l # list models
27
27
  echo "explain this" | ai # pipe input
28
+
29
+ # in interactive mode, ctrl+v to paste image from clipboard
28
30
  ```
29
31
 
30
- ## Options
32
+ ## options
31
33
 
32
34
  - `-m, --model` - model (default: anthropic/claude-sonnet-4.5)
33
- - `--image` - attach image file (png, jpg, gif, webp)
34
- - `-l, --list` - list available models
35
+ - `--image` - attach image file
36
+ - `-l, --list` - list models
35
37
  - `-h, --help` - help
36
38
 
37
- ## Interactive Mode
39
+ ## commands
40
+
41
+ ### chat
42
+ - `/new` - new chat
43
+ - `/chats` - list chats
44
+ - `/chat <n>` - load chat
45
+ - `/delete` - delete chat
46
+ - `/clear` - clear screen
47
+
48
+ ### files
49
+ - `/copy` - copy response
50
+ - `/rollback` - undo changes
51
+
52
+ ### git
53
+ - `/git status` - file status
54
+ - `/git diff` - unstaged changes
55
+ - `/git staged` - staged changes
56
+ - `/git branch` - list/switch branches
57
+ - `/git commit` - ai-generated commit message
58
+ - `/git push` - push to remote
59
+ - `/git log` - recent commits
60
+ - `/git stash` - stash/pop changes
61
+
62
+ ### context
63
+ - `/usage` - token usage and cost
64
+ - `/compress` - compress history
65
+
66
+ ### model
67
+ - `/list` - select model
68
+ - `/model` - current model
69
+
70
+ ### system
71
+ - `/processes` - background processes
72
+ - `/memory` - saved memories
73
+ - `/mcp` - mcp servers
74
+ - `/settings` - preferences
75
+ - `/alias` - shortcuts
76
+ - `/help` - commands
77
+
78
+ ## skills
79
+
80
+ skills extend the AI with specialized capabilities. they follow the [Agent Skills](https://agentskills.io) open standard.
38
81
 
39
- Type `ai` to enter interactive mode with file access and chat history.
82
+ ### managing skills
40
83
 
41
- ### Commands
84
+ ```bash
85
+ /skills # list installed
86
+ /skills add <url> # install from git
87
+ /skills remove <name> # uninstall
88
+ /skills show <name> # view content
89
+ /skills create <name> # create new
90
+ /skills path # show directory
91
+ ```
42
92
 
43
- **Chat**
44
- - `/new` - start new chat
45
- - `/chats` - list saved chats
46
- - `/chat <n>` - load chat by number
47
- - `/delete` - delete current chat
48
- - `/purge` - delete all chats
49
- - `/clear` - clear screen and history
93
+ ### installing skills
50
94
 
51
- **Files**
52
- - `/copy` - copy last response to clipboard
53
- - `/rollback` - view/undo file changes
54
- - `/diff` - view recent file changes
95
+ shorthand (like skills.sh):
55
96
 
56
- **Context**
57
- - `/context` - show token usage and loaded context files
58
- - `/compress` - compress chat history
59
- - `/usage` - show chat stats and cost
97
+ ```bash
98
+ /skills add vercel-labs/agent-skills/skills/react-best-practices
99
+ /skills add anthropics/skills/skills/pdf
100
+ /skills add owner/repo
101
+ ```
60
102
 
61
- **Models**
62
- - `/list` - select model (with search)
63
- - `/model` - show current model
103
+ full github url:
64
104
 
65
- **Processes**
66
- - `/processes` - manage background processes
105
+ ```bash
106
+ /skills add https://github.com/anthropics/skills/tree/main/skills/pdf
107
+ ```
67
108
 
68
- **Memory**
69
- - `/memory` - view saved memories
70
- - `/memory clear` - clear all memories
109
+ local path:
71
110
 
72
- **Settings**
73
- - `/alias` - manage command shortcuts
74
- - `/settings` - configure preferences
75
- - `/init` - setup api key
76
- - `/credits` - show balance
77
- - `/storage` - show storage info
78
- - `/version` - show version
79
- - `/help` - show commands
111
+ ```bash
112
+ /skills add /path/to/skill
113
+ ```
80
114
 
81
- **Exit**
82
- - `exit` or `quit`
115
+ ### creating skills
83
116
 
84
- ## Context Files
117
+ ```bash
118
+ /skills create my-skill
119
+ ```
85
120
 
86
- The CLI automatically loads context files into the AI's system prompt:
121
+ creates `~/.ai-cli/skills/my-skill/SKILL.md`
87
122
 
88
- - `CLAUDE.md` - project instructions
89
- - `CLAUDE.local.md` - local instructions (not committed)
90
- - `AGENTS.md` - agent-specific instructions
91
- - `.cursorrules` - cursor rules
92
- - `.cursor/rules/*.md` - cursor rule files (supports globs and alwaysApply)
93
- - `~/CLAUDE.md` - global instructions
123
+ ## rules
94
124
 
95
- Use `/context` to see which files are loaded.
125
+ custom instructions loaded into every conversation:
96
126
 
97
- ## Aliases
127
+ - `~/.ai-cli/AGENTS.md` - global rules
128
+ - `./AGENTS.md` - project rules
98
129
 
99
- Create custom command shortcuts:
130
+ manage with `/rules`:
100
131
 
101
132
  ```bash
102
- /alias h help # /h → /help
103
- /alias c copy # /c /copy
104
- /alias m model # /m → /model
105
- /alias -d h # remove alias
106
- /alias # list all aliases
133
+ /rules show # view rules
134
+ /rules edit # open in editor
135
+ /rules clear # remove rules
136
+ /rules path # show path
107
137
  ```
108
138
 
109
- Aliases are stored in `~/.airc` and shown in `/help`.
139
+ ## tools
140
+
141
+ the AI can:
142
+
143
+ **files** - read, write, edit, delete, copy, rename, search
144
+
145
+ **commands** - run shell commands, background processes
146
+
147
+ **memory** - save facts across sessions ("remember X")
110
148
 
111
- ## Tools
149
+ **web** - search, fetch urls, check weather
112
150
 
113
- The AI can interact with your system:
151
+ ## mcp
152
+
153
+ connect to external tools via [model context protocol](https://modelcontextprotocol.io):
154
+
155
+ ```bash
156
+ /mcp # list servers
157
+ /mcp add weather http https://mcp.example.com
158
+ /mcp add db stdio npx @example/mcp-db
159
+ /mcp remove weather # remove server
160
+ /mcp reload # reconnect all
161
+ ```
114
162
 
115
- **Files**
116
- - read/write/edit files
117
- - create folders
118
- - rename/move/copy/delete files
119
- - search in files
120
- - find files by pattern
163
+ ### transports
164
+
165
+ - **http** - HTTP endpoint
166
+ - **sse** - server-sent events
167
+ - **stdio** - spawn local process
168
+
169
+ ### config
170
+
171
+ servers stored in `~/.ai-cli/mcp.json`:
172
+
173
+ ```json
174
+ {
175
+ "servers": {
176
+ "weather": {
177
+ "type": "http",
178
+ "url": "https://mcp.example.com"
179
+ },
180
+ "db": {
181
+ "type": "stdio",
182
+ "command": "npx",
183
+ "args": ["@example/mcp-db"]
184
+ }
185
+ }
186
+ }
187
+ ```
121
188
 
122
- **Commands**
123
- - run shell commands (build, test, install)
124
- - start background processes (dev servers)
125
- - manage running processes
189
+ environment variables expand with `${VAR}` or `${VAR:-default}`.
126
190
 
127
- **Memory**
128
- - say "remember X" to save facts across sessions
129
- - ask "what do you remember" to recall
191
+ mcp tools are prefixed with server name (e.g., `weather_get_forecast`).
130
192
 
131
- ## Switching Models
193
+ ## models
132
194
 
133
- Supports fuzzy matching:
195
+ supports fuzzy matching:
134
196
 
135
197
  ```bash
136
198
  ai -m claude-4 # → anthropic/claude-sonnet-4
137
199
  ai -m gpt-5 # → openai/gpt-5
138
- ai -m sonnet # → finds a sonnet model
200
+ ai -m sonnet # → finds sonnet model
139
201
  ```
140
202
 
141
- ## Storage
203
+ ## storage
204
+
205
+ all data in `~/.ai-cli/`:
206
+
207
+ ```
208
+ ~/.ai-cli/
209
+ ├── config.json # settings and api key
210
+ ├── mcp.json # mcp servers
211
+ ├── chats/ # chat history
212
+ ├── memories.json # saved memories
213
+ ├── skills/ # installed skills
214
+ └── AGENTS.md # global rules
215
+ ```
142
216
 
143
- - Config: `~/.airc`
144
- - Chats: `~/.ai-chats/`
145
- - Memories: `~/.ai-memories`
217
+ ## environment
218
+
219
+ alternatively set your API key:
220
+
221
+ ```bash
222
+ export AI_GATEWAY_API_KEY=your-key
223
+ ```