atomcode:基于终端的 AI 编码代理项目

Claude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get Started

分支25Tags99
文件最后提交记录最后更新时间
build(release): default to CLI-only, source version from Cargo.toml - Read VERSION from [workspace.package].version in Cargo.toml so the package filename always matches the binary's --version. Git tags can drift (Cargo bumped before tag pushed). ATOMCODE_VERSION env override preserved for CI / one-off rebuilds. - Default cargo build to -p atomcode; daemon is internal/CI-facing per sign-macos.sh and was bloating release artifacts. Opt back in with ATOMCODE_INCLUDE_DAEMON=1. - Add aarch64-unknown-linux-musl linker config so the linux-arm64 cross-build can link (was failing with Apple ld rejecting GNU options). - Correct the aarch64 musl-cross install hint: the formula's option is --without-aarch64 (aarch64 ships by default); passing --with-aarch64 gets fuzzy-matched to --without-aarch64 and silently disables it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> 1 个月前
ci: add Add-hosts step to distro-pm-check job Mirror the other build jobs so the runner can resolve the project's custom registries during cargo build/test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> 1 天前
chore(tui): on_resize 增加 RSZ 阶段诊断日志(定位 conhost 闪退) ED2 修复后仍闪退。在 on_resize 各阶段「写控制台之前」打 RSZ trace (enter/wipe/body/paint/done),并打印 legacy_conhost 标志与新旧尺寸。 因为是在把字节发给 conhost 之前记录,即便 conhost 当场 fastfail、 trace 文件里仍会留下「最后一个阶段」=触发崩溃的那步,并能确认 ED2 安全路径到底有没有生效。仅 ATOMCODE_TUIX_LOG 开启时有开销。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> 13 小时前
chore: bump version from v4.24.0 to v4.24.1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> 12 小时前
Merge branch 'feat/webui-design' into release/v4.24.1 feat/webui-design 带来 WebUI:登录入口、会话重命名/删除、设置对话框重构、 GET /skills、daemon 抽出 run_server 薄壳 + WebUI token 鉴权 + LiveSession 同步。 冲突解决: - tuix/src/lib.rs:Context 结构体两侧各加字段,全部保留 (dangerously_skip_permissions/pending_guide_topic + sync_session/sync_forwarder)。 - tuix/src/event_loop/mod.rs:保留 webui 的「sync_session 投递 LiveSession / 否则 原有 SendMessage」分支,并在其前置上 release 的「每轮清理 hook 警告」逻辑。 - daemon/src/main.rs:取 feat/webui-design 的薄壳版本(逻辑已迁入 lib.rs::run_server); release 对旧 main.rs 仅有的改动是 OpenAtomcode 遥测字段,见下。 语义合并修复(非冲突但合并后不可编译): - daemon/src/lib.rs:OpenAtomcode -> OpenAtomcode { dangerously_skip_permissions: false } (release 给该遥测事件加了字段)。 - daemon TurnRunner 构造:release 把 hook 系统从 HookExecutor/hook_executor 重构为 hook_engine(HookEngine) + current_turn_number。daemon/lib.rs 与 live_api.rs 改用 HookEngine::new()+load_all(&working_dir),与 TUI 主 agent 一致,保留 webui 「daemon 加载并执行配置 hook」的行为;并移除 TurnParts 中不再使用的 hook_executor。 验证:cargo check --tests -p atomcode-core/atomcode-daemon/atomcode-tuix/atomcode 全部通过。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> 22 小时前
feat: add comprehensive hook system with webhook and async batch support - Implement hook framework with 13 extension points * Message, Turn, Tool, Session, and System level hooks * Pre/post execution hooks with modify/deny capabilities * Priority-based hook ordering - Add webhook support for remote HTTP integration * Synchronous webhook mode * Custom headers and authentication * Automatic retry with exponential backoff - Implement async webhook with batch sending * Non-blocking event queue (< 1ms latency) * Configurable batch size and flush interval * Background tokio task processing * Reduces HTTP requests by 90-98% - Add CLI commands for hook management * 'atomcode hooks list' - view loaded hooks * 'atomcode hooks paths' - show config paths * 'atomcode hooks test' - test individual hooks - Include 6 built-in engineering hooks * Tool audit logging * Turn statistics * Auto git commit * Session summary * Error reporting * Response validation - Fix existing test failures * self_update version comparison logic * Windows path JSON escaping in read tests * Edit test Windows compatibility - Add comprehensive documentation * Hook usage guide * Complete timing reference * Webhook integration guide * Async webhook guide * CLI command guide - Add example hooks (shell scripts) * Tool call logger * Auto git commit * Code review helper Tested: 305+ tests passing, build successful Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> 1 个月前
fix(guide): i18n subagent tool defs, OnceLock KB cache, VSCode message queuing - Cache embedded KnowledgeBase via OnceLock so files are parsed only once - Add i18n messages for invoke_subagent tool description and parameters - Fix guide integration tests with locale guards and explicit locale setup - Queue VSCode panel messages when webview is not yet ready, flush on ready - Use English description for /guide slash command 4 天前
Merge branch 'release/v4.23.3' into 'main' # Conflicts: # conflict packages/npm/scripts/build_npm_package.sh5 天前
chore: bump version from v4.24.0 to v4.24.1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> 12 小时前
chore: bump version from v4.24.0 to v4.24.1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> 12 小时前
chore: bump version from v4.24.0 to v4.24.1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> 12 小时前
merge: integrate main branch changes into release/v4.24.0 - Resolve parallel_edit.rs conflict (accept main's approval logic) - Resolve event_loop/mod.rs conflict (keep guide_running check) - Remove alt_screen.rs (deleted in main) - Add ensure_scroll_region no-op for compatibility - Re-export SubAgentTask/SubAgentPool from agent::sub_agent 6 天前
feat(mcp): enhance daemon MCP reliability and protocol compliance - Auto-reload MCP registry when project directory changes via /cd - Add wait_for_initial_connections() to McpRegistry with Notify signal, so first chat request waits up to 5s for background MCP connections - HTTP transport: send notifications/initialized after initialize (MCP spec) - Add send_notification() method for fire-and-forget JSON-RPC notifications - Change daemon permission mode from DenyAll to BypassAll so MCP tools can actually execute (users implicitly authorize by configuring .mcp.json) - Add reconnect logic: if tools empty but servers configured, reload registry - Document stdio transport serialization limitation in .mcp.json.example 24 天前
chore: bump workspace crate versions in Cargo.lock to v4.24.1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> 5 小时前
chore: bump version from v4.24.0 to v4.24.1 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> 12 小时前
feat: major architecture overhaul — context management, smart truncation, agent discipline Phase 1: Tool result externalization - ToolResultRef + ToolResultStore: large tool outputs cached to disk - Hot zone inflated from disk, cold zone uses summaries Phase 2: Turn-aware context windowing - TurnTracker: tracks conversation turns (user message → completion) - Budgeted windowing operates at turn granularity - Cold turns: only user question + assistant conclusion retained - Synthesized outcomes for turns without assistant text Phase 3: Smart per-tool truncation - bash: preserve error lines, skip verbose build logs - read_file: threshold raised to 2000 lines (prevents multi-read cycles) - First read of any file forces full content (ignores offset/limit) - edit_file returns compact diff + file outline after edit Agent discipline: - Sleep loop detection (warn at 2, block at 3+) - Repeated command detection (normalized, warn at 2, block at 3+) - Same-file multi-edit blocking (threshold 4) - Re-read soft reminder (not blocking) - Over-verification detection (3+ consecutive check commands) - HTTP 200 detection → stop verifying - 429 rate limit retry with exponential backoff (up to 5 retries) - Loop detection allows retry after edit (fix-then-retry is not a loop) - Intercepted/blocked calls don't count toward step limit - Bash pipe/cat detection with redirect to proper tools System prompt: - Restored v1.3.1 proven rules + new additions - ACT DON'T INSTRUCT / BE CONCISE / ONE SIGNAL IS ENOUGH - COMMAND DISCIPLINE / ERROR HANDLING sections - Glob wildcard guidance - Tech-stack neutral (zero specific tool/language names) Project context: - Added pom.xml, build.gradle, requirements.txt, composer.json, CMakeLists.txt to descriptors - Cross-session context: previous session turns injected into system prompt - Conversation history loaded on startup (not fresh each session) - Active services detection: port scanning on startup + URL extraction from bash output - Frontend hot-reload hint when dev server detected UX improvements: - TTFT per LLM call (not cumulative), removed from status bar - Spinner shows last tool name: "After read_file, thinking..." - Tool call streaming: shows file_path/command as args stream in - Turn completion summary: "✻ Completed in N steps, Xs" - Streaming markdown: trim incomplete backtick/bold tokens - Pangu spacing (CJK-ASCII) - Code block styling refresh - Append input during streaming (Enter sends additional context) - UTF-8 safe string truncation (char boundary check) Tooling: - edit_file: atomic_write retry on rename failure (dev server file locks) - edit_file: suggested fix on old_string mismatch - glob: rewritten pattern parser (handles absolute paths, **/ splits) - LLM request logging to ~/.atomcode/logs/ - Datalog analyzer script (scripts/analyze_datalogs.py) with --deep mode (Claude Code) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> 2 个月前
Merge remote-tracking branch 'origin/release/v4.24.1' into release/v4.24.1 22 小时前
Merge remote-tracking branch 'origin/release/v4.24.1' into release/v4.24.1 22 小时前
update: 更新文件 latest.json 升级版本到v4.24.1 Signed-off-by: duxin <duxin@csdn.net>11 小时前
      _   _                  ____          _
     / \ | |_ ___  _ __ ___ / ___|___   __| | ___
    / _ \| __/ _ \| '_ ` _ \ |   / _ \ / _` |/ _ \
   / ___ \ || (_) | | | | | | |__| (_) | (_| |  __/
  /_/   \_\__\___/|_| |_| |_|\____\___/ \__,_|\___|

基于 Rust 开发的开源终端 AI 编码助手

English · 简体中文

安装 · 快速开始 · 功能特性 · 架构设计 · 开发指南 · 贡献代码 · 社区交流

version rust license platform AtomGit Star


本项目 100% 由 AI 生成。每一行代码、每一个架构决策的实现以及每一次提交均由 AI 编写。人类开发者仅作为决策者和产品经理——负责定义构建内容,而非实现方式。


AtomCode 是一款运行在终端中的 AI 编码助手。您只需用自然语言下达任务,它就能自主读取代码库、编辑文件、运行命令并验证工作成果。

您可以将其视为 Claude Code / Cursor Agent 的开源替代方案,但它完全在终端中运行,并且可以连接到任何兼容 OpenAI 的 API。

功能特性

智能助手循环

  • 自主多步骤执行 — 读取文件、编辑代码、运行测试、修复错误,全程自动循环
  • 验证循环 — 在确认任务完成前,通过语法检查自动验证编辑内容
  • 动态步骤预算 — 根据编辑文件数量动态调整步骤,每轮设置上限以控制成本
  • 循环检测 — 识别并跳出重复的工具调用模式
  • 三层 JSON 修复 — 恢复格式错误的工具调用参数
  • 轮次级数据日志 — 结构化的每轮日志,支持回放、调试和评估测试

内置工具

文件与 shell:

  • read_filewrite_fileedit_filesearch_replace
  • bashgrepgloblist_directorychange_dir
  • web_searchweb_fetch

代码图谱(具备语言感知能力的代码智能):

  • list_symbolsread_symbolfind_references
  • trace_callerstrace_calleestrace_chain
  • file_depsblast_radius

自动化:

  • auto_fix — 自动 lint/类型检查修复循环
  • use_skill — 调用用户定义的技能

多提供商支持

连接任何支持 OpenAI 函数调用 API 的大模型:

提供商 函数调用 已测试模型
Claude (Anthropic) 支持 Claude Sonnet 4.5/4.6、Opus 4.6
OpenAI 支持 GPT-4o、GPT-4.1
DeepSeek 支持 DeepSeek V3、DeepSeek R1
智谱 (GLM) 支持 GLM-4、GLM-5
通义千问 (Alibaba) 支持 Qwen-Plus、Qwen-Max
SiliconFlow 支持 多种开源模型
Ollama (本地) 部分支持 Llama 3、Qwen2 等
任何 OpenAI 兼容 API 支持

会话与登录

  • 持久会话 — 所有对话均会保存;使用 atomcode --continue / -c 继续上次会话,或在 TUI 中通过 /resume 恢复/切换会话
  • AtomGit OAuth 登录/login(或 atomcode login)将您的 CLI 与 AtomGit 账户关联
  • SSO 登录/login-with-sso 供 GitCode 内部用户使用
  • 无头模式atomcode -p "..." 以非交互方式运行单个提示并在标准输出流中返回回复(Claude Code -p 风格);需要批准的 bash 调用会自动批准,而其他需要批准的工具则会被拒绝
  • 守护进程模式atomcode-daemon 公开 HTTP API,用于会话历史记录和 SSE 流式聊天

终端界面

  • 实时流式传输,支持 markdown 渲染和语法高亮
  • 代码块,带有语言标签、行号和 base16-ocean.dark 主题
  • 多行输入,支持 Shift+Enter(或 \ + Enter)、高度自动增长、输入历史记录
  • 鼠标拖拽文本选择、自动滚动和剪贴板复制
  • 斜杠命令/model/provider/resume/bg/diff/undo/cost/clear/compact 等(见下表)
  • 文件附件 — 粘贴文件路径以附加内容作为上下文
  • 括号粘贴 — 长粘贴内容折叠为简洁指示器
  • 技能 — 从技能目录加载的用户定义命令,可像任何斜杠命令一样调用

Web UI

  • /webui(在 TUI 中)或 atomcode webui(CLI)会启动本地浏览器界面,作为终端界面的替代方案 —— 相同的智能体,相同的会话,在浏览器中呈现
  • 仅本地回环 —— 服务器绑定到 127.0.0.1 并使用一次性令牌;不会向网络公开任何内容
  • /webui stop 停止进程内服务器(之后使用 /webui 可重新启动)

Safety

  • 破坏性命令检测 —— rm -rfgit push --forceDROP TABLE 等命令需要明确批准
  • 路径感知确认 —— 根据风险级别,外部读取、敏感路径以及工作区外的所有写入可能需要确认
  • 敏感文件保护 —— 受保护的系统路径、凭据目录、shell 配置、.env 文件以及密钥/证书文件采用更严格的确认规则
  • Shell 绕过保护 —— 常见的 shell 文件命令,如 catheadlscpmvtee,继承与文件工具相同的路径批准模型
  • 每会话权限授予 —— 按工具模式批准一次,或始终允许
  • 源文件删除需要批准 —— 对代码文件执行 rm 操作永远不会自动批准
  • 撤销 —— /undo 通过文件历史快照回滚上一轮的文件编辑

完整设计和当前边界请参见 Permission Model

Privacy

Installation

git clone https://atomgit.com/atomgit_atomcode/atomcode.git
cd atomcode
cargo install --path crates/atomcode-cli --locked

二进制文件将生成在 target/release/atomcode 并安装到 macOS / Linux / 鸿蒙 PC 的 ~/.cargo/bin/atomcode,以及 Windows 的 $env:USERPROFILE/.cargo/bin/atomcode.exe。请确保 ~/.cargo/bin(Windows 上为 %USERPROFILE%\.cargo\bin)已添加到你的 PATH 中。

若要编译但不安装,请运行:

cargo build --release

二进制文件将生成在 target/release/atomcode 路径下。

包管理器

AtomCode CLI 也可通过以下包管理器进行安装:

# Install using npm
npm install -g @atomgit.com/atomcode

# Install using Homebrew
brew install --cask atomcode

系统要求

  • Rust 1.88 或更高版本(用于构建;旧版 Cargo 无法解析当前锁定文件)
  • 来自任何受支持提供商的 API 密钥(或用于 /login 的 AtomGit 账户)

卸载

移除 AtomCode 并(可选)删除其数据:

atomcode uninstall                # interactive: per-group prompts
atomcode uninstall --keep-data    # only remove binary + PATH edit
atomcode uninstall --purge        # remove everything, including ~/.atomcode
atomcode uninstall --dry-run      # show plan, change nothing

如果二进制文件已损坏或丢失:

curl -fsSL https://raw.atomgit.com/atomgit_atomcode/atomcode/raw/main/scripts/uninstall.sh | sh
# Windows:
irm https://raw.atomgit.com/atomgit_atomcode/atomcode/raw/main/scripts/uninstall.ps1 | iex

默认情况下会保留凭据(auth.tomlmcp.jsonconfig.tomlATOMCODE.md);传递 --purge 也会将其删除。

快速开始

1. 首次运行

atomcode

首次运行时,设置向导将引导你完成 LLM 提供商的配置:

Welcome to AtomCode! Let's set up your first provider.

Select provider:
  [1] Claude (Anthropic)
  [2] OpenAI
  [3] OpenAI Compatible (DeepSeek, Qwen, Zhipu, Moonshot...)
  [4] Ollama (local)

2. 配置

配置文件存储在 ~/.atomcode/config.toml。一个最小化的单一提供程序设置如下:

default_provider = "deepseek"

[providers.deepseek]
type           = "openai"
api_key        = "sk-..."
model          = "deepseek-chat"
base_url       = "https://api.deepseek.com/v1"
context_window = 64000

您可以声明多个提供商,并使用 /model/provider 在它们之间切换。涵盖 Claude / OpenAI / OpenAI 兼容端点(DeepSeek、GLM、SiliconFlow、OpenRouter...)/ Ollama 以及 [datalog] 部分的完整参考,可在 docs/config.example.toml 中找到 — 复制并编辑您需要的部分。

手动编辑 config.toml 后,在 atomcode 内运行 /reload 即可应用更改,无需重启。

3. 开始编码

# Open in your project directory
cd your-project
atomcode

# Or specify directory
atomcode -C /path/to/project

# Or specify model
atomcode --model gpt-4o

# Headless (single prompt, reply on stdout)
atomcode -p "Explain the agent loop in this repo"

# Read prompt from file
atomcode --prompt-file task.md

在无头模式下,需要批准的 bash 调用会自动获得批准并记录到标准错误输出;其他需要批准的工具将被拒绝。

然后只需输入您想要的内容:

> Fix the login bug where users get redirected to 404 after OAuth callback

> Add a dark mode toggle to the settings page

> Refactor the database module to use connection pooling

> Write tests for the payment processing module

快捷键

输入

按键 操作
Enter 发送消息
Shift+Enter 换行(需要 Kitty 键盘协议)
Ctrl+Enter 换行(需要 Kitty 键盘协议)
Ctrl+J 换行(需要 Kitty 键盘协议)
Alt+Enter 换行(大多数终端;见下方兼容性说明)
\ + Enter 换行(适用于所有终端 — 输入 \ 并按 Enter;\ 将被自动移除)
Esc 清除输入 / 取消流
Up/Down 浏览输入历史
Tab 接受建议
Ctrl+U 清除行
Ctrl+W 删除单词
Ctrl+K 删除到行尾
Ctrl+V 从剪贴板粘贴图片(Windows:使用 /paste,见下文)

换行组合键的终端兼容性:

  • Shift+EnterCtrl+EnterCtrl+J 都需要支持 Kitty 键盘协议的终端 — kitty、WezTerm、Alacritty、iTerm2 ≥3.5、Windows Terminal ≥1.21。旧版终端会将它们识别为普通 Enter(即发送消息)。
  • Alt+Enter 在大多数终端上可通过字节级操作工作,但 Windows Terminal 默认将其绑定为“切换全屏” — 需在设置 → 操作中移除该绑定以释放功能。
  • Xshell 不支持 Kitty 协议;可在其键盘映射设置中,将某个未使用的组合键映射为发送 ESC, Enter\x1b\r)以实现相同效果,或通过剪贴板粘贴多行文本(已启用带括号的粘贴功能)。

