HomeCLI Documentation
Lumi CLI
v1.3.1Agentic mode

AI in your
terminal.

Chat, write code, edit files, and execute autonomous agentic tasks — without leaving the terminal you already live in. 40+ models. One command to install.

lumi chatlumi codelumi editlumi dolumi projectlumi ask
Terminal
$ npm install -g lumichat-cli
$ lumi login
✓ Opened browser — sign in to continue
✓ Authenticated as dev@example.com

$ lumi do "add input validation to all route handlers"
◆ Reading src/routes/users.ts
◆ Reading src/routes/posts.ts
⚡ Write file: src/routes/users.ts
  Run this? [y/N] y
✓ Done — 3 files updated, 12 validators added

Installation

Requirements

Node.js≥ 18.0.0
npm≥ 8.x
OSmacOS · Linux · Windows (WSL)
Paste in your terminal
curl -fsSL https://lumichats.com/install.sh | bash

The script checks for Node.js ≥ 18, installs lumichat-cli globally via npm, and verifies the binary is in your PATH. Takes about 30 seconds.

Or install manually via npm

npm install -g lumichat-cli

Verify the installation

lumi --version
# 1.3.1

lumi
# Prints full help and available commands

lumi login
# Opens browser → authenticate → you're ready

Quick Start

Common workflows to get you productive in the first 5 minutes.

Chat with AI

lumi chat
# Start an interactive session

> What's the difference between useEffect and useLayoutEffect in React?
# → Full streamed answer with syntax-highlighted code examples

Get a quick answer and exit

lumi ask "explain the CAP theorem in 2 sentences"

Review a code file

lumi code src/api.ts "are there any security issues in this file?"

Let the AI edit a file (always shows diff first)

lumi edit utils.ts "add JSDoc to all exported functions" --model qwen-coder

Run an autonomous agentic task

lumi do "find all TODO comments in src/ and fix the obvious ones"

Pipe shell output to the AI

npm test 2>&1 | lumi ask "what's failing and why?"

Command Reference

Click any command to expand its full syntax, all options, and examples.

Quick Reference Card

lumi login                              Sign in (opens browser)
lumi logout                             Sign out

lumi chat                               Interactive chat
lumi chat --model <name>                Chat with a specific model

lumi ask "<question>"                   One-shot answer, then exits
lumi ask "<q>" --file <path>            Attach a file
cat file | lumi ask "<q>"               Pipe content as context
lumi ask "<q>" > out.txt                Clean plain-text to file

lumi code <file>                        Code chat with file context
lumi code <file> "<question>"           Open with initial question

lumi edit <file> "<task>"               AI edits file (diff first)

lumi do "<task>"                        Autonomous agentic task
lumi do "<task>" --yes                  Skip all confirmations

lumi project                            Load current folder
lumi project <folder> --depth 3         Shallow scan

lumi run <cmd>                          Run a command
lumi run --analyse <cmd>                Run + auto-send output to AI

lumi models                             List all 40+ models
lumi status                             Account and usage info
lumi upgrade                            Open pricing page

Agentic Mode — lumi do

v1.3.1Agentic

lumi do gives the AI a set of filesystem and shell tools and lets it execute a task autonomously — reading files, writing changes, running commands, and adapting based on the results. Every destructive operation requires your explicit confirmation before anything touches disk or your shell.

Available tools

ToolAccess levelDescription
read_fileRead-onlyRead the full contents of any file in the project tree
read_file_linesRead-onlyRead a specific line range — efficient for large files
list_filesRead-onlyList directory contents with smart dotfile filtering
write_fileDestructive ⚠Write or overwrite a file — always prompts [y/N] unless --yes
patch_fileDestructive ⚠Apply a line-level patch — always prompts [y/N] unless --yes
execute_commandDestructive ⚠Run a shell command — always prompts [y/N] unless --yes

How confirmation works

$ lumi do "write unit tests for src/auth.ts"

◆ Reading src/auth.ts  (no prompt — read-only)
◆ Reading src/types.ts  (no prompt — read-only)

⚡ Write file: src/auth.test.ts (48 lines)
  Run this? [y/N] y

✓ src/auth.test.ts created
✓ Task complete — 1 file written, 12 tests added
Pass --yes (-y) to auto-approve all confirmations. Use this only in fully automated pipelines where you trust the task and the project scope. For interactive use, the default prompt is your safety net.

Real-world examples

# Fix failing tests
lumi do "run npm test and fix any failing unit tests"

# Add documentation
lumi do "add JSDoc to all exported functions in src/"

# Security audit + fix
lumi do "find any SQL injection risks in src/db/ and patch them"

# Refactor with confidence
lumi do "refactor src/auth.ts to use async/await throughout"

# Generate from scratch
lumi do "generate a CHANGELOG.md from git log --oneline"

# Automate in CI (all confirmations auto-approved)
lumi do "generate API docs from src/routes/" --yes

Model Reference

Pass any of these shortnames to --model (or -m) in any command. Run lumi models to see the full current list with Pro/Free labels.

ShortnameModel
bestBest available model for the prompt (auto-selected)
claudeClaude Sonnet (balanced reasoning + coding)
claude-fastClaude Haiku (fast, cheaper)
qwen-coderQwen2.5-Coder 32B — strongly recommended for coding tasks
gpt4oGPT-4o
gpt4o-miniGPT-4o Mini (fast)
geminiGemini 1.5 Pro
gemini-flashGemini 1.5 Flash (fast)
llamaLlama 3.1 70B (open source)
mistralMistral Large
deepseekDeepSeek R1 (strong at maths and reasoning)
o1-miniOpenAI o1-mini (extended thinking) [Pro]
Recommendation: Use qwen-coder for all code editing and agentic tasks. Use claude for reasoning, writing, and analysis. Use best to let Lumi pick automatically.

