arti-cli
v0.3.3
Published
Terminal coding agent powered by Arti AI
Readme
Arti
A terminal coding agent powered by Arti AI — think Claude Code, but running on the Arti backend.
Arti v0.1.0 — model: arti-0.5
cwd: /your/project
logged in as: [email protected]
type /help for commands
──────────────────────────────────────────────────────────────────────────────
> read package.json and summarise what this project doesInstall
# From source
npm install
npm run build
npm link # makes `arti` available globally
# Or with npx (once published)
npx arti-codeRequirements: Node.js 20+
First Run / Login
On first run, Arti will prompt for your Firebase API key, then your Arti account credentials:
$ arti
Firebase API key not found.
Find it in the Arti project settings or set ARTI_FIREBASE_API_KEY env var.
? Paste Firebase API key: ›
Arti — Login
? Email: › [email protected]
? Password: › ••••••••
✓ Signed in as [email protected]Credentials are cached in ~/.arti-code/config.json and automatically refreshed.
You can also login/logout explicitly:
arti login # re-authenticate
arti logout # clear saved credentialsOr set the API key via environment variable:
export ARTI_FIREBASE_API_KEY="your-key-here"Usage
Interactive REPL
artiType your coding question at the > prompt. Arti can read files, propose edits, run commands, and list directories — all requiring your approval before changes are made.
One-shot mode
arti "read package.json and summarise it"
arti "what tests are failing?" --model arti-1Examples
> list the files in src/
> read src/auth.ts and explain the token refresh logic
> there's a bug in line 42 of utils/parser.ts — the regex doesn't handle escaped quotes
> add error handling to the fetchUser function in api/users.ts
> run npm test and fix any failuresREPL Commands
| Command | Description |
|---------|-------------|
| /exit, /quit | Exit Arti |
| /clear | Clear conversation history (keeps session) |
| /model <id> | Switch model for the session |
| /usage | Show token usage for this session |
| /cwd | Show current working directory |
| /help | Show help |
Models
| Model | Description |
|-------|-------------|
| arti-0.3 | Fast, lightweight — good for simple tasks |
| arti-0.5 | Balanced — default |
| arti-1 | Most capable — best for complex tasks |
Switch mid-session:
/model arti-1Or set for a one-shot run:
arti --model arti-1 "refactor this module"Tools Arti Can Use
All tool executions that modify the filesystem or run code require your approval:
| Tool | What it does | Requires approval |
|------|-------------|-------------------|
| read_file | Read a file's contents | No |
| list_dir | List directory contents | No |
| edit_file | Show diff + apply targeted edit | Yes |
| create_file | Show preview + create new file | Yes |
| run_command | Show command + execute with output | Yes |
Plan Limits
Token limits and plan gating are enforced server-side by Firebase Auth + the Arti backend. The CLI never handles billing logic — it just surfaces the response:
429→ "Daily token limit reached for your plan"403→ "Feature requires a higher plan"
Upgrade your Arti plan at arti.dev to increase limits.
Auth & Security
Auth uses the Firebase Auth REST API — the same endpoints the Firebase JS SDK wraps internally. All requests are HTTPS. The idToken (a signed JWT) is validated server-side by Firebase Admin SDK in the Cloud Function; the CLI never performs that validation itself.
- Tokens expire every hour and are refreshed automatically via the secure token endpoint
- Credentials are stored in
~/.arti-code/config.json(readable only by your user) - The Firebase API key is a public project identifier — it does not grant admin access
Config File
Stored at ~/.arti-code/config.json:
{
"email": "[email protected]",
"idToken": "...",
"refreshToken": "...",
"expiresAt": 1234567890000,
"model": "arti-0.5",
"firebaseApiKey": "..."
}Never commit this file. It contains your auth tokens.
Development
npm install
npm run dev # run with tsx (no build step)
npm run build # compile TypeScript → dist/
npm start # run compiled versionArchitecture
src/
index.ts REPL loop, one-shot mode, CLI entry
auth.ts Firebase REST auth, token refresh, caching
stream.ts SSE streaming from Arti backend
tools.ts Tool execution (read/edit/run/list/create)
ui.ts chalk/ora/marked-terminal helpers
config.ts ~/.arti-code/config.json read/write
system-prompt.ts CLI-optimised system prompt