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 embed the agent in a JavaScript application with the libfx package.
Choose an interface
| Goal | Interface | Runs as |
|---|---|---|
| Use fx in a terminal | fx | Native process |
| Connect an editor or another ACP client | fx acp | Native process over stdio |
| Build a JavaScript interface around the agent | createFxAgent() | Native addon on Node, fx-core.wasm in the browser |
| Add the fx terminal to a JavaScript application | createFxTerminal() | 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 libfx package on npm carries both builds the JavaScript SDK can run: a native Node addon and the WebAssembly builds the browser needs. Which one loads depends on where your code runs, and on which of the two surfaces you ask for.
npm install libfx
The Node SDK covers the native addon, backend selection, and what the embedded agent can and cannot do. The WebAssembly SDK covers the browser, where the try page runs the terminal build of fx. For browser storage, authentication, command execution, and network requests, see Browser integration.