deepcode-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeepCode CLI
DeepCode CLI
Skill by ara.so — Devtools Skills collection.
DeepCode CLI is a terminal AI coding assistant specifically optimized for DeepSeek v4 models. It supports deep thinking mode, reasoning effort control, extensible Agent Skills, and Model Context Protocol (MCP) integration for connecting external services.
由ara.so开发的Skill——Devtools Skills合集。
DeepCode CLI是一款专为DeepSeek v4模型优化的终端AI编码助手。它支持深度思考模式、推理力度控制、可扩展的Agent Skills,以及用于连接外部服务的Model Context Protocol(MCP)集成。
Installation
安装
bash
npm install -g @vegamo/deepcode-cliRun in any project directory to start the assistant.
deepcodebash
npm install -g @vegamo/deepcode-cli在任意项目目录中运行即可启动助手。
deepcodeConfiguration
配置
Create :
~/.deepcode/settings.jsonjson
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-..."
},
"thinkingEnabled": true,
"reasoningEffort": "max"
}创建:
~/.deepcode/settings.jsonjson
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-..."
},
"thinkingEnabled": true,
"reasoningEffort": "max"
}Configuration Priority
配置优先级
DeepCode follows a multi-level configuration priority system:
- Project-level (highest):
./.deepcode/settings.json - User-level:
~/.deepcode/settings.json - Environment variables: ,
DEEPCODE_MODEL,DEEPCODE_BASE_URLDEEPCODE_API_KEY - Default values (lowest)
DeepCode遵循多级配置优先级体系:
- 项目级(最高):
./.deepcode/settings.json - 用户级:
~/.deepcode/settings.json - 环境变量:,
DEEPCODE_MODEL,DEEPCODE_BASE_URLDEEPCODE_API_KEY - 默认值(最低)
Core Configuration Options
核心配置选项
json
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-..."
},
"thinkingEnabled": true,
"reasoningEffort": "max",
"temperature": 0.7,
"maxTokens": 8192,
"notify": "/path/to/notification-script.sh",
"webSearchTool": "/path/to/web-search-script.sh",
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}json
{
"env": {
"MODEL": "deepseek-v4-pro",
"BASE_URL": "https://api.deepseek.com",
"API_KEY": "sk-..."
},
"thinkingEnabled": true,
"reasoningEffort": "max",
"temperature": 0.7,
"maxTokens": 8192,
"notify": "/path/to/notification-script.sh",
"webSearchTool": "/path/to/web-search-script.sh",
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}Model Options
模型选项
- (recommended for complex tasks)
deepseek-v4-pro - (faster, lower cost)
deepseek-v4-flash - Any OpenAI-compatible model
- (推荐用于复杂任务)
deepseek-v4-pro - (速度更快、成本更低)
deepseek-v4-flash - 任何兼容OpenAI的模型
Reasoning Effort Levels
推理力度等级
- - Fast, basic reasoning
"min" - - Balanced (default)
"medium" - - Deep thinking, slower but more thorough
"max"
- - 快速、基础推理
"min" - - 平衡(默认)
"medium" - - 深度思考,速度较慢但更全面
"max"
Key Commands
关键命令
Slash Commands
斜杠命令
| Command | Description |
|---|---|
| Open skills/command menu |
| Start new conversation |
| Resume a previous conversation |
| Switch model, thinking mode, and reasoning effort |
| Initialize AGENTS.md file |
| List available skills |
| View MCP server status and available tools |
| Exit (or press Ctrl+D twice) |
| 命令 | 描述 |
|---|---|
| 打开技能/命令菜单 |
| 开启新对话 |
| 恢复之前的对话 |
| 切换模型、思考模式和推理力度 |
| 初始化AGENTS.md文件 |
| 列出可用技能 |
| 查看MCP服务器状态和可用工具 |
| 退出(或按两次Ctrl+D) |
Keyboard Shortcuts
键盘快捷键
| Key | Action |
|---|---|
| Send message |
| Insert newline |
| Paste image from clipboard |
| Interrupt current model response |
| Exit |
| 按键 | 操作 |
|---|---|
| 发送消息 |
| 插入换行 |
| 粘贴剪贴板中的图片 |
| 中断当前模型响应 |
| 退出 |
Agent Skills
Agent Skills
DeepCode CLI supports extensible skills to enhance the assistant's capabilities.
DeepCode CLI支持可扩展技能,以增强助手的能力。
User-level Skills
用户级技能
Place skills in . These are available across all projects.
~/.agents/skills/将技能放置在目录下,这些技能可在所有项目中使用。
~/.agents/skills/Project-level Skills
项目级技能
Place skills in or for project-specific capabilities.
./.agents/skills/./.deepcode/skills/将技能放置在或目录下,用于项目专属功能。
./.agents/skills/./.deepcode/skills/Creating a Custom Skill
创建自定义技能
Create a file in the skills directory:
SKILL.mdmarkdown
---
name: my-custom-skill
description: Description of what this skill does
triggers:
- when to use this skill
- another trigger phrase
---在技能目录中创建文件:
SKILL.mdmarkdown
---
name: my-custom-skill
description: Description of what this skill does
triggers:
- when to use this skill
- another trigger phrase
---My Custom Skill
My Custom Skill
Detailed instructions for the AI assistant on how to use this skill...
Detailed instructions for the AI assistant on how to use this skill...
Usage Example
Usage Example
```typescript
// Example code showing how to use this skill
```
undefined```typescript
// Example code showing how to use this skill
```
undefinedExample: Database Migration Skill
示例:数据库迁移技能
./.agents/skills/migrations/SKILL.mdmarkdown
---
name: database-migrations
description: Manage database schema migrations using Prisma
triggers:
- create database migration
- run migrations
- rollback migration
- check migration status
---./.agents/skills/migrations/SKILL.mdmarkdown
---
name: database-migrations
description: Manage database schema migrations using Prisma
triggers:
- create database migration
- run migrations
- rollback migration
- check migration status
---Database Migrations
Database Migrations
This skill helps manage database schema changes using Prisma.
This skill helps manage database schema changes using Prisma.
Create a Migration
Create a Migration
```bash
npx prisma migrate dev --name descriptive_migration_name
```
```bash
npx prisma migrate dev --name descriptive_migration_name
```
Apply Migrations in Production
Apply Migrations in Production
```bash
npx prisma migrate deploy
```
```bash
npx prisma migrate deploy
```
Check Migration Status
Check Migration Status
```bash
npx prisma migrate status
```
```bash
npx prisma migrate status
```
Rollback (Manual)
Rollback (Manual)
Edit migration files in and create a new migration to undo changes.
prisma/migrations/undefinedEdit migration files in and create a new migration to undo changes.
prisma/migrations/undefinedMCP Integration
MCP集成
DeepCode supports Model Context Protocol for connecting external services.
DeepCode支持Model Context Protocol,用于连接外部服务。
Configuring MCP Servers
配置MCP服务器
In :
~/.deepcode/settings.jsonjson
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "${DATABASE_URL}"
}
}
}
}在中:
~/.deepcode/settings.jsonjson
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"POSTGRES_CONNECTION_STRING": "${DATABASE_URL}"
}
}
}
}View MCP Status
查看MCP状态
Use command in DeepCode to see:
/mcp- Connected MCP servers
- Available tools from each server
- Connection status
在DeepCode中使用命令查看:
/mcp- 已连接的MCP服务器
- 每个服务器提供的可用工具
- 连接状态
Common MCP Servers
常见MCP服务器
- GitHub: - Repository management, issues, PRs
@modelcontextprotocol/server-github - Filesystem: - File operations
@modelcontextprotocol/server-filesystem - PostgreSQL: - Database queries
@modelcontextprotocol/server-postgres - Browser: - Web automation
@modelcontextprotocol/server-puppeteer - Slack: - Messaging integration
@modelcontextprotocol/server-slack
- GitHub: - 仓库管理、议题、PR
@modelcontextprotocol/server-github - Filesystem: - 文件操作
@modelcontextprotocol/server-filesystem - PostgreSQL: - 数据库查询
@modelcontextprotocol/server-postgres - Browser: - Web自动化
@modelcontextprotocol/server-puppeteer - Slack: - 消息集成
@modelcontextprotocol/server-slack
Common Usage Patterns
常见使用模式
Starting a New Coding Session
启动新编码会话
bash
cd my-project
deepcodeType your request directly or use to see available skills.
/bash
cd my-project
deepcode直接输入请求,或使用查看可用技能。
/Using Thinking Mode for Complex Problems
针对复杂问题使用思考模式
In :
settings.jsonjson
{
"thinkingEnabled": true,
"reasoningEffort": "max"
}Or toggle during session with command.
/model在中:
settings.jsonjson
{
"thinkingEnabled": true,
"reasoningEffort": "max"
}或在会话期间使用命令切换。
/modelPasting Code for Review
粘贴代码进行评审
Simply paste code into the prompt and ask for review, optimization, or explanation.
只需将代码粘贴到提示框中,请求评审、优化或解释。
Multi-modal Input (Images)
多模态输入(图片)
- Copy image to clipboard
- Press in DeepCode
Ctrl+V - Add your question about the image
Note: DeepSeek v4 doesn't support multi-modal. Use compatible models like via Volcano Engine.
Doubao-Seed-2.0-pro- 将图片复制到剪贴板
- 在DeepCode中按
Ctrl+V - 添加关于图片的问题
注意:DeepSeek v4不支持多模态。请使用兼容模型,如火山引擎的。
Doubao-Seed-2.0-proResuming Previous Conversation
恢复之前的对话
Use to select from conversation history and continue where you left off.
/resume使用从对话历史中选择,继续之前的会话。
/resumeWorking with Different Model Providers
适配不同模型提供商
Volcano Engine (Doubao)
火山引擎(Doubao)
json
{
"env": {
"MODEL": "Doubao-Seed-2.0-pro",
"BASE_URL": "https://ark.cn-beijing.volces.com/api/v3",
"API_KEY": "${VOLCANO_API_KEY}"
}
}json
{
"env": {
"MODEL": "Doubao-Seed-2.0-pro",
"BASE_URL": "https://ark.cn-beijing.volces.com/api/v3",
"API_KEY": "${VOLCANO_API_KEY}"
}
}Coding Plan (Volcano Engine)
编码计划(火山引擎)
json
{
"env": {
"MODEL": "ark-code-latest",
"BASE_URL": "https://ark.cn-beijing.volces.com/api/coding/v3",
"API_KEY": "${VOLCANO_API_KEY}"
},
"thinkingEnabled": true
}json
{
"env": {
"MODEL": "ark-code-latest",
"BASE_URL": "https://ark.cn-beijing.volces.com/api/coding/v3",
"API_KEY": "${VOLCANO_API_KEY}"
},
"thinkingEnabled": true
}OpenAI
OpenAI
json
{
"env": {
"MODEL": "gpt-4",
"BASE_URL": "https://api.openai.com/v1",
"API_KEY": "${OPENAI_API_KEY}"
}
}json
{
"env": {
"MODEL": "gpt-4",
"BASE_URL": "https://api.openai.com/v1",
"API_KEY": "${OPENAI_API_KEY}"
}
}Notifications
通知
Configure a notification script to alert you when long-running tasks complete:
json
{
"notify": "/usr/local/bin/notify-slack.sh"
}Example notification script ():
notify-slack.shbash
#!/bin/bash
WEBHOOK_URL="${SLACK_WEBHOOK_URL}"
MESSAGE="DeepCode task completed!"
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"$MESSAGE\"}" \
"$WEBHOOK_URL"配置通知脚本,在长时间任务完成时提醒您:
json
{
"notify": "/usr/local/bin/notify-slack.sh"
}通知脚本示例():
notify-slack.shbash
#!/bin/bash
WEBHOOK_URL="${SLACK_WEBHOOK_URL}"
MESSAGE="DeepCode task completed!"
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"$MESSAGE\"}" \
"$WEBHOOK_URL"Web Search Integration
网页搜索集成
Enable web search capability:
json
{
"webSearchTool": "/usr/local/bin/web-search.sh"
}DeepCode includes a built-in free web search tool. Custom scripts allow you to integrate specific search providers.
启用网页搜索功能:
json
{
"webSearchTool": "/usr/local/bin/web-search.sh"
}DeepCode内置免费网页搜索工具。自定义脚本可让您集成特定搜索提供商。
Initializing Agent Configuration
初始化Agent配置
Use to create an file in your project. This file provides context to the AI about your project structure, conventions, and guidelines.
/initAGENTS.mdExample :
AGENTS.mdmarkdown
undefined使用在项目中创建文件。该文件为AI提供项目结构、约定和指南等上下文信息。
/initAGENTS.mdAGENTS.mdmarkdown
undefinedProject Context for AI Agents
Project Context for AI Agents
Tech Stack
Tech Stack
- TypeScript
- React
- Node.js
- PostgreSQL
- TypeScript
- React
- Node.js
- PostgreSQL
Code Conventions
Code Conventions
- Use functional components
- Prefer async/await over promises
- All API routes in
src/api/ - Tests in directory
__tests__/
- Use functional components
- Prefer async/await over promises
- All API routes in
src/api/ - Tests in directory
__tests__/
Database
Database
- Prisma ORM
- Migrations in
prisma/migrations/
- Prisma ORM
- Migrations in
prisma/migrations/
Common Tasks
Common Tasks
- Run tests:
npm test - Start dev server:
npm run dev - Build:
npm run build
undefined- Run tests:
npm test - Start dev server:
npm run dev - Build:
npm run build
undefinedTroubleshooting
故障排除
"API Key not configured"
"API Key not configured"
Ensure is set in or as environment variable .
API_KEY~/.deepcode/settings.jsonDEEPCODE_API_KEY确保已在中设置,或已配置环境变量。
API_KEY~/.deepcode/settings.jsonDEEPCODE_API_KEYSkills not loading
技能未加载
- Check skills are in or
~/.agents/skills/./.agents/skills/ - Verify files have valid YAML frontmatter
SKILL.md - Use to see loaded skills
/skills
- 检查技能是否位于或
~/.agents/skills/目录中./.agents/skills/ - 验证文件的YAML前置元数据有效
SKILL.md - 使用查看已加载的技能
/skills
MCP server not connecting
MCP服务器无法连接
- Run to see error messages
/mcp - Verify server package is installed:
npx -y @modelcontextprotocol/server-github - Check environment variables are set correctly
- Ensure and
commandin config match server requirementsargs
- 运行查看错误信息
/mcp - 验证服务器包已安装:
npx -y @modelcontextprotocol/server-github - 检查环境变量是否正确设置
- 确保配置中的和
command符合服务器要求args
Model responses interrupted
模型响应被中断
Press to stop current response. If responses consistently fail, check:
Esc- Model name is correct
- Base URL is accessible
- API key has sufficient credits
- Token limits () are appropriate
maxTokens
按停止当前响应。如果响应持续失败,请检查:
Esc- 模型名称正确
- 基础URL可访问
- API密钥有足够的额度
- Token限制()设置合理
maxTokens
Context cache not working
上下文缓存不工作
Context caching is automatic for DeepSeek models. To verify:
- Use or
deepseek-v4-prodeepseek-v4-flash - BASE_URL should be
https://api.deepseek.com - Check API dashboard for cache hit rates
DeepSeek模型会自动启用上下文缓存。如需验证:
- 使用或
deepseek-v4-prodeepseek-v4-flash - BASE_URL应为
https://api.deepseek.com - 在API控制台查看缓存命中率
Configuration not taking effect
配置未生效
Remember priority order:
- Project
./.deepcode/settings.json - User
~/.deepcode/settings.json - Environment variables
- Defaults
Check which config file is being used and verify JSON syntax is valid.
请记住优先级顺序:
- 项目
./.deepcode/settings.json - 用户
~/.deepcode/settings.json - 环境变量
- 默认值
检查正在使用的配置文件,并验证JSON语法有效。