Skip to main content
Install @forst/cli or a native binary (Installation), then compile a file:
The forst CLI transpiles .ft sources, runs programs, generates the TypeScript client package, and starts development services. Node apps that import @forst/gen also need the postinstall generate script. See Installation § Generated TypeScript client.

Default compile and run

With no subcommand, forst compiles a single .ft file. Given hello.ft:
Run it with:
Each command below writes a different artifact. Use this table to pick the workflow that matches what you need in your repo or container image. Common flags (see forst --help):

forst generate

Emit a TypeScript client package from Forst sources:
Uses the same file discovery rules as forst dev. Import from @forst/gen/<package> after generate (and after postinstall on a fresh machine). Each directory holds one Forst package name, matching Go. You may put many .ft files in that directory when they share the same package line. files.include globs select which .ft files are discovered. They do not allow multiple package names in one folder or the same package name in sibling folders.

--allow-stem-package-mismatch

By default, forst generate expects the file stem or parent folder name to match the package line. Use this flag when legacy files break that rule and you cannot rename or move them yet. Normal colocation does not need the flag. Put files under a folder named for the package (for example auth/login.ft with package auth). See Call Forst over HTTP § Colocate Forst with TypeScript. --list (with optional --json) prints a machine-readable manifest of packages and exported functions without writing client output. Use it for IDE plugins, codegen pipelines, or CI introspection. --watch regenerates when .ft files change. Use it when the dev server runs separately, or rely on regenerate-on-save from Dev server.

Output modes

Ephemeral output is removed by forst clean and restored by the next generate. Committed mode is a normal workspace package you check in. See Plugins to configure JSON Schema, RPC contracts, file routes, or custom generators during forst generate. Plugins are work in progress—see that page for versioning and coverage limits.

Generate configuration

Set these under "generate" in ftconfig.json:
Each plugin entry:

Optional Go sources (generate.go)

By default, forst generate writes only the TypeScript client (postinstall safe). Go sources run when generate.go.entry and generate.go.out are set in ftconfig.json, or when you override on the CLI with matching flag names. TS client + Go sources (default):
Writes @forst/gen and transpiled .go beside the output path. Go sources only:
Skips TypeScript client generation. Use when you only want inspectable Go for go build or review. CLI flags mirror ftconfig fields (--go-entry, --go-out, --go-root, --skip-client). Unset flags fall back to ftconfig.json. Or configure in ftconfig.json:
Go source emission does not link a native binary. Use forst build for production linked programs.

Native program build (forst build)

Build a linked program binary and manifest.json for slim container images (similar to go build -o bin/main). Local build (writes under .forst/, removed by forst clean):
Cross-compile for Linux containers (writes to a path you copy into the image):
-o is the output directory. Forst writes manifest.json and bin/<entryStem> directly inside it. No extra subfolder is required. Output layout (entry ./app/main.ftbin/main):
Requires server.embedded: true in ftconfig.json. At runtime, run the linked binary with FORST_ROOT set to your project root (read binary from manifest.json):

How the binary fits with Node

When bridge.hostMode is enabled, the built binary can run Forst and talk to Node in one of two layouts. All-in-one (default): One process runs your Forst entry point, starts the small HTTP server that @forst/gen uses to call Forst functions, and starts your Node app (for example remix-serve) as a child process:
Split layout (FORST_SKIP_NODE_HOST=1): Use the same binary when Node already runs somewhere else (another container, systemd unit, or local dev process). Set FORST_SKIP_NODE_HOST=1 so the binary runs embedded invoke and your entry point but does not spawn the Node host. Your Node app runs on its own and connects using @forst/gen and the URL in .forst/invoke.ready. forst build does not wait for the Node HTTP app to finish starting.

manifest.json (build output)

manifest.json sits beside the linked binary under your -o directory. Use these fields to verify how the program was built and which executable to run in production. Older manifests may show "kind": "invoke" and "binary": "bin/forst-invoke". Task pages link here instead of repeating this table.

forst dev

Start the HTTP development server for function discovery, invocation, and types:
See Dev server.

forst lsp

Start the language server (JSON-RPC over HTTP on POST /):
Used by the VS Code extension. This is HTTP LSP rather than stdio. Other editors need a similar bridge.

forst fmt

Format .ft sources:

forst test

Run Forst tests (discovery and emit bridge):

forst dump

Debug compiler phases (lexer, parser, typechecker, transformer):
Useful when reporting compiler bugs.

forst clean

Remove compiler-generated artifacts under .forst/ (run sandboxes, the generated client, native build output under .forst/build/, test emit dirs, executor temp modules, nodert sockets, invoke ready markers). User config such as .forst-gomod/ is not removed.
After forst clean, run forst generate (or rely on postinstall) to restore @forst/gen.

forst version

Print compiler version info:
Prints semver, commit, and build date.

npm wrapper

When installed via @forst/cli:
Set FORST_BINARY to skip download in CI.

Installation

npm, binary, Docker, and the generated client setup.

Generate a TypeScript client

@forst/gen imports and layout.

Dev server

HTTP contract and regenerate on save.

Quickstart

First commands in context.

Editor workflow

LSP integration in VS Code.