Expand description
CLI tool for the metaxy project.
Scans Rust lambda source files for #[rpc_query] / #[rpc_mutation]
functions and #[derive(Serialize)] types, then generates TypeScript type
definitions and a fully typed RPC client.
§Binary
The installed binary is called metaxy and provides three subcommands:
metaxy scan— parse a directory and print discovered procedures as human-readable text plus a JSON manifest.metaxy generate— producerpc-types.ts(interfaces +Procedurestype) andrpc-client.ts(typedRpcClient+createRpcClientfactory).metaxy watch— same asgenerate, but re-runs automatically whenever a.rsfile changes (configurable debounce).
§Architecture
┌─────────────┐ scan ┌──────────┐ codegen ┌────────────────────┐
│ api/*.rs │ ──────► │ Manifest │ ────────► │ rpc-types.ts │
│ attributes │ (syn) │ │ (fmt) │ rpc-client.ts │
└─────────────┘ └──────────┘ │ rpc.svelte.ts (opt)│
└────────────────────┘parser— walks the source directory, parses each.rsfile withsyn, and builds amodel::Manifest.codegen::typescript— converts the manifest into arpc-types.tsfile with TypeScript interfaces, enum types, and aProceduresmap.codegen::client— converts the manifest into arpc-client.tsfile with a typedRpcClientinterface andcreateRpcClientfactory.codegen::svelte— optionally converts the manifest into arpc.svelte.tsfile with Svelte 5 reactive wrappers (createQuery,createMutation).watch— wrapsgeneratein a file-watcher loop with debouncing.