fx
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣠⣶⣿⣿⣷⣶⡶⣶⣶⣆⠀⠀⠀⣴⣶⣶⠆
⠀⠀⠀⠉⢹⣿⣿⠉⠉⠀⠘⢿⣿⣧⣀⣾⣿⡿⠃⠀ Tiny, open, embeddable, native coding agent.
⠀⠀⠀⠀⣼⣿⡏⠀⠀⠀⠀⠀⠻⣿⣿⣿⠟⠀⠀⠀
⠀⠀⠀⢀⣿⣿⠃⠀⠀⠀⠀⢠⣦⠘⢿⣿⣷⡀⠀⠀ curl -fsSL https://fx.sh/setup.sh | bash
⠀⠀⠀⣸⣿⡟⠀⠀⠀⠀⣰⣿⣿⠗⠀⠻⣿⣿⣄⠀
⠀⠀⠀⣿⣿⠇⠀⠀⠀⠾⠿⠿⠋⠀⠀⠀⠘⠿⠿⠦ ⚠ Status: Experimental. Use at your own risk.
⠀⣸⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
fx is a coding agent harness and CLI written in Zig, optimized for research and embeddability as part of larger systems.
It focuses on minimalism and performance across the board, from system prompt design to its tools, feature set, and 7.8 MiB binary.
For end users, its CLI output style and form factor aim to be closer to a Unix shell than a heavy "IDE in the terminal" TUI.
It's open source (Apache-2.0), model-agnostic, and suitable for both local and cloud inference.
curl -fsSL https://fx.sh/setup.sh | bash
Run fx
Sign in with Vercel AI Gateway:
fx login
Or use an eligible ChatGPT subscription through OpenAI Codex OAuth:
fx login codex
fx
Or use an eligible Grok subscription through xAI OAuth:
fx login grok
fx
fx login codex and fx login grok select that provider and a model from its authenticated catalog. Inside fx, open /setup and choose Switch provider to move between Gateway, Codex, and Grok. /model lists the active provider's fetched models. Subscription model IDs are the raw IDs returned by each authenticated catalog. Use /logout codex or /logout grok to remove that subscription session without affecting other providers; choosing it again from Switch provider starts sign-in.
The OpenAI Codex route uses ChatGPT subscription access directly and never sends its OAuth token to Vercel AI Gateway. The session is stored privately at ~/.fx/chatgpt-auth.json and refreshed when needed. On supported Codex models, /fast requests OpenAI's priority service tier and consumes ChatGPT credits at the higher Fast mode rate.
The Grok route uses subscription access directly at xAI and never sends its OAuth token to Vercel AI Gateway or OpenAI. Its session is stored privately at ~/.fx/grok-auth.json, refreshed when needed, and used only with the authenticated xAI catalog and Responses API.
To use an AI Gateway API key instead:
fx setup
Run fx from a project:
cd your_project
fx
The current directory becomes the primary workspace. Enter a prompt, or run /help to browse interactive commands.
The status line hides the workspace path and Git branch by default. Enable the Status line workspace option in /settings, run /statusline workspace, or set it in ~/.fx/settings.json:
{
"statusLine": {
"workspace": true
}
}
List saved sessions with fx sessions. Resume the latest session for the current workspace, or select an exact session ID, through the same command group:
fx session resume last
fx session resume --id <id>
Each interactive session names its terminal tab. The title prefers the session name, falls back to the workspace name, and keeps the active model as secondary context. Renaming or resuming a session updates the tab, and exiting clears the fx-owned title. Noninteractive commands do not emit terminal-title controls.
Run /feedback to open the feedback form at fx.sh/feedback. It does not create a diagnostic or change the clipboard.
Run /trace to create a private Markdown diagnostic with logs, session context, runtime state, permissions, and recent activity. On macOS, fx copies the .md file to the clipboard; on other platforms, it saves the file and prints its path. Review and redact the trace before sharing it.
Use fx ask for a single request:
fx ask "explain the changes in this repository"
fx starts in auto permission mode. Routine understood development actions run directly; unresolved sensitive actions receive one bounded automatic review. A blocked action may return an exact approval request that the agent can send to fx's real permission screen. Ordinary question text never grants permission. See Permissions for other modes and persistent rules.
JSON and quiet requests stay noninteractive by default. Add --prompt-permissions to allow the existing Y/N approval prompt when stdin is a TTY. Prompt text is written to stderr, so JSON stdout stays parseable and quiet stdout stays empty. Piped or redirected stdin remains noninteractive and fails instead of waiting for approval.
Inside a saved session, /permissions remember <allow|deny> <tool-name> <arguments-json> stores an exact confirmed rule without running the action. /permissions lists stable rule IDs, and /permissions revoke <rule-id> removes a stored rule even when its original workspace or file state has changed.
Embed fx
fx builds as a native binary or WebAssembly. Applications embedding fx can provide network transport, session storage, configuration, permission handling, and terminal I/O.
| Surface | Use |
|---|---|
fx acp |
Connect the native agent to editors and other Agent Client Protocol clients. |
createFxAgent() |
Embed the agent core in a JavaScript host with fx-core.wasm. |
createFxTerminal() |
Embed the interactive terminal with fx-term.wasm. |
The WebAssembly SDK is experimental. See the WebAssembly SDK and ACP documentation.
Extend fx
Add reusable instructions with skills, connect external tools through MCP, or delegate independent work to subagents. Project instruction files may link within their scope, and read-only workspace or compatibility skill directories and their primary SKILL.md files may link within their owning workspace or home; managed skills, secondary resources, and escaping links remain no-follow. Skills installed via symlinks that resolve outside home or workspace (e.g. Nix store paths) are loaded when their resolved target is inside a directory listed in the FX_SKILL_SYMLINK_AUTHORITIES environment variable (colon-separated absolute paths). fx status and fx doctor report an invalid trusted MCP profile without starting its servers.
Documentation
Read the fx documentation.
Build from source
Building fx requires Zig 0.16.0+:
git clone https://github.com/vercel-labs/fx.git
cd fx
zig build -Doptimize=ReleaseSafe
./zig-out/bin/fx
Run the test suite with zig build test. See CONTRIBUTING.md for development and contribution guidelines.
License
Third-party licenses and attributions are listed in THIRD_PARTY_NOTICES.md.
Credits
Interface sounds by cuelume.
