Config File
Place an metaxy.config.toml in your project root. The CLI auto-discovers it by walking up from the current directory. Use --config <path> to override or --no-config to disable.
Resolution order (highest wins): CLI flag > config file > built-in default.
[input]
dir = "api"
include = ["**/*.rs"]
exclude = []
[output]
types = "src/lib/rpc-types.ts"
client = "src/lib/rpc-client.ts"
svelte = "src/lib/rpc.svelte.ts"
react = "src/lib/rpc.react.ts"
vue = "src/lib/rpc.vue.ts"
solid = "src/lib/rpc.solid.ts"
[output.imports]
types_path = "./rpc-types"
extension = ""
[codegen]
preserve_docs = false
branded_newtypes = false
bigint_types = []
[codegen.naming]
fields = "preserve"
[codegen.type_overrides]
"chrono::DateTime" = "string"
"uuid::Uuid" = "string"
[watch]
debounce_ms = 200
clear_screen = falseSections
[input]
Where to find Rust source files. See metaxy generate and metaxy scan for CLI equivalents.
| Field | Type | Default | Description |
|---|---|---|---|
dir | string | "api" | Root directory with Rust source files |
include | string[] | ["**/*.rs"] | Glob patterns to include |
exclude | string[] | [] | Glob patterns to exclude |
[output]
Generated file paths. Framework wrappers are opt-in — set a path to enable. See metaxy generate for CLI equivalents.
| Field | Type | Default | Description |
|---|---|---|---|
types | string | "src/lib/rpc-types.ts" | Generated TypeScript types |
client | string | "src/lib/rpc-client.ts" | Generated RPC client |
svelte | string? | — | Svelte 5 reactive wrapper (opt-in) |
react | string? | — | React hooks wrapper (opt-in) |
vue | string? | — | Vue 3 composable wrapper (opt-in) |
solid | string? | — | SolidJS wrapper (opt-in) |
[output.imports]
| Field | Type | Default | Description |
|---|---|---|---|
types_path | string | "./rpc-types" | Import path for the types module |
extension | string | "" | File extension for imports, e.g. ".js" for ESM |
[codegen]
Code generation options. See Codegen section for details on each option.
| Field | Type | Default | Description |
|---|---|---|---|
preserve_docs | bool | false | Forward Rust doc comments as JSDoc |
branded_newtypes | bool | false | Emit nominal (branded) types for Rust newtypes |
bigint_types | string[] | [] | Rust types mapped to bigint, e.g. ["i64", "u64"] |
[codegen.naming]
| Field | Type | Default | Description |
|---|---|---|---|
fields | string | "preserve" | "preserve" keeps snake_case, "camelCase" converts |
[codegen.type_overrides]
Map external crate types to TypeScript types. Keys are fully-qualified Rust paths, values are TS type names.
"chrono::DateTime" = "string"
"uuid::Uuid" = "string"
"uuid::Uuid" = "string"
[watch]
Watch mode settings for metaxy watch.
| Field | Type | Default | Description |
|---|---|---|---|
debounce_ms | number | 200 | Milliseconds to wait after a file change before regenerating |
clear_screen | bool | false | Clear terminal before each regeneration |