Skip to main content

Crate oxide_gen

Crate oxide_gen 

Source
Expand description

§oxide-gen — Spec-to-Crate Generator

oxide-gen ingests an API specification (OpenAPI 3.x, GraphQL SDL, or a .proto file) and produces a self-contained Rust crate consisting of:

  • Type-safe Rust structs / enums for the spec’s data models.
  • A reqwest-based asynchronous client (for OpenAPI and GraphQL) or a tonic-shaped scaffold (for gRPC) with one method per operation.
  • A clap CLI that exposes every operation as a subcommand.
  • A SKILL.md file with YAML frontmatter for Claude Code.
  • An mcp.json file describing the CLI as MCP-callable tools.
  • A module.json manifest that the [oxide_k] kernel can discover and register as a module.

The crate exposes three layers:

Re-exports§

pub use error::GenError;
pub use error::Result;
pub use ir::ApiKind;
pub use ir::ApiSpec;

Modules§

emit
Emitters convert an ApiSpec into on-disk artifacts.
error
Error types for oxide-gen.
ir
Intermediate Representation
parsers
Parsers convert each spec format into a common crate::ir::ApiSpec.

Functions§

generate_from_path
Top-level entry point: parse the spec at spec_path, optionally overriding the auto-detected kind, then emit a complete generated crate into output_dir.