⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣠⣶⣿⣿⣷⣶⡶⣶⣶⣆⠀⠀⠀⣴⣶⣶⠆
⠀⠀⠀⠉⢹⣿⣿⠉⠉⠀⠘⢿⣿⣧⣀⣾⣿⡿⠃⠀ Tiny, open, embeddable, native coding agent.
⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⠻⣿⣿⣿⠟⠀⠀⠀
⠀⠀⠀⢀⣿⣿⠃⠀⠀⠀⠀⢠⣦⠘⢿⣿⣷⡀⠀⠀ curl -fsSL https://fx.sh/setup.sh | bash
⠀⠀⠀⣸⣿⡟⠀⠀⠀⠀⣰⣿⣿⠗⠀⠻⣿⣿⣄⠀
⠀⠀⠀⣿⣿⠇⠀⠀⠀⠾⠿⠿⠋⠀⠀⠀⠘⠿⠿⠦ ⚠ Status: Experimental. Use at your own risk.
⠀⣸⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
fx is the smallest coding agent: one native binary with no runtime to install. It's written in Zig and runs the same on your laptop, in CI, or inside an agent sandbox.
It works with the model you choose, and its output is closer to a Unix shell than an IDE: the conversation prints into your scrollback instead of filling the screen. The same agent core runs in editors over the Agent Client Protocol (ACP) and in JavaScript apps through libfx.
- Small and fast: the Apple silicon release has a hard size limit, and startup is benchmarked on every pull request. CI fails a change if any measured command takes longer than 2 ms on Linux (benchmarks).
- Any model: use Vercel AI Gateway, your ChatGPT or Grok subscription, or any OpenAI-compatible endpoint such as Ollama or OpenRouter (custom connections).
- Inline output: the conversation stays in your terminal's scrollback, where you can scroll, search, and copy it like any other command's output. tmux bindings and copy mode keep working, and terminals that support the Program Status Protocol can show when fx is busy or waiting for you.
- Your own shell: commands run in your login shell with your aliases, functions, and
PATH. fx runs your startup files once and reuses the result, so a slow.zshrcdoesn't slow down every command. - Permissions: the default
automode runs routine work, such as editing project files and running tests, without asking. Anything else goes to a model that checks it for prompt injection or malicious behavior first. Switch toaskto approve each action yourself, or tofull-accessto turn the checks off (permissions). - Sessions: fx saves your conversations, so
fx -cpicks up where you left off in a project. When a conversation fills the model's context, fx compacts older turns and keeps their full text on disk for the agent to look up (sessions). - Skills, MCP, and subagents: fx loads skills from
.fx/skills,~/.fx/skills, and the folders other agents use, like.claude/skillsand.agents/skills. It connects to MCP servers (/mcp add slacksets up Slack), hands independent work to subagents, and follows your project'sAGENTS.md.
curl -fsSL https://fx.sh/setup.sh | bashfx runs on macOS and Linux, on x86_64 and arm64. The installer puts it in ~/.local/bin. fx checks for updates in the background, and fx upgrade installs the latest release right away. CHANGELOG.md lists what changed in each release. You can also try fx in your browser without installing anything.
Sign in with one of these:
fx login # Vercel AI Gateway
fx login codex # ChatGPT subscription
fx login grok # Grok subscription
fx setup # AI Gateway API keyThen open a project and start fx:
cd your-project
fxType what you want done and press Enter. /help lists the slash commands.
For a single request without the interactive shell, use fx ask. Add --json when a script needs to read the result:
fx ask "explain the changes in this repository"
fx ask --json "summarize the failing tests" | jq -r .final_outputEach request runs as a loop. fx sends the model your message, the conversation so far, your project's AGENTS.md, and short descriptions of the tools it can use. The model either replies or asks to call a tool: read or edit a file, run a shell command, search the web, load a skill, call an MCP server, or start a subagent. fx checks each call against your permission mode and rules, runs the ones that pass, and sends the results back. The loop ends when the model replies without asking for another tool.
Skill instructions and MCP tool schemas don't go to the model up front. They load when the model asks for them, which keeps the context small and leaves more room for your code.
fx prints every step inline as it happens and saves the session under ~/.fx/sessions/, so you can resume it later.
| Surface | Use it for |
|---|---|
fx ask |
One request from a script or CI job. --json returns structured output, and --resume continues a saved session. |
fx acp |
Editors and other Agent Client Protocol clients, over stdio. |
| libfx | The agent core as a JavaScript library, built as a native Node.js addon and as WebAssembly. createFxAgent() runs an agent with your own tools, and createFxTerminal() embeds the fx terminal. |
The libfx README and the libfx docs cover the API. The WebAssembly build is experimental.
examples/ has small libfx apps you can run with an AI Gateway API key:
node-chat: a terminal chat with streamed replies.browser-agent: the agent in WebAssembly behind a plain HTML form.nextjs-agent: a Next.js App Router form with a streaming route handler.nuxt-agent: the same idea in Nuxt, with a Nitro route.
The manual lives at fx.sh/docs. It covers models, permissions, configuration, skills, MCP, sessions, and every CLI and slash command.
For agents, fx.sh/llms.txt lists every page as Markdown, and fx.sh/llms-full.txt puts the whole manual in one file. Adding .md to any docs URL returns that page as Markdown.
Run /feedback inside fx to open the feedback form, or open an issue. If something looks wrong in your terminal, /trace creates a private diagnostic report you can attach (share feedback).
You need Zig 0.16.0 to build fx:
git clone https://github.com/vercel-labs/fx.git
cd fx
zig build
./zig-out/bin/fxTest your changes with the freshly built ./zig-out/bin/fx. A bare fx may be an older copy on your PATH.
zig build test runs the unit tests, which sit next to the code they cover. The end-to-end tests in tests/e2e/ drive the built binary through tmux and need Bun.
The source is laid out like this:
src/
main.zig entry point that wires everything together
core/ agent loop, sessions, config, permissions, skills
tools/ built-in tools: files, shell, web, skills, subagents
ui/ terminal rendering and input
gateway/ model provider transport
mcp/ MCP client
acp/ Agent Client Protocol server
sdk/ libfx, the JavaScript library
tests/ end-to-end tests and model evals
benchmarks/ startup, memory, and latency benchmarks
Read CONTRIBUTING.md before you open a pull request. It covers verification, CI, and PR labels. If a coding agent is helping you, AGENTS.md has the rules for working in this repository, and fx reads that file on its own when you start it here.
Report vulnerabilities through the contact page instead of a public issue.
Apache-2.0. Third-party licenses and attributions are in THIRD_PARTY_NOTICES.md.
Interface sounds by cuelume.