minimal terminal AI assistant
minimal terminal AI assistant
``bash`
npm install -g ai-cli
`bash`
ai init
get your API key from Vercel AI Gateway
`bash
ai # interactive mode
ai "hello" # single message
ai -m gpt-5 "hello" # use specific model
ai --image ./img.png "what?" # analyze image (single message)
ai -l # list models
echo "explain this" | ai # pipe input
options
-
-m, --model - model (default: anthropic/claude-sonnet-4.5)
- --image - attach image file
- -l, --list - list models
- -h, --help - helpcommands
$3
- /new - new chat
- /chats - list chats
- /chat - load chat
- /delete - delete chat
- /clear - clear screen$3
- /copy - copy response
- /rollback - undo changes$3
- /git status - file status
- /git diff - unstaged changes
- /git staged - staged changes
- /git branch - list/switch branches
- /git commit - ai-generated commit message
- /git push - push to remote
- /git log - recent commits
- /git stash - stash/pop changes$3
- /usage - token usage and cost
- /compress - compress history$3
- /list - select model
- /model - current model$3
- /processes - background processes
- /memory - saved memories
- /mcp - mcp servers
- /settings - preferences
- /alias - shortcuts
- /help - commandsskills
skills extend the AI with specialized capabilities. they follow the Agent Skills open standard.
$3
`bash
/skills # list installed
/skills add # install from git
/skills remove # uninstall
/skills show # view content
/skills create # create new
/skills path # show directory
`$3
shorthand (like skills.sh):
`bash
/skills add vercel-labs/agent-skills/skills/react-best-practices
/skills add anthropics/skills/skills/pdf
/skills add owner/repo
`full github url:
`bash
/skills add https://github.com/anthropics/skills/tree/main/skills/pdf
`local path:
`bash
/skills add /path/to/skill
`$3
`bash
/skills create my-skill
`creates
~/.ai-cli/skills/my-skill/SKILL.mdrules
custom instructions loaded into every conversation:
-
~/.ai-cli/AGENTS.md - global rules
- ./AGENTS.md - project rulesmanage with
/rules:`bash
/rules show # view rules
/rules edit # open in editor
/rules clear # remove rules
/rules path # show path
`tools
the AI can:
files - read, write, edit, delete, copy, rename, search
commands - run shell commands, background processes
memory - save facts across sessions ("remember X")
web - search, fetch urls, check weather
mcp
connect to external tools via model context protocol:
`bash
/mcp # list servers
/mcp add weather http https://mcp.example.com
/mcp add db stdio npx @example/mcp-db
/mcp remove weather # remove server
/mcp reload # reconnect all
`$3
- http - HTTP endpoint
- sse - server-sent events
- stdio - spawn local process
$3
servers stored in
~/.ai-cli/mcp.json:`json
{
"servers": {
"weather": {
"type": "http",
"url": "https://mcp.example.com"
},
"db": {
"type": "stdio",
"command": "npx",
"args": ["@example/mcp-db"]
}
}
}
`environment variables expand with
${VAR} or ${VAR:-default}.mcp tools are prefixed with server name (e.g.,
weather_get_forecast).models
supports fuzzy matching:
`bash
ai -m claude-4 # → anthropic/claude-sonnet-4
ai -m gpt-5 # → openai/gpt-5
ai -m sonnet # → finds sonnet model
`storage
all data in
~/.ai-cli/:`
~/.ai-cli/
├── config.json # settings and api key
├── mcp.json # mcp servers
├── chats/ # chat history
├── memories.json # saved memories
├── skills/ # installed skills
└── AGENTS.md # global rules
`environment
alternatively set your API key:
`bash
export AI_GATEWAY_API_KEY=your-key
``