ai-cli 0.0.1 → 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 +200 -21
  2. package/dist/ai.mjs +380 -54
  3. package/package.json +40 -30
package/README.md CHANGED
@@ -1,44 +1,223 @@
1
1
  # ai-cli
2
2
 
3
- AI CLI using OpenAI's open source model.
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
- Set your AI Gateway API key in your shell configuration:
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
+
29
+ # in interactive mode, ctrl+v to paste image from clipboard
30
+ ```
31
+
32
+ ## options
33
+
34
+ - `-m, --model` - model (default: anthropic/claude-sonnet-4.5)
35
+ - `--image` - attach image file
36
+ - `-l, --list` - list models
37
+ - `-h, --help` - help
38
+
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.
81
+
82
+ ### managing skills
83
+
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
+ ```
92
+
93
+ ### installing skills
94
+
95
+ shorthand (like skills.sh):
96
+
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
+ ```
102
+
103
+ full github url:
104
+
105
+ ```bash
106
+ /skills add https://github.com/anthropics/skills/tree/main/skills/pdf
107
+ ```
108
+
109
+ local path:
110
+
111
+ ```bash
112
+ /skills add /path/to/skill
113
+ ```
114
+
115
+ ### creating skills
116
+
117
+ ```bash
118
+ /skills create my-skill
119
+ ```
120
+
121
+ creates `~/.ai-cli/skills/my-skill/SKILL.md`
122
+
123
+ ## rules
124
+
125
+ custom instructions loaded into every conversation:
126
+
127
+ - `~/.ai-cli/AGENTS.md` - global rules
128
+ - `./AGENTS.md` - project rules
129
+
130
+ manage with `/rules`:
131
+
132
+ ```bash
133
+ /rules show # view rules
134
+ /rules edit # open in editor
135
+ /rules clear # remove rules
136
+ /rules path # show path
137
+ ```
138
+
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")
148
+
149
+ **web** - search, fetch urls, check weather
150
+
151
+ ## mcp
152
+
153
+ connect to external tools via [model context protocol](https://modelcontextprotocol.io):
14
154
 
15
155
  ```bash
16
- # Add to ~/.zshrc or ~/.bashrc
17
- export AI_GATEWAY_API_KEY=your-api-key
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
18
161
  ```
19
162
 
20
- Get your API key at https://vercel.com/docs/ai-gateway
163
+ ### transports
21
164
 
22
- ## Usage
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
+ ```
188
+
189
+ environment variables expand with `${VAR}` or `${VAR:-default}`.
190
+
191
+ mcp tools are prefixed with server name (e.g., `weather_get_forecast`).
192
+
193
+ ## models
194
+
195
+ supports fuzzy matching:
23
196
 
24
197
  ```bash
25
- ai "whats up bro"
26
- ai hello
27
- echo "explain this code" | ai
28
- ai -m openai/gpt-oss-120b "who is rauchg"
198
+ ai -m claude-4 # → anthropic/claude-sonnet-4
199
+ ai -m gpt-5 # → openai/gpt-5
200
+ ai -m sonnet # finds sonnet model
29
201
  ```
30
202
 
31
- ## Options
203
+ ## storage
32
204
 
33
- - `-m, --model` - Specify AI model (default: openai/gpt-oss-120b)
34
- - `-h, --help` - Show help message
205
+ all data in `~/.ai-cli/`:
35
206
 
36
- ## Switching Models
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
+ ```
37
216
 
38
- You can use any model available through Vercel AI Gateway by using the `-m` flag:
217
+ ## environment
218
+
219
+ alternatively set your API key:
39
220
 
40
221
  ```bash
41
- ai -m claude-4-sonnet "who am i"
42
- ai -m openai/gpt-4o "count to 3"
43
- ai -m anthropic/claude-4.1-opus "spend my money"
44
- ```
222
+ export AI_GATEWAY_API_KEY=your-key
223
+ ```