Embed fx

fx provides the agent runtime and tools for building coding-agent interfaces. You can run its native command-line interface (CLI) in a terminal, connect an editor or another application over Agent Client Protocol (ACP), or load a WebAssembly build from JavaScript.

Choose an interface

GoalInterfaceRuns as
Use fx in a terminalfxNative process
Connect an editor or another ACP clientfx acpNative process over stdio
Build a JavaScript interface around the agentcreateFxAgent()fx-core.wasm
Add the fx terminal to a JavaScript applicationcreateFxTerminal()fx-term.wasm

Run fx directly

Start the native CLI from the project you want to work on:

cd /absolute/path/to/project
fx

The current directory becomes the primary workspace. See the CLI reference for commands and global options.

Connect a native client over ACP

Run fx as an Agent Client Protocol (ACP) server:

fx acp

The ACP client launches fx as a native process and communicates with it over standard input and output. Use this interface for editors and applications that support ACP.

Load fx from JavaScript

The Zig toolchain can also compile fx to WebAssembly. The experimental JavaScript SDK loads that build as either a headless agent or an interactive terminal. The try page runs the terminal WebAssembly build of fx.

Read the WebAssembly SDK guide to choose an API and check runtime support. For browser storage, authentication, command execution, and network requests, see Browser integration.