Axl README

项目的 README,来自 github.com/Observal/Axl。合并为一个 markdown 文件:README.md。

Axl, a pixel-art axolotl

 █████╗ ██╗  ██╗██╗
██╔══██╗╚██╗██╔╝██║
███████║ ╚███╔╝ ██║
██╔══██║ ██╔██╗ ██║
██║  ██║██╔╝ ██╗███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝

Axl is a local-first agent harness: one daemon owns your coding session, and every client is a window into it.

License Node.js TypeScript CI Contributors Stars Discord Server

Axl is short for Axolotl. If you find it useful, please consider giving it a star. It helps others find the project.


What is Axl and what does it solve?

Most agent harnesses tie a session to the client that started it. Close the terminal and the work stops. Open a browser and you get a second agent with its own loop, tools, and history. Provider code leaks into the core, and sandboxing is whatever the client happened to implement.

Axl takes the opposite approach:

  1. One authority per session. A single daemon owns the model loop, tools, policy, and canonical event history. Terminal, browser, and SDK clients render the same state and submit intent. None of them is an independent agent.
  2. Isolation that fails closed. Model-selected commands run in Bubblewrap, Landlock, seccomp, Seatbelt, or a rootless OCI container. If the isolation you asked for is unavailable, Axl refuses to run instead of downgrading.

Everything the model sees is recorded in an append-only JSONL log, so sessions resume after a crash, replay deterministically, and can be audited.

Why developers use Axl


Quick start

Axl requires Node.js ^22.19.0 or >=24. Linux needs Bubblewrap for native sandboxing. macOS uses Seatbelt. Rootless Podman or Docker is optional.

1. Install

git clone https://github.com/Observal/Axl.git && cd Axl
pnpm install --frozen-lockfile
pnpm run install:cli

See SETUP.md for requirements and platform notes.

2. Connect a model

axl providers            # list providers and authentication status
axl models openai        # list models for one provider
axl login openai api_key

3. Start a session

axl                      # terminal UI
axl web                  # browser UI over the same daemon

The CLI connects to the matching local daemon and starts one if needed. Run /commands for actions and /hotkeys for keyboard controls inside the UI.

axl -r                          # pick a saved session
axl <session-id>                # resume a known session
axl --cwd ~/code/project        # choose the workspace
axl --profile exec              # sandboxed Bash only
axl doctor                      # check local sandbox support
axl print "describe this repo"  # one headless response
axl json "describe this repo"   # canonical events as JSONL
axl rpc                         # JSONL RPC over stdin and stdout

How Axl works

flowchart LR
  subgraph Clients[Presentation clients]
    TUI[Terminal UI]
    Web[Web UI]
    Yours[Your own client]
  end

  SDK[TypeScript SDK<br/>retry, cursors, projections]
  Protocol[Protocol<br/>events, RPCs, validation]

  subgraph Authority[Authoritative daemon process]
    Daemon[Daemon<br/>sessions, presence, workspace RPCs]
    Kernel[Kernel<br/>JSONL, agent loop, tools, policy]
    AI[AI providers]
    Extensions[Extensions<br/>prompts, Skills, MCP]
    Sandbox[Sandbox<br/>native and OCI]
  end

  TUI --> SDK
  Web --> SDK
  Yours --> SDK
  SDK -->|typed RPC and events| Daemon
  SDK -. validates with .-> Protocol
  Daemon --> Kernel
  AI -. model port .-> Kernel
  Extensions -. public extension API .-> Kernel
  Sandbox -. command execution .-> Kernel

Every operation takes the same path:

  1. A client submits typed user intent.
  2. The daemon validates capability, policy, and operation ownership.
  3. The kernel performs the operation.
  4. The canonical event is appended before any derived state changes.
  5. Every subscribed client receives and projects the same event.

Boundaries are deliberate. The protocol has no dependencies. The kernel depends only on the protocol and Node.js. Provider behavior lives in packages/ai. Clients never own loops, tools, policy, or history. See Client authority and adapter boundaries.

Sessions belong to the daemon

Steering and follow-ups

While a turn is active, Enter sends steering that lands at the next model boundary, and Alt+Enter queues a follow-up that runs when the turn would otherwise end. Both are FIFO, and steering wins at each boundary. Durable queued prompts are recorded before acknowledgement and pause after a restart, so Axl never guesses whether deferred work should run again.


What works today

