Codg

July 16, 2026 · View on GitHub

最新版本 建置狀態 GoDoc 加入 Discord 聊天 https://discord.gg/Dy5QZRbaND

下一代簡易的程式碼與工作 AI 智慧代理 Harness 系統,自動化、非同步、高並行、高效能,高效率且高精度。

English | 繁體中文 | 简体中文 | 日本語 | 한국어 | Français | Deutsch | Español | Português | Русский | العربية

Codg 展示 Codg 展示

安裝

Mac 與 Linux:

# Homebrew
brew install vcaesar/tap/codg

# NPM
# npm install -g @vcaesar/codg

Windows (PowerShell):

# Winget
# winget install vcaesar.codg

# YOLO(原生 PowerShell 安裝腳本)
irm https://raw.githubusercontent.com/vcaesar/codg/main/demo/boot.ps1 | iex

全平台(macOS、Linux,或透過 Git Bash / MSYS2 / Cygwin / WSL 執行的 Windows):

# YOLO
curl -fsSL https://raw.githubusercontent.com/vcaesar/codg/main/demo/boot.sh | bash

或者直接點擊 Releases 下載並執行。

進入您的專案目錄,執行 codg,使用「/init」初始化專案。 使用 “/yolo” 切換自動模式與詢問模式,權限可透過 codg.toml 設定。

功能特色

  • 自動化、非同步、高並行、高效能的智慧代理系統,記憶體佔用低
  • 多模型提供商(40+ API 與 Pro 提供商、Custom URL API)及本地模型(透過 openai-compat 或 claude-compat),支援 Openrouter、Ollama、Nvidia 等免費模型,可透過 “/connect” “/models” 或 “codg auth” 使用
  • 多智慧代理的非同步與模型規則
  • 壓縮輸入輸出、上下文與提示以節省 token,利用快取和規則降低成本
  • 支援任何終端機與作業系統,同時支援 Web 終端機
  • 易用性:TUI 隨處可用,體驗接近 GUI,桌面版與 Web 版處於 BETA 階段
  • 點擊或輸入 “/xxx” 切換會話,TUI 中任意位置皆可點擊
  • 點擊 “Modified Files” 或輸入 “/diff”、“/diff git” 在 TUI 中檢視差異檔案,體驗與 VSCode 相似
  • 自動補全英文字母與短句
  • 更易用的 Agents、Skills 與 MCP 系統,支援自訂 Agents 與 Skills
  • 類似 OpenClaw 的頻道與功能支援
  • 完整的 Web UI、遠端 TUI 與桌面應用支援
  • 支援 Claude Code/Codex 外掛

桌面應用(BETA),部分功能仍需等待測試與修復 bug 後再發佈。

提供商

Atom、Copilot、Anthropic、Anthropic API、OpenAI、OpenAI API、Gemini、Gemini API、OpenRouter、Antigravity、Cursor、Kiro、xAI、Azure、Bedrock、Vertex AI、Nvidia、HuggingFace、Vercel、Ollama Cloud、Cloudflare Workers、GitHub、Poe、Meta、Groq、IO.net、OpenCode Zen、OpenCode Go、Windsurf、Cerebras。

中國:Z.ai、Zhipu、Zhipu Coding、Kimi、Kimi Coding、DeepSeek、MiniMax、MiniMax China、Qwen、MiMo、Qiniu Cloud、Ali Coding、Ali Coding CN、Tencent Coding。

基準測試

記憶體使用

工具1 個活躍工作階段10 個活躍工作階段每新增工作階段額外 PSS
Codg65 MB165 MB~10 MB
Codex CLI140.0 MB334.8 MB~21.6 MB
Cursor Agent214.9 MB1632.4 MB~157.5 MB
GitHub Copilot CLI333.3 MB1756.5 MB~158.1 MB
OpenCode371.5 MB3237.2 MB~318.4 MB
Claude Code386.6 MB2300.6 MB~212.7 MB

回報 Bug

請提交 Github Issues

我們如何使用您的資料

目前不蒐集任何資料與遙測資訊,並支援 100% 本地模型;使用 API 時請參閱對應服務商的隱私政策。

關於 TUI 用法,請參閱 TUI 指令文件,並在 TUI 中輸入 /help 查看快捷鍵與其他說明。

CLI 指令

使用:codg -h

