README.md
January 30, 2026 ยท View on GitHub
smithy4rs
Smithy code generators for Rust
Smithy code generators for shapes, clients, servers in Rust.
Generated shapes provide runtime access to schema metadata and implement schema-guided (de)serialization to support any number of protocols.
Note
smithy4rs is an unofficial, community-supported code generator.
This repository contains:
smithy-buildplugins that execute code generation from Smithy model definitions.- Core packages to support the runtime behavior of generated shapes.
- Protocol definitions and other packages for building high-performance clients and services with generated shapes.
Documentation
For user-guides and general documentation see the Documentation Site.
For API documentation see our Rust docs.
Getting started
Note
If you are new to Smithy, we recommend going through the Smithy Quickstart
guide before using smithy4rs.
Prerequisites
- Ensure you have installed rust and cargo
- Ensure you have the Smithy CLI installed. To check if you have the CLI installed, Run
smithy --versionin your terminal. If you need to install the CLI, see the Smithy CLI installation guide. - Install
cargo-generate
Copy the template
Run the following command to copy the type-codegen template:
cargo generate --git https://github.com:mellemahp/smithy4rs-type-codegen-template.git
This template uses the rust-types build plugin to generate standalone types from any Smithy models
in the model/ directory.
Build
Now, cd into the project directory created by cargo generate and run cargo test to build and
test the generate shapes.
Next steps
Try modifying the Smithy models in the model/ directory to see what different shapes you can generate.
For a longer, guided introduction to this project, see the smithy4rs Quick Start Guide.
Core packages
-
Core
smithy4rs-core- Core functionality for all generated shapessmithy4rs-core-derive- Provides derive macros used to automatically implement schema-guided (de)serialization for generated shapes.
-
Codegen
codegen:core- Provides common functionality for all codegen plugins. Only plugins should depend on this directly.codegen:plugins- Aggregate package that provides all code generation plugins. Depend on this insmithy-build.jsonfiles.
-
Codecs
json- Schema-guided (de)serialization for JSON.
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.