@xiami_master/chatcli
v0.1.3
Published
Terminal AI Chat Client with beautiful UI
Downloads
501
Maintainers
Readme
ChatCLI
A beautiful terminal AI chat client built with Node.js + Ink (React for CLI).
Supports any OpenAI-compatible API — OpenAI, Claude, DeepSeek, Ollama, and more.

Features
- 💬 Multi-session chat management — organize conversations
- 🤖 OpenAI-compatible API — works with any provider (OpenAI, Anthropic, DeepSeek, Ollama, etc.)
- 📝 Markdown rendering with syntax highlighting
- 🔍 Full-text history search across all sessions
- 📋 System prompt presets — save and switch between prompt templates
- ⚙️ Multiple model configurations — manage models with a built-in wizard
- 💾 SQLite local storage — all data stays on your machine
- 🔐 Encrypted API key storage (AES-256-CBC)
- 📤 Export chat history to Markdown files
- 🗑️ Session management — rename, clear, delete sessions
Install
npm install -g @xiami_master/chatcliQuick Start
# Launch ChatCLI
chatcli
# Configure your first model via the interactive wizard
/config model
# Start chatting!Commands
Type / followed by a command:
| Command | Alias | Description |
|---------|-------|-------------|
| /new | /n | Create new chat session |
| /sessions | /s, /history | Show chat history |
| /models | /m | Show model list |
| /presets | /p | Show preset list |
| /config | /c | Configure new model or preset |
| /search | | Full-text search across history |
| /use | | Switch active model or preset |
| /rename | /r | Rename current session |
| /clear | | Clear current session messages |
| /export | | Export current session to Markdown |
| /delete | /d, /del | Delete current session |
| /help | /h, /? | Show available commands |
| /quit | /q, /exit | Exit application |
Keyboard Shortcuts
| Key | Action |
|-----|--------|
| Enter | Send message / Execute command |
| Tab | Toggle sidebar focus |
| Escape | Close sidebar / Cancel edit |
| Ctrl+C | Stop streaming / Exit |
| Ctrl+D | Immediate exit |
| Ctrl+L | New chat session |
| ↑/↓ | Input history navigation |
Configuration
Default database: ~/.chatcli/data.db
Adding a New Model
# Interactive wizard
/config modelThe wizard guides you through: Name → Endpoint → API Key → Model ID
Common API Endpoints
| Provider | Endpoint |
|----------|----------|
| OpenAI | https://api.openai.com/v1 |
| Anthropic | https://api.anthropic.com |
| OpenRouter | https://openrouter.ai/api/v1 |
| DeepSeek | https://api.deepseek.com |
| Local (Ollama) | http://localhost:11434/v1 |
Presets
# Add a system prompt preset
/config preset
# List and switch presets
/presetsSecurity
API keys are encrypted with AES-256-CBC before storage:
- Encryption key stored in
~/.chatcli/.encryption_key(auto-generated,chmod 600) - Database directory restricted (
chmod 700) - Keys decrypted only for API calls
- Existing plaintext keys auto-encrypted on first run
Tech Stack
- Ink — React for CLI
- better-sqlite3 — SQLite storage
- marked-terminal — Markdown rendering
- chalk — Terminal colors
- Node.js crypto — AES-256-CBC encryption
Contributing
See CONTRIBUTING.md for guidelines.