codg auth/login               # 登入認證 (Atom、OpenAI、GitHub...)
codg web                      # 在 4096 埠啟動 Web UI
codg desktop                  # 啟動桌面應用 (Wails)
codg claw                     # 啟動訊息代理 (Telegram/Discord/Slack)
codg gateway --private-only   # 啟動受保護的閘道
codg models claude            # 列出符合 "claude" 的模型
codg runm start Qwen/Qwen3-8B-GGUF   # 啟動本地模型
codg runm download user/model # 下載 GGUF 模型
codg plugin install repo/name # 安裝外掛
codg plugin list              # 列出已安裝的外掛
codg install repo/name        # plugin install 的簡寫形式
codg mcp add myserver cmd     # 新增 MCP 伺服器
codg mcp list                 # 列出已設定的 MCP 伺服器
codg skill url add <url>      # 新增技能來源 URL
codg themes set catppuccin    # 切換佈景主題
# codg logs -f                # 追蹤應用程式日誌
codg toml                     # 顯示全部設定
codg stats/s                  # 顯示使用統計
codg dirs                     # 列印資料/設定目錄路徑
codg projects                 # 列出追蹤的專案目錄
codg lite 2                   # 設定精簡模式等級 (0-4)
codg merge origin main        # 含 v1/ 備份的安全 git 合併
codg migrate                  # 從 .claude/.opencode 移轉設定
codg vm build                 # 在遠端 VM 上建置
codg vm run -- make test      # 在 VM 上執行指令
codg sandbox run -- ./test.sh # 在沙盒中執行
codg sandbox status           # 檢視沙盒可用性
codg used                          # 顯示所有服務商的使用額度與 API 統計
codg update                   # 更新 codg 版本
codg updatep                  # 更新服務商定義

Claude-Code/Codex 外掛

# Codg
codg plugin marketplace add earthtojake/text-to-cad
codg plugin add cad@text-to-cad

使用範例

非互動模式 (codg run)

# 透過管線傳入另一個指令的輸出。
cat errors.log | codg run "這些錯誤的原因是什麼?"
# 詳細模式 (除錯資訊輸出至 stderr)。
codg run -v "除錯這個函式"

Web UI

# 在預設埠 4096 啟動 Web UI。
codg web
# 自訂埠。
codg web -p 8080

# 僅 API 模式 (無前端、無瀏覽器)。
codg web 0, codg api

外掛管理

# 從 Git 儲存庫安裝外掛。
codg install github.com/user/codg-xxx-auth

自訂代理與技能

將 xx_agent.md (.codg/agents/templates) 或 SKILL.md (.codg/skills) 複製到對應目錄

設定系統

在專案根目錄建立 codg.toml(或 ~/.codg/config/codg.toml 用於全域設定):

# codg.toml — 最小化專案設定。
[options]
lite_mode = 2          # 0 = 全部代理,2 = 預設精簡集,4 = 單一代理
locale    = "en"       # UI 語言:en、zh-CN、ja
ctx_resize = true
token_save = 2

[options.tui]
theme     = "catppuccin"
dark_mode = true
compact_mode = false

[tools.grep]
backends = ["rg", "sg", "csearch", "ngram", "regex"]

服務商設定

# 使用 API 金鑰 (支援 $ENV_VAR 展開)。
[providers.anthropic]
api_key = "$ANTHROPIC_API_KEY"

# 使用 OAuth (透過 `codg auth` 設定)。
[providers.openai]
oauth = true

# 自訂/自架服務商。
[providers.local]
name     = "My Local LLM"
type     = "openai-compat"
base_url = "http://localhost:8080/v1"
api_key  = "not-needed"

代理自訂

# 簡寫形式:指定模型類型。
agents.coder = "large"
agents.task  = "small"

# 完整形式:微調代理。
[agents.advisor]
model           = "large"
temperature     = 0.3
thinking_budget = 32000

MCP 伺服器

# HTTP MCP 伺服器。
[mcp.websearch]
type = "http"
url  = "https://mcp.exa.ai/mcp?tools=web_search_exa"

技能

# 在 TUI 或 codg skill 中自動載入與下載
[option]
skill_urls = ["https://github.com/user/skills"]

本地模型 (llama.cpp)

[llama]
port     = 8090
host     = "127.0.0.1"
ctx_size = 32000
gpu      = "auto"          # auto、cuda、off

訊息通道

[channels.telegram]
enabled     = true
token       = "$TELEGRAM_BOT_TOKEN"
allowed_ids = ["123456789"]

[channels.discord]
enabled  = true
token    = "$DISCORD_BOT_TOKEN"

權限

[permissions]
allowed_tools = ["bash", "edit", "view", "glob", "grep"]
allowed_dirs = ["**x"] # 所有目錄