@culustech/kalai-cli
v0.0.4
Published
KALAI CLI — terminal-first AI coding agent
Downloads
562
Maintainers
Readme
KALAI CLI
Terminal-first AI coding agent. KALAI CLI reuses the same Kalai Agent backend as the VS Code extension, so your wallet, history, and settings stay in one place.
Installation
npm install -g @culustech/kalai-cliQuick Start
# Create a new Kalai account (opens browser)
kalai register
# Log in with your Kalai account
kalai login
# Ask a one-shot question
kalai ask "Explain this codebase"
# Or use the shortcut
kalai "What does package.json do?"
# Run an autonomous agent task
kalai agent "Find all TODO comments and list them"
# Start an interactive chat session
kalai chat
# Check wallet balance
kalai wallet
# Generate AGENTS.md for the current project
kalai indexCommands
| Command | Description |
|---------|-------------|
| kalai register | Open the registration page in your browser |
| kalai login | Log in with email and password |
| kalai logout | Clear locally stored credentials |
| kalai wallet | Show wallet balance |
| kalai config list | Show all configuration |
| kalai config get <key> | Get a config value |
| kalai config set <key> <value> | Set a config value |
| kalai ask "<prompt>" | Send a one-shot prompt |
| kalai ask "<prompt>" --paste | Send a prompt with the clipboard image attached |
| kalai agent "<task>" | Run an autonomous agent task |
| kalai agent "<task>" --paste | Run an agent task with the clipboard image attached |
| kalai agent "continue" | Resume the most recent agent session in this directory |
| kalai agent --continue <sessionId> | Resume a specific saved agent session |
| kalai agent --new "<task>" | Force a new session even if a recent one exists |
| kalai chat | Start an interactive chat session |
| kalai chat --paste | Start chat with the clipboard image attached to the first message |
| kalai index | Generate AGENTS.md for the current project |
| kalai subagents list | List running and completed sub-agent tasks |
| kalai subagents show <id> | Show a sub-agent task result |
| kalai subagents show <id> --full | Dump the full sub-agent transcript |
| kalai subagents stop <id> | Stop a running background sub-agent |
| kalai upgrade | Upgrade to the latest CLI version |
| kalai --version | Show CLI version |
Agent Mode
The agent can read files, run terminal commands, execute Python/Node.js code, and fetch web pages. By default, mutating tools prompt for approval.
# Auto-approve all tool calls (use with caution)
kalai agent "Refactor all console.log to use a logger" --yolo
# Read-only mode
kalai agent "Summarize the project structure" --readonly
# Resume the most recent agent session in the current directory
kalai agent "continue"
# Resume a specific session
kalai agent --continue abc-123
# Force a new session
kalai agent --new "Add a dark mode toggle"Agent sessions are persisted to ~/.kalai/agent-sessions/<id>.json, so you can resume after an interruption with kalai agent "continue".
Sub-agents
The agent can dispatch focused tasks to isolated sub-agents while it continues working.
# Delegate a read-only exploration task to an explorer sub-agent
kalai agent "Explore the src folder and summarize the architecture with an explorer sub-agent"
# List running and completed sub-agent tasks
kalai subagents list
# Show the result of a completed sub-agent task
kalai subagents show sub_abc123
# Dump the full transcript
kalai subagents show sub_abc123 --full
# Stop a running background sub-agent
kalai subagents stop sub_abc123Built-in profiles:
coder— read/write/execute/search (default)explorer— read-only reconnaissanceplanner— analysis and planning without writes or shell commands
Custom profiles can be added as JSON files in .kalai/profiles/*.json in the workspace or ~/.kalai/profiles/*.json.
Chat Mode
kalai chat starts a persistent REPL with slash commands:
| Command | Description |
|---------|-------------|
| /new | Start a new session |
| /sessions | List saved sessions |
| /resume <id> | Resume a session |
| /model <name> | Switch active model |
| /paste | Attach the clipboard image to the next message |
| /index | Generate AGENTS.md |
| /usage | Show session info |
| /wallet | Show wallet balance |
| /logout | Sign out |
| /exit | Quit chat |
Configuration
Configuration is stored in ~/.kalai/config.json:
{
"backend": {
"baseUrl": "https://kalapi.culustech.com"
},
"frontend": {
"baseUrl": "https://kalai.culustech.com"
},
"model": {
"maxTokens": 4096,
"temperature": 0.7
},
"agentic": {
"enabled": true,
"maxIterations": 50,
"maxExecutionTimeMs": 600000
},
"tools": {
"terminal": { "enabled": true, "autoApprove": false },
"codeExecution": { "enabled": true, "autoApprove": false },
"webSearch": { "enabled": true }
}
}Add "name": "<model-id>" under model to override the backend's default model.
Override via environment variables:
KALAI_BACKEND_URLKALAI_FRONTEND_URLKALAI_MODEL
Security
- Tokens are stored in the OS credential store when possible, otherwise in an encrypted file at
~/.kalai/credentials.json. - File-system tools are sandboxed to the current working directory unless
AGENT_ALLOW_OUTSIDE_WORKING_DIRECTORY=trueis set. - Terminal and code-execution tools prompt for approval before running unless
--yolois used.
Development
cd CLI/npmjs
npm install
npm run devLicense
MIT
