Overview
fx is a coding agent harness and CLI written in Zig by Vercel Labs, optimized for research and for embeddability as part of larger systems. It is minimal on purpose — from the system prompt through the tool set and feature list down to a 7.8 MiB binary — and its CLI output style deliberately reads closer to a Unix shell than to the heavy "IDE in the terminal" TUIs that dominate the category. The project marks itself experimental.
It is model-agnostic and works with local or cloud inference. Authentication goes through Vercel AI Gateway by default, or through an eligible ChatGPT subscription over OpenAI Codex OAuth, or an eligible Grok subscription over xAI OAuth; the /provider command moves between them and /model lists the active provider's fetched catalog. The subscription routes talk to their provider directly — the Codex OAuth token is never sent to Vercel AI Gateway, and the Grok token goes to neither Gateway nor OpenAI — with each session stored privately under ~/.fx.
In use, you run fx inside a project directory and the current directory becomes the primary workspace. Enter steers an active turn at the next safe model boundary rather than queueing blindly, Escape interrupts and applies the update when the turn settles, and /resume reopens a saved conversation from a picker. Tool calls expand by default and can be collapsed to one summary per group via /settings or a collapse_tool_calls flag in ~/.fx/settings.json. Embedding hosts that inject provider credentials at the network boundary can set FX_AUTH_MODE=host-managed, in which case fx neither reads nor writes local model-provider credentials.
What it does
- One small native binary (7.8 MiB) written in Zig, with no runtime to install
- Model-agnostic across local and cloud inference, via Vercel AI Gateway, an OpenAI Codex OAuth subscription, or an xAI Grok OAuth subscription
- Subscription OAuth tokens go straight to their provider and are stored privately under ~/.fx, never forwarded to the Gateway
- Unix-shell-style output rather than a full-screen TUI, aimed at composition and embedding
- Steerable turns: Enter applies an update at the next safe model boundary, Escape interrupts and applies once the turn settles
- Session resume with a shared workspace catalog, and collapsible tool-call groups via /settings or ~/.fx/settings.json
- FX_AUTH_MODE=host-managed for embedding hosts that authenticate forwarded requests themselves
Getting started
Install the binary, pick how you authenticate, then run fx from inside a project. Status is experimental — the README says to use it at your own risk.
Install
One setup script fetches the native binary.
curl -fsSL https://fx.sh/setup.sh | bashSign in
Log in with Vercel AI Gateway, or use an eligible ChatGPT or Grok subscription. Each subscription login selects that provider and a model from its authenticated catalog.
fx login # Vercel AI Gateway
fx login codex # ChatGPT subscription via OpenAI Codex OAuth
fx login grok # Grok subscription via xAI OAuthOr use an AI Gateway API key
fx setup walks through configuring a key instead of an OAuth session.
fx setupRun it in a project
The current directory becomes the primary workspace. Type a prompt, or /help to browse interactive commands; /provider switches provider, /model lists the active catalog, /resume reopens a saved conversation.
cd your_project
fxCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Embed a coding agent inside a larger system where a full terminal IDE would be the wrong shape and the binary size matters
- Run an agent from a shell pipeline or script, where Unix-style output composes better than a TUI
- Drive a coding agent from a ChatGPT or Grok subscription you already hold without routing the token through a gateway
- Experiment with harness design against a small, readable, Apache-2.0 agent implementation
How fx compares
fx alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| opencode | ★ 205k | OpenCode is an open source AI coding agent that runs in your terminal, with built-in build and plan agents and an optional desktop app. |
| Claude Code | ★ 144k | Anthropic's agentic coding tool for the terminal, IDE and GitHub: it understands your codebase, executes routine tasks, explains code and handles git workflows from natural-language commands. |
| OpenAI Codex | ★ 122k | OpenAI's cloud and CLI coding agent that writes features, fixes bugs, and proposes code changes across a repo, running tasks in parallel. |
| Gemini CLI | ★ 107k | An open-source command-line AI agent from Google that connects your terminal to Gemini models for reading code, editing files, running shell commands, and searching the web. |
| Pi | ★ 102k | Minimal terminal coding agent harness with four built-in tools, extended through TypeScript extensions, skills and prompt templates instead of forks. |
| OpenHands | ★ 86.4k | An open-source AI software-development agent that plans tasks, edits files, runs commands, and tests code, usable from a terminal CLI, a local web GUI, or a Python SDK. |
| Warp | ★ 64.8k | An agentic development environment born out of the terminal, with a built-in multi-model coding agent and support for third-party CLI agents. |
| fx | ★ 2.8k | A tiny, open, embeddable coding agent that behaves more like a Unix shell than a terminal IDE |