deepcode-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DeepCode 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-cli
Run
deepcode
in any project directory to start the assistant.
bash
npm install -g @vegamo/deepcode-cli
在任意项目目录中运行
deepcode
即可启动助手。

Configuration

配置

Create
~/.deepcode/settings.json
:
json
{
  "env": {
    "MODEL": "deepseek-v4-pro",
    "BASE_URL": "https://api.deepseek.com",
    "API_KEY": "sk-..."
  },
  "thinkingEnabled": true,
  "reasoningEffort": "max"
}
创建
~/.deepcode/settings.json
json
{
  "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:
  1. Project-level (highest):
    ./.deepcode/settings.json
  2. User-level:
    ~/.deepcode/settings.json
  3. Environment variables:
    DEEPCODE_MODEL
    ,
    DEEPCODE_BASE_URL
    ,
    DEEPCODE_API_KEY
  4. Default values (lowest)
DeepCode遵循多级配置优先级体系:
  1. 项目级(最高):
    ./.deepcode/settings.json
  2. 用户级
    ~/.deepcode/settings.json
  3. 环境变量
    DEEPCODE_MODEL
    ,
    DEEPCODE_BASE_URL
    ,
    DEEPCODE_API_KEY
  4. 默认值(最低)

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

模型选项

  • deepseek-v4-pro
    (recommended for complex tasks)
  • deepseek-v4-flash
    (faster, lower cost)
  • Any OpenAI-compatible model
  • deepseek-v4-pro
    (推荐用于复杂任务)
  • deepseek-v4-flash
    (速度更快、成本更低)
  • 任何兼容OpenAI的模型

Reasoning Effort Levels

推理力度等级

  • "min"
    - Fast, basic reasoning
  • "medium"
    - Balanced (default)
  • "max"
    - Deep thinking, slower but more thorough
  • "min"
    - 快速、基础推理
  • "medium"
    - 平衡(默认)
  • "max"
    - 深度思考,速度较慢但更全面

Key Commands

关键命令

Slash Commands

斜杠命令

CommandDescription
/
Open skills/command menu
/new
Start new conversation
/resume
Resume a previous conversation
/model
Switch model, thinking mode, and reasoning effort
/init
Initialize AGENTS.md file
/skills
List available skills
/mcp
View MCP server status and available tools
/exit
Exit (or press Ctrl+D twice)
命令描述
/
打开技能/命令菜单
/new
开启新对话
/resume
恢复之前的对话
/model
切换模型、思考模式和推理力度
/init
初始化AGENTS.md文件
/skills
列出可用技能
/mcp
查看MCP服务器状态和可用工具
/exit
退出(或按两次Ctrl+D)

Keyboard Shortcuts

键盘快捷键

KeyAction
Enter
Send message
Shift+Enter
or
Ctrl+J
Insert newline
Ctrl+V
Paste image from clipboard
Esc
Interrupt current model response
Ctrl+D
(twice)
Exit
按键操作
Enter
发送消息
Shift+Enter
Ctrl+J
插入换行
Ctrl+V
粘贴剪贴板中的图片
Esc
中断当前模型响应
Ctrl+D
(两次)
退出

Agent Skills

Agent Skills

DeepCode CLI supports extensible skills to enhance the assistant's capabilities.
DeepCode CLI支持可扩展技能,以增强助手的能力。

User-level Skills

用户级技能

Place skills in
~/.agents/skills/
. These are available across all projects.
将技能放置在
~/.agents/skills/
目录下,这些技能可在所有项目中使用。

Project-level Skills

项目级技能

Place skills in
./.agents/skills/
or
./.deepcode/skills/
for project-specific capabilities.
将技能放置在
./.agents/skills/
./.deepcode/skills/
目录下,用于项目专属功能。

Creating a Custom Skill

创建自定义技能

Create a
SKILL.md
file in the skills directory:
markdown
---
name: my-custom-skill
description: Description of what this skill does
triggers:
  - when to use this skill
  - another trigger phrase
---
在技能目录中创建
SKILL.md
文件:
markdown
---
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 ```
undefined

Example: Database Migration Skill

示例:数据库迁移技能

./.agents/skills/migrations/SKILL.md
:
markdown
---
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.md
markdown
---
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
prisma/migrations/
and create a new migration to undo changes.
undefined
Edit migration files in
prisma/migrations/
and create a new migration to undo changes.
undefined

MCP Integration

MCP集成

DeepCode supports Model Context Protocol for connecting external services.
DeepCode支持Model Context Protocol,用于连接外部服务。

Configuring MCP Servers

配置MCP服务器

In
~/.deepcode/settings.json
:
json
{
  "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.json
中:
json
{
  "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
/mcp
command in DeepCode to see:
  • Connected MCP servers
  • Available tools from each server
  • Connection status
在DeepCode中使用
/mcp
命令查看:
  • 已连接的MCP服务器
  • 每个服务器提供的可用工具
  • 连接状态

Common MCP Servers

常见MCP服务器

  • GitHub:
    @modelcontextprotocol/server-github
    - Repository management, issues, PRs
  • Filesystem:
    @modelcontextprotocol/server-filesystem
    - File operations
  • PostgreSQL:
    @modelcontextprotocol/server-postgres
    - Database queries
  • Browser:
    @modelcontextprotocol/server-puppeteer
    - Web automation
  • Slack:
    @modelcontextprotocol/server-slack
    - Messaging integration
  • GitHub:
    @modelcontextprotocol/server-github
    - 仓库管理、议题、PR
  • Filesystem:
    @modelcontextprotocol/server-filesystem
    - 文件操作
  • PostgreSQL:
    @modelcontextprotocol/server-postgres
    - 数据库查询
  • Browser:
    @modelcontextprotocol/server-puppeteer
    - Web自动化
  • Slack:
    @modelcontextprotocol/server-slack
    - 消息集成

Common Usage Patterns

常见使用模式

Starting a New Coding Session

启动新编码会话

bash
cd my-project
deepcode
Type your request directly or use
/
to see available skills.
bash
cd my-project
deepcode
直接输入请求,或使用
/
查看可用技能。

Using Thinking Mode for Complex Problems

针对复杂问题使用思考模式

In
settings.json
:
json
{
  "thinkingEnabled": true,
  "reasoningEffort": "max"
}
Or toggle during session with
/model
command.
settings.json
中:
json
{
  "thinkingEnabled": true,
  "reasoningEffort": "max"
}
或在会话期间使用
/model
命令切换。

Pasting Code for Review

粘贴代码进行评审

Simply paste code into the prompt and ask for review, optimization, or explanation.
只需将代码粘贴到提示框中,请求评审、优化或解释。

Multi-modal Input (Images)

多模态输入(图片)

  1. Copy image to clipboard
  2. Press
    Ctrl+V
    in DeepCode
  3. Add your question about the image
Note: DeepSeek v4 doesn't support multi-modal. Use compatible models like
Doubao-Seed-2.0-pro
via Volcano Engine.
  1. 将图片复制到剪贴板
  2. 在DeepCode中按
    Ctrl+V
  3. 添加关于图片的问题
注意:DeepSeek v4不支持多模态。请使用兼容模型,如火山引擎的
Doubao-Seed-2.0-pro

Resuming Previous Conversation

恢复之前的对话

Use
/resume
to select from conversation history and continue where you left off.
使用
/resume
从对话历史中选择,继续之前的会话。

Working 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.sh
):
bash
#!/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.sh
):
bash
#!/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
/init
to create an
AGENTS.md
file in your project. This file provides context to the AI about your project structure, conventions, and guidelines.
Example
AGENTS.md
:
markdown
undefined
使用
/init
在项目中创建
AGENTS.md
文件。该文件为AI提供项目结构、约定和指南等上下文信息。
AGENTS.md
示例:
markdown
undefined

Project 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
    __tests__/
    directory
  • Use functional components
  • Prefer async/await over promises
  • All API routes in
    src/api/
  • Tests in
    __tests__/
    directory

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
undefined

Troubleshooting

故障排除

"API Key not configured"

"API Key not configured"

Ensure
API_KEY
is set in
~/.deepcode/settings.json
or as environment variable
DEEPCODE_API_KEY
.
确保
API_KEY
已在
~/.deepcode/settings.json
中设置,或已配置环境变量
DEEPCODE_API_KEY

Skills not loading

技能未加载

  • Check skills are in
    ~/.agents/skills/
    or
    ./.agents/skills/
  • Verify
    SKILL.md
    files have valid YAML frontmatter
  • Use
    /skills
    to see loaded skills
  • 检查技能是否位于
    ~/.agents/skills/
    ./.agents/skills/
    目录中
  • 验证
    SKILL.md
    文件的YAML前置元数据有效
  • 使用
    /skills
    查看已加载的技能

MCP server not connecting

MCP服务器无法连接

  • Run
    /mcp
    to see error messages
  • Verify server package is installed:
    npx -y @modelcontextprotocol/server-github
  • Check environment variables are set correctly
  • Ensure
    command
    and
    args
    in config match server requirements
  • 运行
    /mcp
    查看错误信息
  • 验证服务器包已安装:
    npx -y @modelcontextprotocol/server-github
  • 检查环境变量是否正确设置
  • 确保配置中的
    command
    args
    符合服务器要求

Model responses interrupted

模型响应被中断

Press
Esc
to stop current response. If responses consistently fail, check:
  • Model name is correct
  • Base URL is accessible
  • API key has sufficient credits
  • Token limits (
    maxTokens
    ) are appropriate
Esc
停止当前响应。如果响应持续失败,请检查:
  • 模型名称正确
  • 基础URL可访问
  • API密钥有足够的额度
  • Token限制(
    maxTokens
    )设置合理

Context cache not working

上下文缓存不工作

Context caching is automatic for DeepSeek models. To verify:
  • Use
    deepseek-v4-pro
    or
    deepseek-v4-flash
  • BASE_URL should be
    https://api.deepseek.com
  • Check API dashboard for cache hit rates
DeepSeek模型会自动启用上下文缓存。如需验证:
  • 使用
    deepseek-v4-pro
    deepseek-v4-flash
  • BASE_URL应为
    https://api.deepseek.com
  • 在API控制台查看缓存命中率

Configuration not taking effect

配置未生效

Remember priority order:
  1. Project
    ./.deepcode/settings.json
  2. User
    ~/.deepcode/settings.json
  3. Environment variables
  4. Defaults
Check which config file is being used and verify JSON syntax is valid.
请记住优先级顺序:
  1. 项目
    ./.deepcode/settings.json
  2. 用户
    ~/.deepcode/settings.json
  3. 环境变量
  4. 默认值
检查正在使用的配置文件,并验证JSON语法有效。