Beautiful CLI for OpenRouter API with full features - Vim-style chat, split view editor, terminal, and more
npm install deno-openrouter-cli
A powerful terminal-based AI chat application with Vim-style keybindings
Chat with 100+ free AI models • Split view editor • Embedded terminal • Multi-key rotation
j/k, i, ESC, G/g |
Ctrl+O |
Ctrl+S |
Alt+T |
Ctrl+F |
s |
y |
bash
npm install -g deno-openrouter-cli
`
$3
`bash
git clone https://github.com/denoplayground/deno-openrouter-cli.git
cd deno-openrouter-cli
npm install
npm run build
npm link
`
$3
`bash
Install Node.js in Termux
pkg update && pkg install nodejs
Install the CLI
npm install -g deno-openrouter-cli
Run with Termux mode (keeps keyboard open)
openrouter chat --termux
or
or chat -t
`
Note: Use --termux or -t flag to enable mobile-friendly mode that keeps the virtual keyboard open.
---
🚀 Quick Start
`bash
Start the main chat interface
openrouter chat
Or use the short alias
or chat
`
On first run, you'll be prompted to add your API key(s).
---
📋 Commands
| Command | Description |
|---------|-------------|
| or chat | Start Vim-style chat interface |
| or split | Split view: chat + code editor |
| or edit -f | Open file in terminal editor |
| or models | List available AI models |
| or config show | View current configuration |
| or config set-key | Set API key |
| or config set-model | Set default model |
---
⌨️ Keyboard Shortcuts
$3
| Key | Action |
|-----|--------|
| i | Enter insert mode (type message) |
| j / ↓ | Scroll down |
| k / ↑ | Scroll up |
| G | Jump to bottom |
| g | Jump to top |
| Tab | Toggle shortcuts panel |
$3
| Key | Action |
|-----|--------|
| Enter | Send message |
| ESC | Exit to normal mode |
$3
| Key | Action |
|-----|--------|
| m | Select AI model |
| n | New conversation |
| c | Conversation list |
| t | Rename conversation |
| p | Pin/unpin conversation |
| x | Clear chat |
| d | Delete conversation |
$3
| Key | Action |
|-----|--------|
| Ctrl+F | Attach file to message |
| Ctrl+O | Open file browser |
| e | Open code editor |
| Ctrl+S | Open split view |
$3
| Key | Action |
|-----|--------|
| y | Copy last AI response |
| / | Search in chat |
| s | Set system prompt |
| S-h | Toggle history context |
| Alt+T | Open embedded terminal |
| Ctrl+T | Change theme |
| Ctrl+B | Back to main chat |
| q | Quit |
---
🔐 API Key Setup
$3
On first run, you'll see the key management screen:
`
┌─ API Key Management ──────────────────────────────┐
│ API Keys configured: 3 │
│ │
│ Get your free key at: https://openrouter.ai/keys │
│ │
│ Current Keys: │
│ 1. sk-or-v1-abc12...xyz89 │
│ 2. sk-or-v1-def34...uvw67 │
│ │
│ Commands: │
│ a - Add key(s), comma separated │
│ v - Validate all keys (parallel) │
│ d - Delete last key │
│ Enter - Continue │
└───────────────────────────────────────────────────┘
`
$3
1. Go to https://openrouter.ai/keys
2. Sign up or login
3. Create a new key
4. Copy and paste into the CLI
$3
You can add multiple keys for:
- Load balancing: Distribute requests across keys
- Rate limit bypass: Switch keys when one is rate limited
- Backup: Fallback if a key expires
---
🎨 Modes
$3
Full-screen Vim-style chat interface with:
- Scrollable chat history
- Shortcuts sidebar
- Status bar showing mode and model
$3
Two-panel layout:
- Left: Chat interface
- Right: Code editor with syntax highlighting
$3
Terminal-based code editor with:
- Vim keybindings
- Line numbers
- Save/load files
---
⚙️ Configuration
$3
Create a .env file in your project:
`env
OPENROUTER_API_KEYS=key1,key2,key3
`
$3
Configuration is stored automatically. View with:
`bash
or config show
`
$3
| Setting | Description |
|---------|-------------|
| apiKey | Primary API key |
| defaultModel | Default AI model ID |
| theme | Color theme (dark/light/cyberpunk/matrix) |
| defaultSystemPrompt | Default personality for AI |
---
💡 Tips & Tricks
$3
Press m in normal mode to quickly switch between models.
$3
Use Ctrl+F to attach code files, then ask AI to review/explain.
$3
Use embedded terminal (Alt+T) to run commands without leaving chat.
$3
Press o to fork a conversation and try different approaches.
$3
Press s to set custom personality:
- "You are a Python expert"
- "Explain like I'm 5"
- "Be concise and use code examples"
---
🤝 Contributing
Contributions are welcome!
1. Fork the repository
2. Create your feature branch (git checkout -b feature/amazing)
3. Commit your changes (git commit -m 'Add amazing feature')
4. Push to the branch (git push origin feature/amazing`)
Made with ❤️ for terminal enthusiasts