Slash Commands

Type these inside any interactive session (chat, code, project). Tab completion works for most slash commands.

Universal — all session types

/helpPrint all available slash commands for the current session type
/model <name>Switch to a different model mid-session — conversation history is preserved
/clearClear conversation history and start fresh (model and settings unchanged)
/undoRemove the last exchange (your message + the AI reply) from history
/compactAsk the model to summarise the conversation history to free up context window space
/save [file]Export the full conversation to a Markdown file (auto-named if no path given)
/statusPrint account and usage info without leaving the session
/exitQuit the session cleanly (also: Ctrl+D)

Project-only — inside lumi project

/edit <file> <task>AI-edit a file — renders a coloured diff and asks for confirmation before writing
/run <cmd>Run a shell command from inside the project session
/add <file>Pull an additional file into the current project context
/treePrint the loaded file tree with sizes and any skipped-file notices
/filesList all files currently loaded in context

Keyboard shortcuts

↑ / ↓Navigate input history (up to 100 entries per session)
Ctrl+C (during stream)Interrupt the response — the partial reply is saved to history so context is retained
Ctrl+C (at prompt)Press twice to force-exit, or use /exit for a clean quit
Ctrl+DSend EOF — cleanly exits the session (same as /exit)
\ at end of lineMultiline input continuation — press Enter on a non-\ line to submit

Configuration

Lumi stores a single config file. You should never need to edit it manually — lumi login and lumi logout manage it for you.

File location

~/.lumichat/config.json

# Permissions: -rw------- (0600 — only your user can read it)

Schema

FieldTypeDescription
accessTokenstringShort-lived JWT for API calls
refreshTokenstringLong-lived token used to obtain new access tokens
userIdstringYour account UUID
emailstringAccount email (display only)
planstringCurrent plan: "free" | "pro"
expiresAtnumberUNIX timestamp (ms) when the accessToken expires
Never commit ~/.lumichat/config.json to version control or share it. It contains your auth tokens. For CI/CD, see the CI/CD section below.

Token lifecycle

Access tokens are short-lived JWTs. Lumi checks expiresAt before every API call and proactively refreshes using the refreshToken when the access token is within 60 seconds of expiry. You will never see an "auth expired" error mid-session in normal usage.

Security & Safety

Lumi is designed so that even a misbehaving or adversarially-prompted model cannot harm your system without your explicit approval.

Path traversal protection

All file operations in lumi do are gated by an assertInBounds() check. Every resolved path is verified to be inside the current working directory tree. If the model attempts to read ~/.ssh/authorized_keys or any path outside the project, the operation is blocked with an error — even if the model was tricked into requesting it via prompt injection.

Human-in-the-loop for destructive actions

Before any write_file, patch_file, or execute_command, Lumi prints exactly what the agent intends to do and asks for explicit [y/N] confirmation. Read-only operations (read_file, list_files) never prompt. If you deny an operation, the agent receives a structured "user denied this operation" result and can adapt its approach — it won't crash or get stuck.

Credential storage

~/.lumichat/config.json is created with 0600 permissions (owner read/write only). The file is validated on load against a strict JSON schema — a malformed or tampered file will cause a clean error, not silent misbehaviour.

CSRF protection during login

The OAuth callback includes a CSRF nonce that is verified before accepting any credentials. A malicious page cannot trigger an unwanted login by making requests to the local callback server.

Using --yes: The --yes flag bypasses all confirmation prompts and should only be used in pipelines where you fully trust the task description and the project scope. Never use --yes when running lumi do on an unfamiliar repository.

CI / CD & Automation

Lumi works well in automated pipelines. The key is writing a valid config.json from secrets before running any command.

GitHub Actions — basic setup

.github/workflows/lumi.yml
# .github/workflows/lumi.yml
jobs:
  lint-with-ai:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: Install Lumi CLI
        run: npm install -g lumichat-cli

      - name: Write credentials
        run: |
          mkdir -p ~/.lumichat
          echo '${{ secrets.LUMICHAT_CONFIG }}' > ~/.lumichat/config.json
          chmod 600 ~/.lumichat/config.json

      - name: Run agentic task
        run: |
          lumi do "generate API docs from src/routes/" --yes

Generating the config secret

# On your local machine, after lumi login:
cat ~/.lumichat/config.json
# Copy the JSON → add as LUMICHAT_CONFIG secret in GitHub

# Note: access tokens expire. Use a long-lived refresh token setup,
# or re-generate the config periodically using lumi login.

Pipe output in shell scripts

#!/usr/bin/env bash
# lumi ask strips ANSI when stdout is not a TTY

SUMMARY=$(lumi ask "summarise this diff" --file changes.diff)
echo "$SUMMARY" >> release-notes.md

# Analyse test results
lumi ask "what failed and why" --file test-output.txt > diagnosis.txt
For long-running pipelines, store the full config.json (including refreshToken) so that token refresh works automatically. Avoid storing only the accessToken — it will expire within minutes.

Plans & Limits

FeatureFreePro
Messages per day5Unlimited
Model accessFree-tier modelsAll 40+ including Premium
lumi chat
lumi ask
lumi code
lumi edit
lumi do (agentic mode)✓ (counts each tool call)✓ Unlimited
lumi project
Piped / non-TTY output
Streaming
Premium models (o1, etc.)
When the daily free limit is reached, Lumi prints a clear error with a link to the pricing page. Run lumi upgrade to open it in your browser.

Troubleshooting

Ready to start?

Install, sign in, and you're chatting in under 60 seconds.

npm install -g lumichat-cli && lumi login
Create free account