fx
Unix like coding agent
Links
README
From the repo.
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢰⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣠⣶⣿⣿⣷⣶⡶⣶⣶⣆⠀⠀⠀⣴⣶⣶⠆
⠀⠀⠀⠉⢹⣿⣿⠉⠉⠀⠘⢿⣿⣧⣀⣾⣿⡿⠃⠀ 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 CLI written in Zig: a small native binary that is open source (Apache-2.0), model-agnostic, and embeddable as a harness in larger systems. Its interface stays closer to a Unix shell than an IDE in the terminal.
Highlights
- Any model: Vercel AI Gateway, ChatGPT or Grok subscriptions, or your own OpenAI-compatible endpoint such as Ollama or OpenRouter
- Any interface: interactive shell, one-shot
fx askfor scripts, or embedded through libfx and ACP - Shell-like output: inline rendering that preserves your terminal scrollback
- Extensible: skills, MCP servers, and subagents
Install
curl -fsSL https://fx.sh/setup.sh | bash
Get started
Sign in with one of:
fx login: Vercel AI Gatewayfx login codex: ChatGPT subscription (OpenAI Codex OAuth)fx login grok: Grok subscription (xAI OAuth)fx setup: AI Gateway API key
Then start the interactive shell from a project:
cd your_project
fx
Or make a one-shot request:
fx ask "explain the changes in this repository"
Inside the shell, run /help to browse interactive commands.
Documentation
Visit fx.sh/docs for the full manual: sessions, models, custom model connections, permissions, configuration, skills, MCP, subagents, embedding, and the complete CLI and slash command references. Agents can read any page as Markdown by appending .md to its URL, or fetch llms-full.txt for everything in one file.
Custom model connections
Add named connections for any OpenAI Chat Completions endpoint, including local servers such as Ollama and gateways such as OpenRouter, in ~/.fx/settings.json, then select one for the profile or a single invocation:
fx provider local
FX_PROVIDER=openrouter FX_MODEL=openai/gpt-4.1 fx ask "review this change"
See Custom model connections for connection JSON, model metadata, and behavior details.
Gateway provider routing
When the active model goes through the Vercel AI Gateway, one model is often served by several providers (for example Anthropic directly, AWS Bedrock, or Google Vertex). fx can tell the gateway which providers to use, in what order:
// ~/.fx/settings.json
{
"provider_order": ["bedrock", "anthropic"], // try Bedrock first, then Anthropic
"provider_strict": false // true restricts requests to only these providers
}
Both keys also work in a committed project .fx.json, and per launch:
fx --provider-order azure,openai --provider-strict
fx ask --provider-order bedrock "review this change"
FX_PROVIDER_ORDER=vertex FX_PROVIDER_STRICT=1 fx
Slugs are the gateway's provider identifiers (letters, digits, dashes, for example anthropic, bedrock, vertexAnthropic), listed on the models page. An empty provider_order in a higher-precedence layer clears a list set by a lower one. Routing applies to gateway requests only; custom model connections ignore it.
Themes
fx ships with fx-dark and fx-light and follows your terminal's light or dark mode. Pin a variant with FX_THEME=light or FX_THEME=dark, or drop a VS Code format theme at ~/.fx/themes/<name>.json and select it with the theme setting or FX_THEME=<name> per launch. See Configuration for all environment variables.
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 SDK is published to npm as libfx. See the WebAssembly SDK and the runnable Node.js, browser, Next.js, and Nuxt examples. The WebAssembly SDK is experimental.
Slack workspace installation
Run fx slack install to install the fx bot in the configured Vercel Slack
workspace. Keep the command running and authorize Slack in a browser on the same
computer. The HTTPS callback at fx.sh returns the authorization to the CLI;
PKCE state and the verifier stay in memory. The companion web bridge must be
deployed and configured first.
After the CLI saves the installation, the browser returns to an fx.sh confirmation page. You can close that tab or refresh it after the command exits.
fx slack status --json reports local installation metadata without tokens.
Plain-text output omits Slack IDs and shows expiration as a readable UTC date
and time. JSON output retains the IDs and Unix timestamps for scripts.
fx slack refresh rotates the local bot credentials when needed. Credentials
live in the owner-only file ~/.fx/slack/installation.json; no hosted database
or background refresh service is created. An expired refresh token requires
installation again. This workspace operation is separate from each employee's
MCP user authorization. Employees connect their own account with
/mcp auth slack --open in an fx session (or fx mcp auth slack from a terminal).
For https://mcp.slack.com/mcp, the CLI recognizes the fx app by its public
Client ID and uses the HTTPS callback for personal login. Changing that Client
ID requires a CLI update. First login and reauthorization request the full shared
user_scopes list from fx.sh. If local scopes are configured, they must include
every shared scope; extra local scopes are not requested. A narrower or explicitly
empty list stops authorization before opening the browser, leaving the configuration
and stored credentials unchanged. Remove the override only if you want to authorize
the full shared scope set. Per-user read-only subsets are not supported for the fx app. Saved scopes,
Slack's advertised capabilities, and scope challenges cannot expand this
request. The shared list contains nine personal scopes configured for fx and
advertised by Slack MCP; changing it requires a deliberate configuration update
and any necessary Slack approval. This does not revoke
permissions on previously issued tokens or change token refresh behavior. It
opens an ephemeral loopback listener instead of the configured callback_port,
keeps PKCE and personal tokens in the CLI, and shows “Slack connected” after
saving to the existing MCP credential store. Other MCP providers and different
Slack app Client IDs retain their direct callback behavior without contacting
fx.sh. Fx app authorization requires fx.sh to be available; an unavailable
metadata endpoint returns SlackBridgeUnavailable. Deploy the web
personal-authorization routes and scope metadata before releasing this CLI.
Missing or invalid shared scopes stop authorization rather than falling back
to Slack's broader capabilities. Keep the registered
localhost callback for older clients until they have upgraded. Slack workspace
approval requirements still apply to personal authorization.
Bot installation does not establish whether Slack will display a hoverable “Sent using @fx” attribution; that requires a live message test.
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.
Security
Report security vulnerabilities through the contact page instead of a public issue.
License
Apache-2.0. Third-party licenses and attributions are listed in THIRD_PARTY_NOTICES.md.
Credits
Interface sounds by cuelume.
Collected info
- ★ 3,149 stars
- ⎇ 357 forks
- Language: Zig
- Source updated: 9/25/2026
Config for your environment
Replace {MCP_ENDPOINT_URL} with this MCP’s endpoint URL (from its repo or docs above). No API key — you connect directly.
Tool
OS
Config file: ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-server": {
"url": "{MCP_ENDPOINT_URL}"
}
}
}Paste into mcpServers in the config file. Restart Cursor after saving.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.