fx README

The project's README from github.com/vercel-labs/fx. As one markdown file: README.md.

 ⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀
 ⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
 ⠀⠀⠀⣠⣶⣿⣿⣷⣶⡶⣶⣶⣆⠀⠀⠀⣴⣶⣶⠆
 ⠀⠀⠀⠉⢹⣿⣿⠉⠉⠀⠘⢿⣿⣧⣀⣾⣿⡿⠃⠀             Tiny, open, embeddable, native coding agent.
 ⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⠻⣿⣿⣿⠟⠀⠀⠀
 ⠀⠀⠀⢀⣿⣿⠃⠀⠀⠀⠀⢠⣦⠘⢿⣿⣷⡀⠀⠀             curl -fsSL https://fx.sh/setup.sh | bash
 ⠀⠀⠀⣸⣿⡟⠀⠀⠀⠀⣰⣿⣿⠗⠀⠻⣿⣿⣄⠀
 ⠀⠀⠀⣿⣿⠇⠀⠀⠀⠾⠿⠿⠋⠀⠀⠀⠘⠿⠿⠦             ⚠ Status: Experimental. Use at your own risk.
  ⠀⣸⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
 ⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

fx

fx is a minimal coding agent CLI that still comes with batteries included. It's one native binary written in Zig, so there is no runtime to install, and it runs the same on your laptop, in CI, or inside an agent sandbox. Its output is closer to a Unix shell than an IDE, because the conversation prints into your terminal's scrollback instead of filling the screen.

fx is meant to be embedded and extended. Scripts call it with fx ask, editors connect over the Agent Client Protocol (ACP), and JavaScript apps run the same agent core through libfx with their own tools. Skills, MCP servers, and your project's AGENTS.md add to what the agent knows and can do.

Vercel Labs Product fx CLI release License: Apache-2.0

Features

Install

curl -fsSL https://fx.sh/setup.sh | bash

fx 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.

Quick start

Sign in with one of these:

fx login                    # choose a provider
fx login vercel             # Vercel AI Gateway
fx login vercel --api-key   # AI Gateway API key
fx login codex              # ChatGPT subscription
fx login grok               # Grok subscription

Then open a project and start fx:

cd your-project
fx

Type what you want done and press Enter. /help lists the slash commands. If something doesn't work, run fx doctor to check your setup.

To send one 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_output

Embed and extend

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, MCP clients, and skills, and createFxTerminal() embeds the fx terminal.

The libfx README and the libfx docs cover the API. The WebAssembly build is experimental.

The CLI also picks up these extensions:

Examples

examples/ has small libfx apps you can run with an AI Gateway API key:

Documentation

The manual at fx.sh/docs covers models, permissions, configuration, skills, MCP, sessions, and every CLI and slash command.

For coding agents

To learn fx, read the manual as Markdown. fx.sh/llms.txt indexes every page, fx.sh/llms-full.txt puts the whole manual in one file, and adding .md to any docs URL returns that page as Markdown. For the flags of the installed version, run fx <command> --help.

To run fx from your own tools, use fx ask. It takes the prompt as arguments or on stdin, writes its result to stdout and progress and diagnostics to stderr, and exits with a nonzero status when the request fails. With --json, the final answer is in final_output.

To inspect a user's setup, run fx status --json for configuration and runtime information, or fx doctor --json for health checks. Neither changes the setup.

fx ask uses the user's saved permission mode, which is auto unless they changed it. Pass --full-access only when the user asks for it, because it turns off fx's permission checks.

To change fx itself, read AGENTS.md first, then build and verify the change as described in Contributing.

Feedback

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 trace that you can share as a link from fx.sh/share (share feedback).

Contributing

You need Zig 0.17.1 to build fx:

git clone https://github.com/vercel-labs/fx.git
cd fx
zig build
./zig-out/bin/fx

Test your changes with the freshly built ./zig-out/bin/fx, because 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:

fx/
├── src/
│   ├── main.zig     entry point that wires everything together
│   ├── core/        agent loop, sessions, config, permissions, MCP, skills
│   ├── builtins/    built-in tool specs, providers, and the system prompt
│   ├── tools/       built-in tools: files, shell, web, skills, subagents
│   ├── ui/          terminal rendering and input
│   ├── gateway/     model provider transport
│   ├── mcp/         MCP engine
│   └── 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, point it at For coding agents.

Security

Report vulnerabilities through the contact page instead of a public issue.

License

Apache-2.0. Third-party licenses and attributions are in THIRD_PARTY_NOTICES.md.

Credits

Interface sounds by cuelume.

fx (vercel-labs/fx)

Searching Database…

3.9K ·GitHub
What is this?fx is a Unix-like coding agent harness and CLI written in Zig, built for research and embeddability inside larger systems, with a strong focus on minimalism and performance.
Is fx more like a Unix shell tool or a full IDE-style terminal app?fx aims to feel like a Unix shell command rather than a heavy terminal IDE, keeping its CLI output style and form factor minimal.
How do I start working with fx on a project?Run the fx binary from inside your project folder; the current directory becomes the primary workspace, then you type a prompt or run /help to browse commands.
Do I need an API key, or can I use my ChatGPT or Grok subscription?You can sign in with a Vercel AI Gateway API key, or authenticate with an eligible ChatGPT subscription via OpenAI Codex OAuth, or an eligible Grok subscription via xAI OAuth.
What happens if a saved fx session gets corrupted?You can run 'fx session recover' to copy the validated prefix of a damaged session into a new one, but records after the damage point are dropped and commands are not rerun.
Can fx be embedded into another product with its own authentication?Yes, hosts that inject provider authentication at the network boundary can set FXAUTHMODE=host-managed so fx won't read, refresh, or write local model-provider credentials itself.
How big is the fx binary?It's about 7.8 MiB, reflecting the project's focus on minimalism and performance across its system prompt, tools, and feature set.
What happens when a conversation gets too long for the model's context window?fx automatically summarizes the session into a fresh context window once the active request reaches 80% of usable input capacity, or you can trigger the same handoff manually with /compact.
Does signing in with ChatGPT or Grok route my tokens through Vercel?No, both the OpenAI Codex and xAI Grok OAuth tokens are stored locally (in ~/.fx/chatgpt-auth.json or ~/.fx/grok-auth.json) and are never sent to Vercel AI Gateway or each other.
What does /trace do when fx misbehaves?It creates a private Markdown diagnostic containing logs, session context, runtime state, permissions, and recent rendering events to help debug a problem.
Size
116.9 MB
Stars
3.9K
Age
3mo
Commits · 90 Days