easy-agent

ConardLiMIT活跃维护

开箱即用的终端编程智能体,代码分层清晰易读,内置权限规则、系统沙箱、MCP、技能与子智能体,支持 Anthropic、OpenAI 兼容、Gemini 及本地模型。

Production-ready open source terminal coding agent with readable, layered code: permission rules, OS sandboxing, MCP, skills, sub-agents, and Anthropic, OpenAI-compatible, Gemini, or local models.

暂无版本1,027star +3 / 7 天143fork同步于 2026-11-10 11:51 UTC

怎么上手

由 README 提炼,执行前请确认
npm install -g --ignore-scripts eagent
eagent --version
硬件要求按 README 说明

README 未说明显存或 GPU 要求;需 Node.js 22 及以上,本地模型可指向 Ollama 等 OpenAI 兼容端点。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

终端里的开源编码 Agent,用可读的分层代码实现权限规则、沙箱与多模型接入

开箱即用的终端编程智能体,代码分层清晰易读,内置权限规则、系统沙箱、MCP、技能与子智能体,支持 Anthropic、OpenAI 兼容、Gemini 及本地模型。

核心能力

  • 按 allow/ask/deny 规则管控文件、命令与网络操作
  • macOS 用 Seatbelt、Linux 用 bubblewrap 做失败即阻断的 Shell 沙箱
  • 支持 Anthropic、OpenAI 兼容、Gemini 与本地模型配置
  • 用 /rewind 回滚文件检查点,支持会话恢复与上下文压缩
  • 通过 MCP、skills、子 Agent、hooks、插件扩展能力

容易踩的坑