在 Windows 上粘贴图片: Windows Terminal 和 conhost 将 Ctrl+V 绑定到自身的 粘贴 操作,该操作仅转发剪贴板中的 CF_UNICODETEXT — 纯图片剪贴板不会发送任何内容,因此应用内的 Ctrl+V 处理程序无法触发。有两种解决方法:

  1. 使用 /paste — 该斜杠命令会提取剪贴板图片并将其附加为 [Image #N]。适用于所有终端,包括 Windows Terminal、PowerShell 7、conhost 和 git bash。Windows 系统上 TUI 的右下角提示会自动显示 Image in clipboard · /paste
  2. 若希望保留 Ctrl+V 的使用习惯:打开 Windows Terminal 的 settings.jsonCtrl+, → “打开 JSON 文件”),删除 "actions" 下的 { "command": "paste", "keys": "ctrl+v" } 条目,或将其重新绑定为 ctrl+shift+v。重启后,Ctrl+V 会直接传递给 atomcode。

Git Bash(MinTTY)不会拦截 Ctrl+V,因此可直接使用。

导航

按键 操作
Ctrl+上/下箭头 滚动聊天(3行)
PageUp/PageDown 滚动聊天(整页)
Ctrl+L 清除对话
Ctrl+Shift+C 复制选中内容
Ctrl+C 取消操作(双击退出)