Area Capability
Sessions Create, list, resume, fork, clone, interrupt, detach, reconnect, compact, configure, dispose
Durability Append-only JSONL, operation IDs, crash-safe journal, restart reconciliation, deterministic replay
Clients Terminal UI, local web UI, headless print, json, and rpc, and a typed SDK
Models Over 35 providers, provider-qualified selection, usage and cost reporting, streaming text and reasoning
Tools read, write, edit, bash, web_fetch, web_search
Extensions Agent Skills, MCP 2025-11-25 (stdio and Streamable HTTP), prompt templates, daemon extensions
Workspace Bounded file listing and reads, Git status, structured diffs, last-turn checkpoints
Isolation Bubblewrap, Landlock, seccomp, and rlimits on Linux; Seatbelt on macOS; rootless Podman or Docker
Safety Path canonicalization, symlink-escape rejection, secret redaction, bounded messages
Extras Axolotl mascot that reflects session state, and Axl Lounge word and puzzle games for waiting on long turns

Terminal and web clients

The terminal UI has Unicode-aware multiline editing, searchable history, themes, model and thinking controls, retained tool cards with diff previews, image attachments, regular and fullscreen modes, optional Vim editing, and MCP approval dialogs.

The web client is a responsive, static React app served by an authenticated loopback gateway. Run axl web to open it. It supports session selection, synchronized history, split panes, a command palette, model picker, workspace changes, and the same controls the daemon grants the terminal. Closing the browser detaches only that browser.

Both clients use only the public SDK. See web client architecture and gateway security.


Models

Axl ships with providers including OpenAI, Anthropic, Google, Vertex, Amazon Bedrock, GitHub Copilot, xAI, DeepSeek, Mistral, Groq, OpenRouter, Cloudflare, Fireworks, Together, Hugging Face, Moonshot, Z.ai, MiniMax, Qwen, and OpenCode. Add local or hosted endpoints in ~/.axl/models.json.

axl providers      # offline listing
axl login <id>     # API key or OAuth
axl refresh        # explicit catalog refresh

Provider secrets never pass through daemon RPC, the SDK, or canonical events. See the provider reference for every environment variable, endpoint, region, and limitation.


Sandboxing

Axl refuses to run model-selected commands when required isolation is unavailable.

Backend Mechanism
Linux Bubblewrap namespaces, Landlock, versioned seccomp policy, dropped capabilities, resource limits
macOS Seatbelt, with unavailable controls reported explicitly
OCI Rootless Podman or Docker with seccomp and cgroups v2, digest-pinned images only
axl --sandbox podman --image docker.io/library/bash@sha256:<64-hex-digest>

axl --unsafe disables OS isolation and file-tool path policy. Unsafe sessions use separate state and stay visibly labeled. See sandbox backends and the security policy.

Session profiles

Profile Purpose
standard Normal coding session with built-in tools and extensions
minimal Small tool surface for focused work
chat Tool-free conversation
exec Bash only, with no Skills, MCP, file tools, or web tools

See session profiles.


Extending Axl

First-party and third-party features share one public extension API. Disabled features add no prompt content, UI, or background work.

Details are in Customizing Axl and Daemon extensions.


Build a client

@axl/sdk is in-tree and private for now. It gives you typed requests, capability negotiation, idempotent retry, resumable subscriptions with cursor acknowledgement and gap recovery, a Unix-socket adapter, and a deterministic conversation projector. A new client should use the SDK instead of parsing wire messages. The daemon stays the authority on every platform.


Repository map

