deepseekcode

Release Go Reference Go Report Card Go Version License: MIT

English · 简体中文

deepseekcode 是面向 DeepSeek 模型和 OpenAI-compatible chat-completions 端点的终端编码 Agent。它以单个 Go 二进制 dsc 分发,包含交互式 TUI、 一次性 CLI 模式、仓库工具、SQLite 会话,以及保守的权限模型。

为什么选择 dsc(DeepSeek 深度特化)

DeepSeek V4 Agent 故事

DeepSeekCode 专为 DeepSeek V4 模型构建,相比通用编码 Agent 具有可验证的优势:

完整故事及本地验证命令: docs/deepseek-v4-agent-story.md

基准证据: bench/README.md

功能

安装

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/amemiya02/deepseekcode/main/install.sh | sh

Homebrew:

brew install amemiya02/deepseekcode/deepseekcode

Scoop:

scoop bucket add deepseekcode https://github.com/amemiya02/deepseekcode-scoop
scoop install deepseekcode

Go:

go install github.com/amemiya02/deepseekcode/cmd/dsc@latest

从源码构建:

git clone https://github.com/amemiya02/deepseekcode
cd deepseekcode
make build
./bin/dsc -version

要求:

快速开始

export DEEPSEEK_API_KEY=sk-...

dsc                              # 打开 TUI
dsc -p "summarize this repo"     # 运行一次 prompt 后退出
dsc --read-only                  # 只检查,不允许 write/edit/bash 工具
dsc init                         # 创建项目初始配置
dsc doctor                       # 检查本地环境

会话快捷参数:

dsc -c                 # 继续当前项目最近一次会话
dsc -r <session-id>    # 恢复指定会话
dsc -new               # 强制创建新会话

配置

配置按内置默认值、用户配置、项目配置、CLI flags 的顺序叠加。项目配置位于 ./.deepseek/config.toml;用户配置位于 ~/.deepseek/config.toml

最小 DeepSeek 配置:

[active]
provider = "deepseek"

[providers.deepseek]
type = "deepseek"
base_url = "https://api.deepseek.com"
env_var = "DEEPSEEK_API_KEY"
first_token_timeout_ms = 45000
chunk_stall_timeout_ms = 20000

[defaults]
model = "deepseek-v4-flash"
thinking = true

OpenAI-compatible 端点:

[active]
provider = "openai"

[providers.openai]
type = "openai-compat"
base_url = "https://api.openai.com"
env_var = "OPENAI_API_KEY"
default_model = "gpt-4o"

完整说明见 docs/config.mddocs/PROVIDERS.md

文档

开发

make build       # 构建 ./bin/dsc
make test        # go test ./...
make test-race   # go test -race ./...
make lint        # go vet ./...
make fmt         # gofmt -s -w .
make run         # 构建并启动 TUI

提交 pull request 前:

make fmt
make lint
make test

参与贡献

欢迎提交 issue 和 pull request。修改 README 时,请同步更新 README.mdREADME.zh-CN.md,并保持匹配的 ## 结构。只记录本仓库中已经实现且可测试的功能。

许可证

MIT