斜杠命令

命令 操作
/resume 恢复或切换会话
/session 创建新会话
/bg 将当前会话转入后台;子命令:/bg list/bg <N>/bg drop <N>/bg help
/background <task> 兼容别名:在 /bg 插槽中启动一次性任务
/provider 管理模型提供商
/model 切换模型/提供商
/login 通过 AtomGit OAuth 登录
/cd 更改工作目录
/paste 从剪贴板附加图片(Windows 系统下 Ctrl+V 的备选方案)
/undo 撤销上一轮的编辑
/diff 显示当前更改的 git 差异
/cost 显示当前会话的 token 使用情况
/copy 复制上一条 AI 回复
/clear 清除对话
/issue 在 AtomGit 上创建 issue
/config 编辑配置文件
/status 显示登录状态和模型信息
/logout 从 AtomGit 登出
/help 显示命令和快捷键
/quit 退出(或按 Ctrl+C 两次)

架构

AtomCode 是一个 Rust 工作区,包含四个 crate:

atomcode/
  crates/
    atomcode-core/     # Headless library — no TUI dependency
      agent/           # AgentLoop: autonomous tool-use loop
      turn/            # TurnRunner, datalog, permission decider
      config/          # Config loading, provider configs
      conversation/    # Message types, windowed context
      provider/        # LlmProvider trait + OpenAI/Claude/Ollama
      tool/            # Tool trait + built-in tool implementations
      session/         # Persistent sessions
      skill.rs         # User-defined skills

    atomcode-tuix/     # Terminal UI — retained-mode renderer (CC-style normal mode)
      event_loop/      # App state machine, command dispatch
      render/          # Cell-based renderer, diff, retained-mode frame loop
      modals/          # Picker UIs (dir, model, session, provider, issue)

    atomcode-cli/      # Binary entry point (TUI + headless -p mode)
      main.rs          # CLI args, first-run wizard, launch
      auth/            # AtomGit OAuth client

    atomcode-daemon/   # HTTP/SSE API server over atomcode-core