必须使用 Node.js 22 或更新版本,旧版本会直接退出;Linux 沙箱需另装 bubblewrap、socat、rg 并启用非特权用户命名空间;首次在目录中使用需确认工作区信任,否则项目配置与 .env 不生效。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Easy Agent

    A terminal coding agent that reads your code, edits files, and runs commands under permission rules you control.

    Easy Agent banner

    Easy Agent (eagent) runs in your terminal next to your repository. Describe a task and it plans the work, reads and changes files, runs tests or shell commands, and reports back. Every action that can change your machine goes through permission rules, workspace trust, and an optional OS-level sandbox. It works with Anthropic, OpenAI-compatible, Gemini, and local models.

    The code is written to be read as well as run. Model communication, the agentic loop, tools, permissions, context management, and each extension system live in separate layers. The documents linked below explain how the security-relevant parts behave and why, and the learning path walks through the layers in order with code snapshots, which helps if you want to build or customize an agent of your own.

    中文文档:README.zh-CN.md

    What you can use it for

    • Find your way around an unfamiliar codebase: ask where something is handled, how a flow works, or what a change would touch.
    • Make multi-file changes, review the diff, and undo them with /rewind if they are wrong.
    • Run builds and tests, read the failures, and iterate on a fix.
    • Plan a change first in read-only Plan Mode, then carry it out.
    • Script it: pipe input into eagent -p and read text, JSON, or NDJSON output in CI or shell scripts.
    • Connect your own tools through MCP servers, skills, custom agents, hooks, and plugins.

    Install

    Requirements: Node.js 22 or newer, npm, and credentials for at least one supported model provider.

    npm install -g --ignore-scripts eagent
    eagent --version
    

    Or try it without installing:

    npx --yes eagent@latest
    

    On macOS and Linux an installer is also available. It checks Node.js, installs the same npm package with --ignore-scripts, and verifies that eagent is on PATH. It does not install Node.js or run package lifecycle scripts.

    curl -fsSL https://raw.githubusercontent.com/ConardLi/easy-agent/main/install.sh | sh
    

    The package installs two commands, eagent and the long alias easy-agent.

    Quick start

    export ANTHROPIC_AUTH_TOKEN="your-token"
    cd your-project
    eagent
    

    On first use in a folder, Easy Agent asks whether you trust it. Then type a request, for example explain how requests are authenticated in this repo. Type /help for commands; press Ctrl+D to exit.

    Core capabilities

    • File and code tools: Read, Write, Edit, MultiEdit, Glob, Grep, Bash, and PowerShell on Windows
    • Web and external tools: WebFetch, WebSearch, MCP tools and resources
    • Safe execution: allow/ask/deny rules, Plan Mode, Auto Mode, workspace trust, hooks, controlled subprocesses, private local data, and fail-closed shell sandboxing on macOS and Linux
    • Long-running work: TodoWrite, persistent task graphs, sub-agents, background runs, Git worktree isolation, and Agent Teams
    • Context and continuity: durable persistence, resume, compaction, token budgets, project memory (AGENTS.md / AGENT.md), file checkpoints, and rewind
    • Extensibility: skills, custom agents, slash commands, output styles, hooks, MCP servers, plugins, and static marketplaces
    • Interfaces: interactive terminal UI, headless text/JSON/NDJSON output, an embeddable session SDK (eagent/sdk), JSON-RPC over stdio (eagent --rpc) for desktop apps and other programs, the Agent Client Protocol (eagent --acp) for Zed, JetBrains IDEs, and other ACP editors, images and screenshots, and multiple model protocols

    Supported platforms

    PlatformStatusShell toolShell sandbox
    macOSSupportedBashSeatbelt; needs rg
    Linux, WSL2SupportedBashbubblewrap; needs bubblewrap, socat, rg, and unprivileged user namespaces
    WindowsSupported without sandboxPowerShellNot available; an enabled fail-closed sandbox blocks PowerShell
    • Node.js 22 or newer is required on every platform. Older versions exit with an explanatory message.
    • The install.sh installer supports macOS and Linux. On Windows, install with npm.
    • On Windows, local data relies on the user profile's ACLs instead of POSIX 0600/0700 modes. /doctor reports this.
    • Clipboard image paste needs pngpaste or osascript on macOS and xclip or xsel on Linux.

    See Sandbox security for per-platform setup, including the Ubuntu AppArmor restriction on user namespaces.

    Security model

    Easy Agent assumes the model can make mistakes and that a repository you open may be hostile. Several independent layers limit what a session can do:

    • Permission rules. Tool calls that change files, run commands, or reach the network are checked against allow, ask, and deny rules. Deny rules always win. In the default mode anything not allowed is asked; Bash commands that are proven read-only can run without a prompt (analysis rules).
    • Permission modes. default asks before risky actions. plan (--plan) allows only read-only tools. auto (--auto) lets a classifier approve safe calls, block risky ones, and fall back to a prompt when unsure. Headless runs (-p) deny calls that would prompt unless you pass --dangerously-skip-permissions; deny rules still apply.
    • Workspace trust. Project settings, .env, project MCP servers, hooks, plugins, and model profiles are ignored until you trust the folder. Trust is stored in your home directory, so a repository cannot mark itself trusted, and project files cannot replace credentials inherited from your shell (details).
    • Path boundaries. File tools resolve real paths and refuse to follow symbolic links out of the workspace and its allowed directories (details).
    • Shell sandbox. When sandbox.enabled is set, Bash runs inside an OS sandbox with an allow-only write policy and proxy-filtered network. If the sandbox cannot start, the command is blocked rather than run unsandboxed (details).
    • Local data. Sessions, settings, trust state, and logs are private to your account. Stream debug logging is off unless you enable it and redacts credentials when on (details).

    Easy Agent sends no analytics or telemetry. Network requests go to the model provider you configure, to MCP servers and plugin sources you add, and to WebFetch/WebSearch targets when those tools are allowed. /doctor probes the configured provider endpoint for reachability.

    Configuration

    Settings are JSON files merged in this order, from lowest to highest priority:

    1. User: ~/.easy-agent/settings.json
    2. Project: <project>/.easy-agent/settings.json (shared, applied once the folder is trusted)
    3. Local: <project>/.easy-agent/settings.local.json (personal, applied once the folder is trusted)
    4. Command line: --settings <file>, --model, --permission-mode, and similar flags
    5. Managed policy: /Library/Application Support/EasyAgent/managed-settings.json on macOS, /etc/easy-agent/managed-settings.json on Linux, %PROGRAMDATA%\EasyAgent\managed-settings.json on Windows

    A project .env is applied after project and local settings, only for a trusted folder. Feature switches are described in Configuration and feature controls.

    For a raw Anthropic model name, environment variables are enough:

    export ANTHROPIC_AUTH_TOKEN="your-token"
    export ANTHROPIC_MODEL="claude-sonnet-4-20250514" # optional
    eagent
    

    Named Anthropic, OpenAI-compatible, Gemini, and local profiles go in settings.json:

    {
      "defaultModel": "gpt",
      "models": {
        "gpt": {
          "protocol": "openai-chat",
          "model": "gpt-5.1",
          "baseURL": "https://api.openai.com/v1",
          "apiKey": "${OPENAI_API_KEY}"
        },
        "gemini": {
          "protocol": "gemini",
          "model": "gemini-2.5-pro",
          "apiKey": "${GEMINI_API_KEY}"
        },
        "ollama": {
          "protocol": "openai-chat",
          "model": "qwen2.5-coder",
          "baseURL": "http://localhost:11434/v1"
        }
      }
    }
    

    Select a profile with eagent --model gpt or /model gpt inside the REPL.

    Environment variablePurpose
    ANTHROPIC_AUTH_TOKENAnthropic API token or compatible gateway token
    ANTHROPIC_BASE_URLOptional Anthropic-compatible endpoint
    ANTHROPIC_MODELDefault raw Anthropic model name
    OPENAI_API_KEYReferenced by OpenAI-compatible profiles
    GEMINI_API_KEYReferenced by Gemini profiles
    WEB_SEARCH_API_KEYOptional WebSearch provider key

    Run /config list, /model list, or /doctor to inspect the effective setup. Credential values are always redacted.

    Where data is stored

    LocationContents
    ~/.easy-agent/settings.jsonUser settings
    ~/.easy-agent/state.jsonWorkspace trust decisions and machine-level state
    ~/.easy-agent/AGENT.mdUser-wide memory loaded into every session
    ~/.easy-agent/projects/Session transcripts (JSONL) and per-project memory
    ~/.easy-agent/file-history/File checkpoints used by /rewind
    ~/.easy-agent/tasks/, plans/, teams/Task graphs, Plan Mode plans, Agent Team state
    ~/.easy-agent/skills/, agents/, commands/, output-styles/User extensions
    ~/.easy-agent/plugins/, mcp/Installed plugins, MCP OAuth tokens and artifacts
    ~/.easy-agent/stream-debug.logOnly when EASY_AGENT_DEBUG_STREAM=1 is set
    <project>/.easy-agent/Project settings, local settings, and project extensions
    <project>/AGENTS.md, <project>/AGENT.mdProject memory you write or create with /init; both load when present, AGENTS.md first
    <git root>/.easy-agent/worktrees/Git worktrees for isolated sub-agents

    On macOS and Linux, ~/.easy-agent is created with mode 0700 and sensitive files with 0600. Removing the npm package keeps this directory; delete it yourself to remove all data.

    Common usage

    eagent                         # interactive REPL
    eagent --model gpt             # select a model profile
    eagent --plan                  # read-only planning mode
    eagent --auto                  # classifier-assisted permission mode
    eagent --resume                # resume the latest session
    eagent --resume <session-id>   # resume a specific session
    eagent -p "summarize this repo"                 # headless text output
    eagent --trust-project-config -p "summarize this repo" # allow reviewed project config once
    eagent -p "list the tools" --output-format json # machine-readable output
    git diff | eagent -p "review this patch"         # combine stdin and a prompt
    

    Structured JSON and NDJSON messages follow the versioned headless output schema. Unknown cost is reported as null, not as a measured zero.

    Run eagent --help for every startup option. Useful REPL commands include:

    CommandPurpose
    /helpList commands and shortcuts
    /model, /mode, /think, /effortControl model and reasoning behavior
    /config, /status, /doctor, /contextInspect configuration and runtime health
    /resume, /history, /export, /copyWork with sessions and output
    /rewind, /diffInspect or restore file changes
    /permissionsInspect permission rules
    /skills, /agents, /hooks, /mcpInspect extension registries
    /plugin, /marketplaceInstall and manage plugins
    /memoryInspect or edit project memory

    Upgrade and uninstall

    Upgrade the global package, or re-run the installer:

    npm install -g --ignore-scripts eagent@latest
    

    Remove it with:

    npm uninstall -g eagent
    

    User configuration and sessions under ~/.easy-agent/ are intentionally preserved when the npm package is removed.

    Troubleshooting

    1. Run eagent --version and confirm Node.js with node --version.
    2. Run /doctor inside Easy Agent to inspect credentials, settings, MCP, plugins, sandbox support, and writable paths.
    3. Run /status and /config list to verify the active model and configuration sources.
    4. If a global install succeeds but eagent is not found, add the npm global bin directory associated with npm prefix -g to PATH, then open a new shell.
    5. Report reproducible problems through GitHub Issues.

    Never include API keys, .env contents, or private prompts in an issue.

    Architecture

    Easy Agent keeps five runtime layers separate:

    Terminal UI
        ↓
    QueryEngine (multi-turn orchestration)
        ↓
    Agentic Loop (reason → tool → observe)
        ↓
    Tools and permission enforcement
        ↓
    Provider API and streaming adapters
    

    The npm package ships a single readable ESM bundle with a source map (paths only, no embedded sources), so stack traces in bug reports point at real source lines. Licenses of bundled third-party code are in dist/THIRD_PARTY_LICENSES.txt. The version-pinned @anthropic-ai/sandbox-runtime dependency supplies the platform helpers for process isolation.

    Development

    git clone https://github.com/ConardLi/easy-agent.git
    cd easy-agent
    npm install
    npm run dev
    

    npm run verify:production is the offline pull-request gate and npm run verify:release is the full release gate. See Testing and Releasing.

    If you want to study how the agent was built step by step, the learning path lists the development milestones and their code snapshots.

    Contributing

    The project is still evolving quickly and is not accepting external pull requests yet. Issues with clear reproduction steps are welcome.

    License

    MIT. Bundled third-party packages keep their own licenses; see dist/THIRD_PARTY_LICENSES.txt in the installed package.