ai-cli 0.0.1 → 0.0.2-beta.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 +118 -17
- package/dist/ai.mjs +594 -54
- package/package.json +37 -30
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ai-cli
|
|
2
2
|
|
|
3
|
-
AI CLI using
|
|
3
|
+
AI CLI using Vercel AI Gateway
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,35 +10,136 @@ npm install -g ai-cli
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
Set your AI Gateway API key in your shell configuration:
|
|
14
|
-
|
|
15
13
|
```bash
|
|
16
|
-
|
|
17
|
-
export AI_GATEWAY_API_KEY=your-api-key
|
|
14
|
+
ai init
|
|
18
15
|
```
|
|
19
16
|
|
|
20
|
-
Get your API key
|
|
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)
|
|
21
18
|
|
|
22
19
|
## Usage
|
|
23
20
|
|
|
24
21
|
```bash
|
|
25
|
-
ai
|
|
26
|
-
ai hello
|
|
27
|
-
|
|
28
|
-
ai
|
|
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
|
|
26
|
+
ai -l # list available models
|
|
27
|
+
echo "explain this" | ai # pipe input
|
|
29
28
|
```
|
|
30
29
|
|
|
31
30
|
## Options
|
|
32
31
|
|
|
33
|
-
- `-m, --model` -
|
|
34
|
-
-
|
|
32
|
+
- `-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
|
+
- `-h, --help` - help
|
|
36
|
+
|
|
37
|
+
## Interactive Mode
|
|
38
|
+
|
|
39
|
+
Type `ai` to enter interactive mode with file access and chat history.
|
|
40
|
+
|
|
41
|
+
### Commands
|
|
42
|
+
|
|
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
|
|
50
|
+
|
|
51
|
+
**Files**
|
|
52
|
+
- `/copy` - copy last response to clipboard
|
|
53
|
+
- `/rollback` - view/undo file changes
|
|
54
|
+
- `/diff` - view recent file changes
|
|
55
|
+
|
|
56
|
+
**Context**
|
|
57
|
+
- `/context` - show token usage and loaded context files
|
|
58
|
+
- `/compress` - compress chat history
|
|
59
|
+
- `/usage` - show chat stats and cost
|
|
60
|
+
|
|
61
|
+
**Models**
|
|
62
|
+
- `/list` - select model (with search)
|
|
63
|
+
- `/model` - show current model
|
|
64
|
+
|
|
65
|
+
**Processes**
|
|
66
|
+
- `/processes` - manage background processes
|
|
67
|
+
|
|
68
|
+
**Memory**
|
|
69
|
+
- `/memory` - view saved memories
|
|
70
|
+
- `/memory clear` - clear all memories
|
|
71
|
+
|
|
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
|
|
80
|
+
|
|
81
|
+
**Exit**
|
|
82
|
+
- `exit` or `quit`
|
|
83
|
+
|
|
84
|
+
## Context Files
|
|
85
|
+
|
|
86
|
+
The CLI automatically loads context files into the AI's system prompt:
|
|
87
|
+
|
|
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
|
|
94
|
+
|
|
95
|
+
Use `/context` to see which files are loaded.
|
|
96
|
+
|
|
97
|
+
## Aliases
|
|
98
|
+
|
|
99
|
+
Create custom command shortcuts:
|
|
100
|
+
|
|
101
|
+
```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
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Aliases are stored in `~/.airc` and shown in `/help`.
|
|
110
|
+
|
|
111
|
+
## Tools
|
|
112
|
+
|
|
113
|
+
The AI can interact with your system:
|
|
114
|
+
|
|
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
|
|
121
|
+
|
|
122
|
+
**Commands**
|
|
123
|
+
- run shell commands (build, test, install)
|
|
124
|
+
- start background processes (dev servers)
|
|
125
|
+
- manage running processes
|
|
126
|
+
|
|
127
|
+
**Memory**
|
|
128
|
+
- say "remember X" to save facts across sessions
|
|
129
|
+
- ask "what do you remember" to recall
|
|
35
130
|
|
|
36
131
|
## Switching Models
|
|
37
132
|
|
|
38
|
-
|
|
133
|
+
Supports fuzzy matching:
|
|
39
134
|
|
|
40
135
|
```bash
|
|
41
|
-
ai -m claude-4-sonnet
|
|
42
|
-
ai -m openai/gpt-
|
|
43
|
-
ai -m
|
|
44
|
-
```
|
|
136
|
+
ai -m claude-4 # → anthropic/claude-sonnet-4
|
|
137
|
+
ai -m gpt-5 # → openai/gpt-5
|
|
138
|
+
ai -m sonnet # → finds a sonnet model
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Storage
|
|
142
|
+
|
|
143
|
+
- Config: `~/.airc`
|
|
144
|
+
- Chats: `~/.ai-chats/`
|
|
145
|
+
- Memories: `~/.ai-memories`
|