Documentation
Everything you need to install, configure, and use Cipher — the autonomous coding agent for your terminal.
Overview
Cipher is an open-source, terminal-based autonomous coding agent. You describe a task in natural language — Cipher reads your codebase, writes files, runs commands, searches the web, and reports back when done.
It runs entirely in your terminal as a rich TUI (terminal user interface) with a persistent chat sidebar, live tool output display, and session history. No browser, no IDE extension, no cloud dashboard required.
Key characteristics
- Free to use — The built-in Cipher Proxy provides Gemini and Llama models at no cost, no API key needed.
- Bring your own model — Connect to any of 14+ providers using your own API keys.
- Local AI support — Works with Ollama and LM Studio for fully offline, private operation.
- Two-agent architecture — Separate Chat AI (reasoning) and Coding AI (execution) for better results and efficiency.
- Full tool suite — File read/write/edit, shell execution, web fetch, web search, git, grep, glob, and more.
- Cross-platform — Mac, Linux, and Windows (PowerShell) fully supported.
- Persistent sessions — All conversations saved with AI-generated titles, resumable at any time.
Installation
Install Cipher using any of the methods below. All methods install the same package and create cipher and cip commands in your PATH.
pip (recommended)
pip install cipher-agent --upgrade
Requires Python 3.9 or later. The --upgrade flag ensures you get the latest version if already installed.
npm
npm install -g cipher-agent
Requires Node.js 14+. The npm wrapper automatically locates and runs the Python package.
Windows (one-line installer)
# Run in PowerShell as Administrator irm https://cipher.elevenpct.com/install.ps1 | iex
Mac / Linux (one-line installer)
curl -fsSL https://cipher.elevenpct.com/install.sh | bash
Install from source
git clone https://github.com/elevenpercent/cipher cd cipher pip install -e .
The -e flag installs in editable mode so local changes take effect immediately.
Quick start
After installing, navigate to your project directory and launch Cipher:
cd ~/my-project cipher # or the short alias: cip
The first time you run Cipher, it opens the setup screen where you choose a provider. Select Cipher Proxy to get started immediately with no API key.
Once inside, type any coding task and press Enter:
> build a Flask REST API with JWT authentication > add unit tests to my payment module > refactor auth.py to use async functions > what does the DatabaseManager class do?
Cipher will plan the task, use tools to execute it, and report back. You can ask follow-up questions, request changes, or start a new task.
Provider setup
The setup screen appears on first launch (or via /settings). It shows all available providers. Select one and press Enter to configure it.
Cipher Proxy Free
The easiest way to use Cipher. No API key, no account, no configuration. Cipher Proxy is a serverless proxy that routes requests to Gemini 2.0 Flash and Llama 3.3 70B models — free of charge.
Select Cipher Proxy in the setup screen and you're done. The app will show Cipher AI in the interface to reflect that you're using the managed proxy.
OpenAI API key
Provider: openai Model: gpt-4o API Key: sk-...
Anthropic API key
Provider: anthropic Model: claude-3-5-sonnet-20241022 API Key: sk-ant-...
Google Gemini API key
Provider: gemini Model: gemini-2.0-flash API Key: AIza...
Ollama Local
Provider: ollama Model: llama3.2 # Make sure Ollama is running: ollama serve
LM Studio Local
Provider: lm-studio Model: your-model-name # LM Studio must be running with the local server enabled
You can switch providers at any time using the /settings command inside Cipher. Your current session context is preserved when you switch.
Interface
Cipher's TUI is divided into two main areas:
Left sidebar
- Session list — all saved sessions for the current project, with AI-generated titles. Click or navigate to resume any session.
- Provider info — shows the active provider name and model at the bottom of the sidebar.
- New session — press Ctrl+N or select the + button to start a new session.
Main chat area
- Messages — your messages and Cipher's responses appear in a scrollable view.
- Tool output — when Cipher uses a tool (write, run, edit, etc.), the result appears as an expandable card. Click to expand and see the full content.
- Streaming — AI responses stream in real-time. You can see Cipher thinking and writing as it happens.
- Input — the text input is at the bottom. Press Enter to send, Shift+Enter for a newline.
Header
Shows the current provider/model on the right and the project path on the left. The header updates immediately when you switch providers.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Enter | Send message |
| Shift+Enter | Insert newline |
| Ctrl+N | New session |
| Ctrl+S | Open settings |
| Ctrl+C | Cancel current AI response |
| Ctrl+Q | Quit Cipher |
| ↑ / ↓ | Navigate session list (when sidebar is focused) |
| Tab | Switch focus between sidebar and chat |
| Page Up / Down | Scroll chat history |
Slash commands
Type a slash command in the input box and press Enter to execute it. Slash commands interact with Cipher directly and don't go to the AI.
| Command | Description |
|---|---|
/settings | Open the provider/model settings screen |
/new | Start a new session in the current project |
/clear | Clear the current session's messages |
/help | Show available commands |
Sessions
Every conversation with Cipher is a session. Sessions are automatically saved to ~/.cipher/sessions/ and persist between launches.
Session titles
When you start a task, Cipher automatically generates a descriptive title for the session based on the task you gave it. The title comes from the AI's own understanding of the task — not just a truncation of your input. This makes it easy to find and resume past sessions.
Resuming a session
Navigate the session list in the left sidebar using arrow keys or by clicking. Selecting a session restores its full message history and context. You can continue any past session exactly where you left off.
Session storage
Sessions are stored as JSON files in ~/.cipher/sessions/. Each file contains the session ID, title, timestamp, and full message history. You can inspect, back up, or delete them directly.
Note: Context is automatically trimmed when conversations get very long to keep AI responses fast and accurate. The most recent messages and the initial system context are always preserved.
Providers
Cipher supports 14+ AI providers. Switch between them at any time using /settings.
| Provider | Type | Notable models | Notes |
|---|---|---|---|
| Cipher Proxy | Free | Gemini 2.0 Flash, Llama 3.3 70B, Llama 3.1 8B | No key needed. Recommended for new users. |
| OpenAI | API | GPT-4o, GPT-4o Mini, o1, o3 | OPENAI_API_KEY |
| Anthropic | API | Claude 3.5 Sonnet, Claude 3 Haiku | ANTHROPIC_API_KEY |
| Google Gemini | API | Gemini 2.0 Flash, Gemini 1.5 Pro | GEMINI_API_KEY |
| Groq | API | Llama 3.3 70B, Llama 3.1 8B, Mixtral | GROQ_API_KEY. Very fast inference. |
| DeepSeek | API | DeepSeek Chat, DeepSeek Coder | DEEPSEEK_API_KEY |
| Mistral | API | Mistral Large, Mistral Small | MISTRAL_API_KEY |
| Cohere | API | Command R+, Command R | COHERE_API_KEY |
| Together AI | API | Llama, Mixtral, Qwen, and more | TOGETHER_API_KEY |
| OpenRouter | API | 200+ models from all providers | OPENROUTER_API_KEY |
| Ollama | Local | Any pulled model | Requires ollama serve running locally. |
| LM Studio | Local | Any loaded model | Requires local server enabled in LM Studio. |
Setting an API key
You can set API keys in two ways:
- In the settings screen — Enter the key directly when selecting a provider. It's saved to
~/.cipher/config.json. - Via environment variable — Set the appropriate env var before launching (e.g.
export OPENAI_API_KEY=sk-...). Environment variables take precedence over the config file.
Configuration
Cipher stores its configuration in ~/.cipher/config.json. This file is created automatically when you configure a provider. You can edit it directly.
{
"provider": "cipher-proxy",
"model": "llama-3.3-70b",
"api_key": "",
"base_url": ""
}
| Field | Description |
|---|---|
provider | The active provider ID (e.g. openai, anthropic, cipher-proxy) |
model | The model name for the selected provider |
api_key | API key for the provider (empty string if not required) |
base_url | Custom base URL, used for Ollama, LM Studio, or custom OpenAI-compatible endpoints |
When using Cipher Proxy, both api_key and base_url are managed automatically. You don't need to set them.
CLI reference
Cipher is invoked from the terminal. Both cipher and cip point to the same binary.
cipher [directory] [-p prompt] [-h]
| Argument | Description |
|---|---|
directory | Project directory to open. Defaults to the current working directory. |
-p, --prompt | Start with an initial prompt. Useful for scripted or automated usage. |
-h, --help | Show help text and exit. |
Examples
# Open Cipher in the current directory cipher # Open a specific project cipher ~/my-project # Start with a task (skips the input box, immediately sends the prompt) cipher -p "add error handling to all API endpoints" # Short alias cip
Tools reference
The Coding AI communicates using XML-style tool tags. Each tool has a specific syntax. Understanding these tags helps you understand what Cipher is doing and how to describe tasks that use specific tools.
File tools
| Tag | Syntax | Description |
|---|---|---|
<read> | <read path="file.py"> | Read the contents of a file |
<write> | <write path="file.py">content</write> | Write (create or overwrite) a file with given content |
<edit> | <edit path="file.py"><old>...</old><new>...</new></edit> | Find and replace content within a file, without rewriting the whole file |
Search tools
| Tag | Syntax | Description |
|---|---|---|
<ls> | <ls>path/</ls> | List files in a directory |
<glob> | <glob>**/*.py</glob> | Find files matching a glob pattern |
<grep> | <grep path="." pattern="def auth"> | Search file contents using regex |
Execution tools
| Tag | Syntax | Description |
|---|---|---|
<run> | <run>pytest -v</run> | Execute a shell command (PowerShell on Windows, bash on Mac/Linux). Captures stdout and stderr. |
<git> | <git>status</git> | Run git commands in the project root |
<open> | <open>index.html</open> | Open a file, URL, or application with the system default |
Web tools
| Tag | Syntax | Description |
|---|---|---|
<web-fetch> | <web-fetch url="https://..."> | Fetch a URL and return its text content. Useful for reading documentation, APIs, etc. |
<web-search> | <web-search>query here</web-search> | Search the web and return a summary of results |
Task management
| Tag | Description |
|---|---|
<todo> | Create a multi-step task plan that Cipher tracks and checks off as it works through it |
<done> | Signal to the Chat AI that the coding task is complete |
On Windows, <run> uses PowerShell. Use semicolons (;) instead of && to chain commands. Commands like python, npm, and pip work as normal. To open a file or URL: <run>Start-Process 'file.html'</run>
Two-agent system
Cipher uses two specialized AI agents that work together on every task. Understanding how they work helps you write better prompts and understand what you see in the interface.
Phase 1 — Chat AI
When you send a message, it first goes to the Chat AI (Gemini 2.0 Flash when using Cipher Proxy). The Chat AI:
- Understands the intent of your request
- Maintains the conversation history and context
- Decides whether to answer directly or delegate to the Coding AI
- For coding tasks, emits a
<task>tag with a clear, specific instruction for the Coding AI - Can ask clarifying questions if the request is ambiguous
Phase 2 — Coding AI
If the Chat AI emitted a <task>, the Coding AI (Llama 3.3 70B when using Cipher Proxy) takes over. The Coding AI:
- Receives the specific task from the Chat AI
- Has access to the full tool suite (read, write, edit, run, search, etc.)
- Works autonomously through a loop: reads files, writes code, runs tests, checks output, fixes errors
- Emits
<done>when the task is finished, with a summary of what was done - Can request error recovery via
<fix>tags if it encounters a problem it can't resolve
Phase 3 — Summary
After the Coding AI finishes, the Chat AI receives the summary and responds to you in natural language — explaining what was done, noting any caveats, and asking if you'd like anything else.
Why two agents?
- Efficiency — The Chat AI (fast, small) handles most conversation turns. The Coding AI (powerful, large) only runs when there's actual work to do.
- Rate limit management — Using two different models means each model's rate limit is only used for its specific role, reducing rate limit errors by roughly 2/3.
- Better results — Each model is optimized for its task. The Chat AI is tuned for reasoning and conversation; the Coding AI is tuned for code generation and tool use.
- Clear separation — The conversation layer stays clean while the execution layer gets as deep as it needs to.
Smart model routing (Cipher Proxy)
When using Cipher Proxy, model selection is automatic:
| Phase | Model | Why |
|---|---|---|
| Phase 1 (Chat) | Gemini 2.0 Flash | 60 RPM rate limit, fast, context-efficient for conversation |
| Phase 2 (Coding) | Llama 3.3 70B | 30 RPM rate limit, powerful, best for code generation and tool use |
| Phase 3 (Summary) | Gemini 2.0 Flash | Same as Phase 1 — keeps Groq usage only for actual coding work |
Cipher Proxy
Cipher Proxy is a free, serverless proxy hosted on Vercel that gives you access to powerful AI models without needing your own API keys.
What it provides
- Gemini 2.0 Flash — Google's fast, capable model (via Google AI). 60 requests/minute on the free tier.
- Llama 3.3 70B — Meta's best open model, hosted on Groq's ultra-fast inference. 30 requests/minute on the free tier.
- Llama 3.1 8B — A smaller, faster Llama model for lightweight tasks. 30 requests/minute on the free tier.
Rate limits
Cipher Proxy uses the free tiers of Google AI and Groq. Rate limits are shared across all Cipher Proxy users. When a rate limit is hit, Cipher automatically retries with exponential backoff (5s → 15s → 30s). You'll see a "Rate limited, retrying..." message when this happens.
If you're doing heavy, continuous use, consider providing your own API keys for Groq or Gemini to get dedicated rate limits.
Privacy
Messages sent through Cipher Proxy pass through the Vercel serverless function to the respective AI provider. The proxy does not log or store messages. For sensitive codebases, use your own API keys or a local model via Ollama or LM Studio.
Troubleshooting
Cipher command not found
After installing with pip, the cipher command should be in your PATH. If not:
- On Mac/Linux: Add
~/.local/binto your PATH:export PATH="$HOME/.local/bin:$PATH" - On Windows: Check
%APPDATA%\Python\Python3xx\Scriptsis in your PATH, or use the PowerShell installer which handles this automatically.
Rate limit errors
You'll see this when the AI provider's free tier is temporarily exhausted. Cipher will retry automatically. If it persists:
- Wait a minute and try again
- Use
/settingsto switch to a different provider - Get your own API key for Groq (free tier at console.groq.com) or Gemini (free tier at aistudio.google.com)
Commands not running on Windows
Cipher uses PowerShell for all <run> commands on Windows. If a command fails:
- Cipher automatically converts
&&to;for command chaining - To open files: tell Cipher to use
Start-Process 'filename' - Most common commands (python, pip, npm, node, git) work exactly the same in PowerShell
Ollama / LM Studio connection failed
- For Ollama: make sure the daemon is running (
ollama serve) and the model is pulled (ollama pull llama3.2) - For LM Studio: enable the local server in LM Studio's settings and ensure the model is loaded
- The default base URL for Ollama is
http://localhost:11434and LM Studio ishttp://localhost:1234
Slow responses
Response speed depends on the model and provider:
- Groq and Gemini Flash are the fastest options in Cipher Proxy
- Large local models (via Ollama/LM Studio) depend on your hardware
- If using your own API key and still slow, try a smaller/faster model variant
Uninstall
Cipher stores session data in ~/.cipher/. Remove this folder along with the package to fully uninstall.
Via pip
pip uninstall cipher-agent
Via npm
npm uninstall -g cipher-agent
Remove session data
# Mac / Linux rm -rf ~/.cipher # Windows PowerShell Remove-Item -Recurse -Force $HOME\.cipher