Zum Inhalt springen
← Zurück zu den Projekten

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 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 ask for scripts, or embedded through libfx and ACP
  • Shell-like output: inline rendering that preserves your terminal scrollback
  • Extensible: skills, MCP servers, and subagents

Vercel Labs Product fx CLI release License: Apache-2.0

#Install

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

#Get started

Sign in with one of:

  • fx login: Vercel AI Gateway
  • fx 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.

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

Neue Version verfügbar.