Install the CLI
Get StackAI running in your terminal in under a minute. Requires Node.js 20+.
1
Install globally
Install the CLI from npm. This gives you the stackai command everywhere.
$npm install -g stackaiVerify: stackai --version
2
Get your API key
Sign in with X and create a key from your dashboard. Copy it — it's shown only once.
Open dashboard →Keys look like sk_live_4a8f3c2e1b9d7e5f
3
Authenticate
Save your key locally (stored in ~/.stackai/config.json).
$stackai loginCheck it: stackai whoami
4
Start coding
Open an interactive session — like a chat, with full context across messages:
$stackaiOr run a single task and exit:
$stackai "add input validation to all routes"Command reference
| stackai | Start an interactive chat session |
| stackai "<prompt>" | Run the agent once, then exit |
| stackai login | Log in (prompts for your API key) |
| stackai whoami | Show current user + usage today |
| stackai --help | Show all commands |
| stackai --version | Print the version |
How it works
- • The agent runs locally in your terminal — it reads, writes, and edits files in your current directory.
- • Model calls are routed through StackAI's API, which enforces your rate limit and keeps the model key server-side.
- • Free tier includes 50 requests/day per key.