Install
@forst/cli first. Add a postinstall script that runs forst generate ..
Run generate once before you import @forst/gen.
Details are on the Installation page.forst dev watches your .ft tree, recompiles on change, and exposes a stable HTTP contract for tooling and Node clients. Full call and failure docs: Call Forst over HTTP.
Generated client
Editing a.ft file regenerates the TypeScript client so the editor stays in step with the server. In development, sidecar watchGenerate defaults to true and runs forst generate after a debounced reload. You can also run a standalone watcher:
forst clean removes .forst/client with the rest of .forst. The next forst generate (or postinstall) restores @forst/gen.
See CLI reference § Generate configuration for outDir, packageName, and related fields.
Endpoints
The invoke envelope uses JSON request/response bodies. The same contract applies to the built-in HTTP server in a compiled binary. See Call Forst over HTTP.
Clients should check
contractVersion on /version when upgrading the compiler.
Configuration
Share discovery rules withforst generate via ftconfig.json:
files.include and exclude control which .ft files are watched and compiled. Globs resolve from the ftconfig boundary root. Each directory holds one Forst package name, matching Go layout rules.
Runtime profile (embedded / host mode)
Whenserver.embedded or bridge.hostMode is true, forst dev compiles and runs your entry .ft (same pipeline as forst run) instead of the per-invoke HTTP executor.
By default, dev.hotReload is true in ftconfig.json, so the CLI watches .ft files under -root, recompiles on change, and restarts the generated program. Set "dev": { "hotReload": false, "watch": false } for a one-shot compile+run (no file watching).
Compile errors during reload are printed to stderr. The watch loop keeps running; if a previous build was already running, it stays up until a successful recompile replaces it.
@forst/sidecar spawn mode is an alternative: it restarts the whole forst dev child on .ft changes and can run watchGenerate after those reloads.
When to use dev vs pure Go
Caveats
forst dev is experimental. Pin compiler versions. Run integration tests in your pipeline.
Same port convention
PointFORST_BASE_URL at the server you actually run. Executor profile and embedded profile often use different defaults (6320 vs 6321). See Call Forst over HTTP § Caveats.
Providers in Go host
Invoke carries request payloads only. Wirewith blocks in Go before exposing handlers. See Providers § Caveats.
Examples
- Repository invoke example:
examples/in/rfc/embedded-invoke - Client integration:
examples/client-integration/
Related
Call Forst over HTTP
Generated client, failures, and built-in HTTP server.
CLI reference
forst generate, --watch, and config fields.Installation
@forst/cli, postinstall, and first generate.