← StackAI

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 stackai

Verify: 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 login

Check it: stackai whoami

4

Start coding

Open an interactive session — like a chat, with full context across messages:

$stackai

Or run a single task and exit:

$stackai "add input validation to all routes"

Command reference

stackaiStart an interactive chat session
stackai "<prompt>"Run the agent once, then exit
stackai loginLog in (prompts for your API key)
stackai whoamiShow current user + usage today
stackai --helpShow all commands
stackai --versionPrint the version

How it works