# fx

> A tiny, open, embeddable coding agent that behaves more like a Unix shell than a terminal IDE

- Category: AI Coding / Autonomous Coding Agents
- Language: Zig
- Licence: Apache-2.0
- Repository: https://github.com/vercel-labs/fx
- Website: https://fx.sh
- Canonical page: https://ai-tldr.dev/tools/fx/
- Updated: 2026-08-17

## In short

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 sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in Zig and licensed Apache-2.0. To get started: install.

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

1. Install

   One setup script fetches the native binary.

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

2. Sign 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.

```bash
fx login          # Vercel AI Gateway
fx login codex    # ChatGPT subscription via OpenAI Codex OAuth
fx login grok     # Grok subscription via xAI OAuth
```

3. Or use an AI Gateway API key

   fx setup walks through configuring a key instead of an OAuth session.

```bash
fx setup
```

4. Run 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.

```bash
cd your_project
fx
```

## 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

## Version history

- 2026-08-17: Vercel Labs open-sourced fx under Apache-2.0: a coding agent written in Zig, shipped as a single native binary and working with local or cloud models.
