Documentation Index
Fetch the complete documentation index at: https://mintlify.com/withastro/flue/llms.txt
Use this file to discover all available pages before exploring further.
flue.config.ts is the build-time configuration file for your Flue project. It sets project-wide defaults for target, root, and output — the three knobs that shape how flue dev, flue run, and flue build locate your source and write their artifacts.
Provider registration and model configuration are not build-time concerns. Those belong in app.ts where runtime environment variables and platform bindings are available. See Configuring AI model providers.
Supported file extensions
Flue discovers your config file automatically, searching for these names in priority order:flue.config.tsflue.config.mtsflue.config.mjsflue.config.jsflue.config.cjsflue.config.cts
--config <path> to any CLI command. CLI flags always override values from the config file on a per-field basis.
Config files are loaded via Node’s native TypeScript support. This requires Node.js >= 22.18.0. TypeScript syntax that Node’s type-stripping loader doesn’t support — such as
enum, namespace with runtime code, parameter properties, and decorators — is not allowed in the config file. Stick to erasable types, or use a .js config instead.The defineConfig helper
Import defineConfig from @flue/cli/config to get type inference and editor intellisense. It’s an identity function — it returns its argument unchanged — so wrapping your config object in it costs nothing at runtime.
flue.config.ts
Config options
The deployment target. Controls which build plugin runs (
flue build) and which dev server is used (flue dev).'node'— produces a bundleddist/server.mjsfor Node.js hosts.'cloudflare'— produces a TypeScript entry forwranglerto bundle and deploy.
--target CLI flag. Omitting it from both causes a clear error at startup.The project root directory. Source files (
agents/, roles/) are discovered from <root>/.flue/ if that directory exists, otherwise from <root>/ directly.Relative paths resolve against the directory containing the config file (Vite-style: the config file’s directory is the project root by default). Defaults to that directory when unset.The build output directory.
flue build writes server.mjs, wrangler.jsonc, and other artifacts here.Relative paths resolve against the config file’s directory. Defaults to <root>/dist.Examples
- Minimal
- Full
Most projects only need to set With
target. The hello-world example intentionally leaves target unset so it works with either --target node or --target cloudflare from the CLI:flue.config.ts
target pinned:flue.config.ts
Config discovery and precedence
The CLI searches for a config file starting from the directory you pass as--root, or the current working directory if --root is omitted. Precedence from highest to lowest:
- CLI inline flags (
--target,--root,--output) flue.config.*values- Built-in defaults (
root= config file directory,output=<root>/dist)