A personal AI assistant for the terminal. Talks to 200+ models through OpenRouter, reads and writes files directly, tracks git context, and keeps conversation history — all from the command line.
- Chat with any LLM model available on OpenRouter directly from your terminal
- Ask it to create or modify files — it writes them automatically using a
WRITE_FILE:pattern it detects in responses - Git-aware: reads your current repo context and includes it in conversations
- Persistent history stored at
~/.deonai/ - Multiple profiles for different configurations and system prompts
- Python 3.10+
- requests (HTTP to OpenRouter)
- colorama + pygments (terminal UI)
- No framework — pure CLI
Linux/macOS
git clone https://github.com/4shil/deonai-cli.git
cd deonai-cli
chmod +x install.sh
./install.shWindows
install-windows.batThe installer sets up a virtual environment, installs dependencies, and adds deonai to your PATH.
On first run, set your OpenRouter API key:
deonai config set api_key YOUR_OPENROUTER_KEYGet a free key at openrouter.ai.
# Start a conversation
deonai chat
# Ask a one-off question
deonai ask "how do I reverse a list in Python"
# List available models
deonai models
# Switch model
deonai config set model anthropic/claude-3-haiku
# View history
deonai history
# Run tests
pytestAsk it to write files during a conversation:
You: create a FastAPI hello world app in main.py
DeonAi: WRITE_FILE: main.py
```python
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def root():
return {"message": "Hello, World!"}
```
The CLI detects the WRITE_FILE: pattern and saves the file automatically.
deonai-cli/
├── deonai/
│ ├── cli/
│ │ └── commands.py # CLI entry points
│ ├── core/
│ │ ├── agent.py # Conversation loop + model calls
│ │ ├── base.py # Base classes
│ │ ├── config.py # Config management (~/.deonai/)
│ │ ├── context.py # Project context gathering
│ │ ├── tools.py # Tool definitions
│ │ ├── patch_tools.py # File write/patch tools
│ │ ├── builtin_tools.py # Built-in tool implementations
│ │ ├── git_tools.py # Git integration
│ │ └── logger.py
│ ├── integrations/
│ │ └── git.py # Git repo context
│ ├── utils/
│ │ ├── colors.py # Terminal colors
│ │ ├── animations.py # Typing indicators
│ │ ├── diff.py # File diff display
│ │ └── fileops.py # File read/write helpers
│ └── plugins/ # Plugin system (extensible)
├── tests/
├── install.sh
├── install-windows.bat
├── uninstall.sh
└── requirements.txt
Config is stored at ~/.deonai/config.json. Keys:
{
"api_key": "your-openrouter-key",
"model": "openai/gpt-4o",
"system_prompt": "optional custom instructions"
}History lives at ~/.deonai/history.json. Profiles at ~/.deonai/profiles.json.
./uninstall.shMIT