设计原则

  1. 技术栈无关 — 绝不硬编码特定语言的逻辑。通过描述文件(package.jsonCargo.tomlpyproject.tomlpom.xml 等)动态检测项目类型。

  2. 解耦代理AgentLoop 作为独立的异步任务运行,通过通道(AgentCommand / AgentEvent)与 TUI 通信。核心库完全没有 TUI 依赖,这也是守护进程得以实现的基础。

  3. 工具安全性 — 所有破坏性操作均需用户明确批准。工具故障会成为 LLM 的观察结果,绝不会导致程序崩溃。

  4. 上下文感知 — 支持令牌预算感知的对话窗口管理、项目文件树注入以及每轮系统提醒,确保模型在不超出上下文限制的前提下保持专注。

项目指令文件

在项目根目录创建 .atomcode.md 文件,为 AtomCode 提供持久化上下文:

# Project Instructions

This is a Vue 3 + TypeScript project using Pinia for state management.

- Always use Composition API with `<script setup>`
- Use TailwindCSS for styling, no inline styles
- Run `npm run lint` after editing .vue/.ts files

AtomCode 会自动读取此文件并将其包含在系统提示中。AtomCode 还支持 AGENTS.md(AI 编码代理的 开放标准)作为替代方案 — 若两个文件同时存在,.atomcode.md 将优先生效。

