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.

toml
[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 = false

Sections

[input]

Where to find Rust source files. See metaxy generate and metaxy scan for CLI equivalents.

FieldTypeDefaultDescription
dirstring"api"Root directory with Rust source files
includestring[]["**/*.rs"]Glob patterns to include
excludestring[][]Glob patterns to exclude

[output]

Generated file paths. Framework wrappers are opt-in — set a path to enable. See metaxy generate for CLI equivalents.

FieldTypeDefaultDescription
typesstring"src/lib/rpc-types.ts"Generated TypeScript types
clientstring"src/lib/rpc-client.ts"Generated RPC client
sveltestring?Svelte 5 reactive wrapper (opt-in)
reactstring?React hooks wrapper (opt-in)
vuestring?Vue 3 composable wrapper (opt-in)
solidstring?SolidJS wrapper (opt-in)

[output.imports]

FieldTypeDefaultDescription
types_pathstring"./rpc-types"Import path for the types module
extensionstring""File extension for imports, e.g. ".js" for ESM

[codegen]

Code generation options. See Codegen section for details on each option.

FieldTypeDefaultDescription
preserve_docsboolfalseForward Rust doc comments as JSDoc
branded_newtypesboolfalseEmit nominal (branded) types for Rust newtypes
bigint_typesstring[][]Rust types mapped to bigint, e.g. ["i64", "u64"]

[codegen.naming]

FieldTypeDefaultDescription
fieldsstring"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"

[watch]

Watch mode settings for metaxy watch.

FieldTypeDefaultDescription
debounce_msnumber200Milliseconds to wait after a file change before regenerating
clear_screenboolfalseClear terminal before each regeneration

visit GitHub to learn more about metaxy