An open-source AI agent that brings the power of DeepSeek directly into your terminal.
Features • Quick Start • Installation • Usage • Examples • Documentation
- Interactive Chat: Real-time conversations with DeepSeek V3 and R1 models
- Code Analysis: Intelligent codebase analysis with AI-powered insights
- Workflow Automation: Execute complex AI-driven workflows and tasks
- Multi-Model Support: Switch between DeepSeek V3, R1, and 32K variants
- Language Detection: Support for 30+ programming languages
- Complexity Metrics: Cyclomatic complexity analysis and recommendations
- Code Quality: Automated issue detection and best practice suggestions
- Architecture Insights: AI-powered codebase structure analysis
- Task Parsing: Natural language task description to executable workflows
- Multi-Step Execution: Complex multi-step AI workflows
- Interactive Mode: Real-time workflow interaction and modification
- Output Formats: JSON, Markdown, and text output support
- Theme Support: Light, dark, and auto themes with terminal detection
- Configuration Management: Flexible configuration with environment variables
- File Operations: Built-in file management and context loading
- Error Handling: Comprehensive error handling and recovery
- Streaming Responses: Real-time response streaming for better UX
- Connection Management: Robust API connection handling
- Caching: Intelligent response caching and optimization
- Logging: Comprehensive logging with configurable levels
- Node.js: Version 18 or higher
- Package Manager: npm or yarn
- DeepSeek API Key: Get your API key from DeepSeek Platform
# Clone and run quick start
git clone https://github.com/fenwii/deepseek-cli.git
cd deepseek-cli
./quickstart.sh
git clone https://github.com/fenwii/deepseek-cli.git
cd deepseek-cli
./install.sh
git clone https://github.com/fenwii/deepseek-cli.git
cd deepseek-cli
yarn install
yarn build
yarn link
git clone https://github.com/fenwii/deepseek-cli.git
cd deepseek-cli
yarn install
yarn dev
Set your DeepSeek API key:
deepseek config --set apiKey=YOUR_API_KEY
Start an interactive chat session:
deepseek chat
With custom system prompt:
deepseek chat --system "You are a Python expert specializing in data science"
With context file:
deepseek chat --file context.txt --system "Analyze this codebase"
Analyze your entire codebase:
deepseek analyze . --recursive
Focus on specific languages:
deepseek analyze src/ --extensions ts,js,py --recursive
Generate documentation:
deepseek workflow "Create comprehensive documentation for this project"
Security review:
deepseek workflow "Review this codebase for security vulnerabilities" --interactive
# Set configuration
deepseek config --set defaultModel=v3
deepseek config --set theme=dark
deepseek config --set maxTokens=8000
# View configuration
deepseek config --list
# Get specific value
deepseek config --get apiKey
# Comprehensive codebase analysis
deepseek analyze . --recursive
# Focus on TypeScript files
deepseek analyze src/ --extensions ts --recursive
# Generate detailed report
deepseek workflow "Analyze code quality and generate improvement recommendations"
# Generate README
deepseek workflow "Create a professional README.md for this project"
# Generate API documentation
deepseek workflow "Generate API documentation for all TypeScript interfaces"
# Create user guides
deepseek workflow "Create user documentation and installation guides"
# Migrate JavaScript to TypeScript
deepseek workflow "Help migrate this JavaScript codebase to TypeScript"
# Refactor complex code
deepseek workflow "Refactor high-complexity functions for better maintainability"
# Update dependencies
deepseek workflow "Analyze package.json and suggest dependency updates"
# Generate test suites
deepseek workflow "Create comprehensive unit tests for all functions"
# Code coverage analysis
deepseek workflow "Analyze test coverage and suggest improvements"
# Performance optimization
deepseek workflow "Identify performance bottlenecks and suggest optimizations"
Variable | Description | Default |
---|---|---|
DEEPSEEK_API_KEY |
Your DeepSeek API key | - |
DEEPSEEK_MODEL |
Default model (v3, r1, v3-32k, r1-32k) | v3 |
DEEPSEEK_THEME |
Color theme (light, dark, auto) | auto |
DEEPSEEK_MAX_TOKENS |
Maximum tokens per request | 4000 |
DEEPSEEK_TEMPERATURE |
Response temperature (0-2) | 0.7 |
DEEPSEEK_TIMEOUT |
Request timeout in milliseconds | 60000 |
Located at ~/.deepseek-cli/config.json
:
{
"apiKey": "your-api-key",
"defaultModel": "v3",
"theme": "auto",
"enableLogging": false,
"maxTokens": 4000,
"temperature": 0.7,
"timeout": 60000,
"autoSave": true,
"workspace": "./",
"customPrompts": {
"code_review": "You are an expert code reviewer...",
"documentation": "You are a technical writer...",
"testing": "You are a testing expert..."
}
}
- Best for: Most general tasks, code analysis, documentation
- Performance: Balanced speed and quality
- Context: 4K tokens
- Use cases: Code review, documentation, general assistance
- Best for: Quick tasks, simple queries
- Performance: Fastest response times
- Context: 4K tokens
- Use cases: Quick questions, simple code analysis
- Best for: Large codebases, complex analysis
- Performance: Slower but more comprehensive
- Context: 32K tokens
- Use cases: Large file analysis, complex workflows
src/
├── api/ # DeepSeek API client and models
├── cli/ # Main CLI logic and commands
├── config/ # Configuration management
├── analysis/ # Code analysis tools
├── workflow/ # Workflow automation engine
├── ui/ # UI and theming system
└── utils/ # Utility functions and helpers
# Install dependencies
yarn install
# Build the project
yarn build
# Run in development mode
yarn dev
# Run tests
yarn test
# Lint code
yarn lint
# Format code
yarn format
Script | Description |
---|---|
yarn build |
Build the project for production |
yarn dev |
Run in development mode |
yarn test |
Run test suite |
yarn lint |
Lint TypeScript code |
yarn format |
Format code with Prettier |
yarn clean |
Clean build artifacts |
yarn link |
Create local development link |
yarn demo |
Run demonstration script |
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and add tests
- Run tests:
yarn test
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow TypeScript best practices
- Use ESLint and Prettier for code formatting
- Write comprehensive tests for new features
- Update documentation for API changes
API Key Issues:
# Verify API key is set
deepseek config --get apiKey
# Set API key
deepseek config --set apiKey=YOUR_API_KEY
# Test connection
deepseek test
Permission Issues:
# Fix global installation permissions
sudo yarn global add .
# Or use local installation
yarn link
Build Issues:
# Clean and rebuild
yarn clean
yarn install
yarn build
- 📖 Usage Guide - Detailed usage documentation
- 🐛 Issues - Report bugs and request features
- 💬 Discussions - Ask questions and share ideas
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- DeepSeek AI for providing the powerful AI models
- Commander.js for the excellent CLI framework
- Chalk for beautiful terminal styling
- Inquirer.js for interactive prompts
- All contributors who help improve this project
Made with ❤️ by the DeepSeek CLI Team
Author: samir.tan.it@gmail.com
Created: 2025-06-28
Last Updated: 2025-06-28