开发

先决条件

  • Rust 1.88+ — 通过 rustup 安装
  • Git
  • 受支持的 LLM 提供商 API 密钥(用于运行时测试)

从源代码构建

git clone https://atomgit.com/atomgit_atomcode/atomcode.git
cd atomcode

# Debug build (fast compilation, slower runtime)
cargo build

# Release build (slower compilation, optimized binary)
cargo build --release

开发环境运行

# Run the TUI directly (debug mode)
cargo run -p atomcode-cli

# With arguments
cargo run -p atomcode-cli -- -C /path/to/project
cargo run -p atomcode-cli -- --model gpt-4o

# Headless mode
cargo run -p atomcode-cli -- -p "summarize this repo"

# Daemon (HTTP API)
cargo run -p atomcode-daemon

测试

# Run all tests
cargo test

# Run tests for a specific crate
cargo test -p atomcode-core
cargo test -p atomcode-tuix

# Run a specific test
cargo test -p atomcode-core test_name

实用命令

# Check compilation without building
cargo check

# Format code
cargo fmt

# Run linter
cargo clippy

# Build and install to ~/.cargo/bin
cargo install --path crates/atomcode-cli

贡献指南

欢迎参与贡献!atomcode 目前处于积极开发阶段。

贡献步骤

  1. ** Fork **项目到您的 AtomGit 仓库
  2. 克隆您的仓库到本地:
    git clone https://atomgit.com/<your-username>/atomcode.git
    cd atomcode
    
  3. 创建分支用于您的修改:
    git checkout -b feat/your-feature
    # 或
    git checkout -b fix/your-bugfix
    
  4. 进行修改,确保项目能够构建且测试通过:
    cargo build && cargo test && cargo clippy
    
  5. 提交修改并撰写清晰的提交信息:
    git commit -m "feat: add xxx support"
    
  6. 推送分支并向 main 分支提交Pull Request

