A tiny command-line interface chat application that brings AI conversations to your terminal.
Check out y-gui for a web-based version of dq-cli.
- 📝 Flexible storage options:
- Local JSONL files for easy access and sync
- Cloudflare D1 for cloud storage
- 💬 Interactive chat interface with tool execution visualization
- 🤖 Support for multiple bot configurations (any base_url/api_key/model combination). Supported api format type:
- 🤔 Support for reasoning model
- Deepseek-r1 reasoning_content output print
- OpenAI o3-mini reasoning_effort configuration
- 🔗 MCP (Model Context Protocol) integration:
- Client support with multiple transport types:
- Streamable HTTP (modern, recommended - MCP 2025-03-26 spec)
- stdio (traditional subprocess-based)
- Legacy SSE (deprecated, for compatibility)
- Automatic transport detection with caching
- Session management and resumable connections
- Persistent daemon
- Custom prompt configurations
- Client support with multiple transport types:
- 🧐 Simple "Deep Research" mode by prompt configuration
➜ ~ dq-cli bot list
Name API Key API Type Base URL Model Print Speed Description OpenRouter Config MCP Servers Reasoning Effort
----------- ----------- ---------- ----------------------------------- ----------------------------------- ------------- ------------- ------------------- ------------- ------------------
default sk-or-v1... N/A https://gateway.ai.cloudflare.co... google/gemini-2.0-flash-001 None N/A Yes No N/A
claude sk-or-v1... N/A https://gateway.ai.cloudflare.co... anthropic/claude-3.7-sonnet:beta None N/A Yes todo N/A
o3-mini sk-or-v1... N/A https://gateway.ai.cloudflare.co... openai/o3-mini None N/A Yes No low
ds-chat sk-or-v1... N/A https://gateway.ai.cloudflare.co... deepseek/deepseek-chat-v3-0324:free None N/A Yes tavily N/A
dify-bot app-2drF... dify https://api.dify.ai/v1 None N/A No No N/A
Supports modern Streamable HTTP transport alongside traditional stdio and legacy SSE:
➜ ~ dq-cli mcp list
Name Type Command/URL Arguments/Token Environment Auto-Confirm
---------------- ---------------- ------------------- ----------------- -------------- --------------
anthropic-mcp streamable-http https://api.anth... sk-ant-xxxxx safe_tools...
brave-search legacy-sse https://router.m... brave_web_s...
todo stdio uvx mcp-todo
exa-mcp-server stdio npx exa-mcp-server EXA_API_KEY...
Add Streamable HTTP server (auto-detects transport):
dq-cli mcp add my-server --url https://api.example.com/mcp --token your-tokenWith custom headers and timeout:
dq-cli mcp add my-server \
--url https://api.example.com/mcp \
--token your-token \
--transport streamable-http \
--timeout 60 \
--header "X-API-Key: key123"See MCP Streamable HTTP Guide for detailed documentation.
Required:
- uv
- OpenRouter API key
Setup Instructions:
-
uv
- Follow the official installation guide
- uv will automatically manage Python installation
-
OpenRouter API key
- Visit OpenRouter Settings
- Create a new API key
- Save it for the initialization step
uvx dq-cliuv tool install dq-clidq-cli initdq-cli chatAdd OpenAI-compatible providers to your config.toml:
[[providers]]
name = "openai"
base_url = "https://api.openai.com/v1"
api_key = "sk-..."
models = ["gpt-4", "gpt-4-turbo", "gpt-3.5-turbo"]
[[providers]]
name = "deepseek"
base_url = "https://api.deepseek.com"
api_key = "sk-..."
models = ["deepseek-chat", "deepseek-coder"]Switch models during chat:
/model- List all available models/model gpt-4- Switch to a different model/model deepseek/deepseek-chat- Switch provider and model
dq-cli [OPTIONS] COMMAND [ARGS]...chatStart a new chat conversation or continue an existing onelistList chat conversations with optional filteringshareShare a chat conversation by generating a shareable linkimportImport chats from an external file (useful for storage migration)botManage bot configurations:addAdd a new bot configurationlistList all configured botsdeleteDelete a bot configuration
mcpManage MCP server configurations:addAdd a new MCP server (supports stdio, SSE, and Streamable HTTP)- Options:
--url,--token,--transport,--timeout,--header
- Options:
listList all configured MCP servers with transport typesdeleteDelete an MCP server configuration
daemonManage the MCP daemon:startStart the MCP daemonstopStop the MCP daemonstatusCheck daemon statuslogView daemon logsrestartRestart the daemon
promptManage prompt configurations:addAdd a new prompt configurationlistList all configured promptsdeleteDelete a prompt configuration
--helpShow help message and exit
dq-cli supports the modern MCP Streamable HTTP transport (MCP spec 2025-03-26):
- ✅ True bidirectional communication - Servers can initiate requests
- ✅ Session management - Persistent sessions with automatic reconnection
- ✅ Resumable connections - Recover from network failures
- ✅ Better security - Origin validation, enhanced authentication
- ✅ Automatic transport detection - Tries Streamable HTTP first, falls back to legacy SSE
Quick Start:
# Add a Streamable HTTP server (auto-detects transport)
dq-cli mcp add my-server --url https://api.example.com/mcp --token sk-xxxxx
# Start daemon (establishes connections)
dq-cli daemon start
# Use in chat
dq-cli chat -b claude # If claude bot has MCP servers configuredDocumentation:
- MCP Streamable HTTP Guide - Complete user guide
- Configuration Examples - Real-world examples
- Troubleshooting - Common issues and solutions
Additional Resources:
- deepwiki page - Comprehensive project documentation
- MCP Specification - Official MCP documentation

