A powerful command-line interface for interacting with DeepSeek v3.2 AI models.
- Chat Completions: Send individual messages or have conversations
- Interactive Mode: Chat continuously with conversation history
- Multiple Models: Support for both
deepseek-chatanddeepseek-reasoner - Thinking Mode: Enable reasoning mode for complex tasks
- Streaming: Real-time streaming responses
- Configurable: Easy API key setup and configuration
- Token Tracking: Monitor token usage
- Python 3.7+
- pip
-
Install dependencies:
pip install -r requirements.txt
-
Make the CLI executable (optional):
chmod +x deepseek-cli.py
-
Get your API key:
- Visit DeepSeek Platform
- Create an API key
export DEEPSEEK_API_KEY="your-api-key-here"./deepseek-cli.py config --api-key your-api-key-here# Simple chat with default model
./deepseek-cli.py chat "Hello, how are you?"
# Chat with specific model
./deepseek-cli.py chat --model deepseek-reasoner "Explain quantum physics"
# With system message
./deepseek-cli.py chat --system "You are a helpful assistant" "What is 2+2?"
# Streaming response
./deepseek-cli.py chat --stream "Tell me a story"
# Thinking mode
./deepseek-cli.py chat --thinking-mode "Solve this complex problem"# Start interactive chat
./deepseek-cli.py interactive
# With specific model
./deepseek-cli.py interactive --model deepseek-reasonerInteractive Commands:
help- Show helpclear- Clear conversation historyexitorquit- Exit interactive mode
./deepseek-cli.py models./deepseek-cli.py balanceSend a single chat message.
Options:
--model, -m: Model to use (deepseek-chatordeepseek-reasoner)--system, -s: System message for context--temperature, -t: Sampling temperature (0.0-2.0, default: 0.7)--max-tokens, -M: Maximum tokens to generate--stream: Enable streaming response--thinking-mode: Enable thinking mode (uses deepseek-reasoner)
Start an interactive chat session with conversation history.
Options:
--model, -m: Default model to use--temperature, -t: Default temperature
List all available DeepSeek models.
Check account balance and usage information.
Configure API key and settings.
Options:
--api-key: Your DeepSeek API key--base-url: API base URL (default: https://api.deepseek.com)
Show version information.
$ ./deepseek-cli.py chat "What is machine learning?"
============================================================
Model: deepseek-chat
Created: 2025-12-03 10:30:00
============================================================
Machine learning is a subset of artificial intelligence...$ ./deepseek-cli.py chat --system "You are a Python expert" "How do I reverse a list?"
# DeepSeek will respond with Python-specific guidance$ ./deepseek-cli.py chat --thinking-mode "Analyze the pros and cons of microservices architecture"
# Uses deepseek-reasoner for deeper analysis$ ./deepseek-cli.py interactive
You: What is Python?
DeepSeek: Python is a high-level, interpreted programming language...
You: Tell me more about its features
DeepSeek: Python has several key features...
[Tokens: 1250]- Non-thinking mode of DeepSeek-V3.2
- Fast responses
- Best for general conversations and tasks
- Default model
- Thinking mode of DeepSeek-V3.2
- Uses reasoning for complex problems
- Best for complex analysis and problem-solving
- Enable with
--thinking-modeflag
DEEPSEEK_API_KEY: Your API key (alternative to config file)
The CLI saves configuration to ~/.deepseek_config.json:
{
"api_key": "your-api-key-here",
"base_url": "https://api.deepseek.com"
}- Set
DEEPSEEK_API_KEYenvironment variable, or - Run
./deepseek-cli.py config --api-key YOUR_KEY
- Run:
pip install -r requirements.txt
- Check your internet connection
- Verify API key is correct
- Ensure you have access to DeepSeek API
MIT
- DeepSeek API Documentation: https://api-docs.deepseek.com/
- DeepSeek Platform: https://platform.deepseek.com/
- Email: api-service@deepseek.com