分支命名规范

前缀 用途
feat/ 新功能开发
fix/ 缺陷修复
refactor/ 代码重构(不改变功能行为)
docs/ 仅文档更新
chore/ 构建流程、CI 配置或工具链变更

开发准则

  • 遵循项目核心原则——尤其注意技术栈中立性
    (核心引擎中不应包含特定语言/框架的逻辑;通过探测 package.json / Cargo.toml / pom.xml 等文件,由适配器处理特定逻辑)
  • 所有工具故障必须优雅处理——将错误作为观察结果返回给 LLM,绝对禁止程序崩溃(panic)
  • 破坏性操作必须获得用户批准
  • 保持系统提示简洁(约 1.5K tokens)
  • 提交前运行 cargo fmtcargo clippy

入门方向

  • 添加新工具——在 crates/atomcode-core/src/tool/ 中实现 Tool trait
  • 添加新 provider——在 crates/atomcode-core/src/provider/ 中实现 LlmProvider
  • 改进 UI——渲染逻辑位于 crates/atomcode-tuix/src/render/
  • 修复缺陷——查看 Issues 中的开放缺陷

社区交流

扫描下方二维码添加微信,加入 atomcode 社区交流群——分享反馈、报告问题,与其他用户和维护者交流:

AtomCode WeChat community QR code

许可协议

MIT 许可协议。详情参见 LICENSE


使用 Rust、ratatui 开发,倾注了无数个深夜的心血。

项目介绍

Claude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get Started

https://atomcode.atomgit.com/定制我的领域

下载使用量

0

项目总下载次数(含Clone、Pull、 zip 包及 release 下载),每日凌晨更新

语言类型

Rust56.11%
JavaScript30.94%
HTML6.55%
TSX2.13%
CSS1.67%