Package Responsibility
packages/protocol Dependency-free events, RPCs, capabilities, and validation
packages/kernel Event log, agent loop, tool protocol, cancellation, queues, policy, extension host
packages/ai Provider contracts, credentials, model metadata, dialects
packages/daemon Sessions, operation coordination, subscriptions, presence, workspace RPCs
packages/sdk Typed client, reconnect, cursors, projections
packages/runtime Assembles providers, tools, extensions, and sandbox for the daemon
packages/sandbox Native and OCI confinement
packages/cli Startup, placement, provider setup, client launch
packages/tui Terminal client
packages/web Web client
packages/ui, packages/theme Shared presentation components and themes
packages/extensions/* Prompts, Skills, MCP, Lounge, and the extension API and host

More in CODE_STRUCTURE.md.

Documentation

Contributing

pnpm install --frozen-lockfile
pnpm check          # build, typecheck, lint, format, tests, boundaries
reuse lint

Read CONTRIBUTING.md, the development guide, and AI_POLICY.md first. Every commit needs a DCO Signed-off-by trailer. Also see GOVERNANCE.md, SECURITY.md, and the code of conduct.

Mascot

The axolotl is pixel art by Dheirav. It reacts to what the session is doing in both the terminal and web clients. See mascot art.

License

Axl is licensed under Apache-2.0. See LICENSE and NOTICE.

Axl (Observal/Axl)

正在搜索数据库…

这是什么?Axl(Axolotl 的缩写)是一个面向开发者的本地优先 agent 框架:一个持久化的编码会话可以跨多个客户端共享,由单一后台守护进程统一管理,而不是让每个客户端各自带一套 agent 运行时。
这是一个成品应用,还是我用来构建客户端的框架?目前它是一个终端编码 agent:一个 CLI 启动 TUI 客户端,同时由后台守护进程负责会话、工具、策略和历史。客户端只是基于类型化协议和共享 SDK 的轻量渲染层,并不是独立的 agent。
怎么把它跑起来?你需要 Node.js ^22.19.0 或 >=24。目前还没有发布任何版本,所以要从本仓库运行;然后通过 axl providers 和 axl login 完成模型提供商的认证,/model 选择模型,CLI 会自动在后台帮你启动守护进程。
沙盒功能需要额外安装什么吗?在 Linux 上需要 Bubblewrap(Axl 会自行安装其固定版本的 Landlock 启动器);macOS 得益于内置的 Seatbelt,什么都不用装。Rootless Podman 或 Docker 是可选的,只有想用基于 OCI 的执行方式时才需要。
有什么坑吗——它达到生产可用了吗?没有——它还是预发布阶段,正在积极开发中。TUI、提示词模板、Agent Skills、MCP、Linux 加固和本地 OCI 执行目前可用;网页端、桌面端、移动端和托管中继服务还只是计划中。
这个工具只面向开发者,还是普通用户也能用?只面向开发者——具体来说,是那些想要一个终端编码 agent 的人:会话持久可恢复、文件/命令行/网页工具都在沙盒里运行、可以明确地干预控制,还能通过类型化 SDK 在同一个守护进程之上构建新的客户端。
它能在 Windows 上运行吗,还是只支持 Mac 和 Linux?原生支持的是 Linux(Bubblewrap、Landlock、seccomp)和 macOS(Seatbelt);没有提到 Windows。Rootless Podman 或 Docker 可以在之上额外提供一种可选的 OCI 执行模式。
所有东西都留在我的电脑上吗?是的——它是本地优先的:守护进程在本地管理你的会话、工具、策略和完整历史。只有调用模型提供商和使用 webfetch/websearch 工具时才会访问网络。
我的提供商 API 密钥存在哪里?存在提供商层(packages/ai)里,而不是守护进程中:提供商的密钥不会经过守护进程 RPC 或 SDK 投影,规范事件、游标和客户端投影中也绝不会包含凭据值或 OAuth 码。
如果 agent 正在工作时我关掉终端会怎样?什么都不会丢:会话属于守护进程,而不是终端。/detach 会让工作继续运行,你之后可以重新连上——axl -r 会打开一个恢复选择器,axl 则直接恢复已知的会话。只有 /quit 会中断工作并关闭守护进程。
这个 agent 开箱自带哪些工具?read、write、edit、bash、webfetch 和 websearch,全部受守护进程策略和沙盒约束。webfetch 会屏蔽私有和保留地址,并限制重定向次数和响应大小;websearch 默认使用 DuckDuckGo,设置 BRAVESEARCHAPIKEY 后则使用 Brave 的排序结果。
我能在 agent 执行过程中改变它的方向吗?可以。按 Enter 提交引导指令,它会在下一个模型边界生效;按 Alt+Enter 可以排队一条后续消息,在本轮本来要结束时发送。两者都按先进先出处理,引导指令优先于后续消息。
它支持 Agent Skills 和 MCP 吗?支持——提示词模板、Agent Skills 以及基于 stdio 和 Streamable HTTP 的 MCP 2025-11-25 目前都可用,它们作为扩展放在内核之外。可复用的 Markdown 提示词放在 ~/.axl/prompts 或 .axl/prompts 中,通过 /prompt 展开。
有哪些类似的项目?Baize, openrig, VTCode, octomind, lean-ctx, qwen-code, hyperfide-oss, iCode
作者
Observal
大小
7.3 MB
星标
1K
更新
提交Oct 05
时长
3个月
提交 · 90 天