Godot Rust CLI is an easy to incorporate Rust modules into your Godot project.
Note: As of March 30th, 2023 this project is archived. This could change in the future and the README will be updated when that happens.
Note: Godot Rust CLI is below v1.0.0 and may contain bugs, please report any bugs as issues in the GitHub repo or feel free to ask questions in the Discord.
Also keep in mind that the main branch will usually be ahead of the version on crates.io.
Table of Contents
- Introduction
- Prerequisites
- Installation
- Tutorials
- Command Reference
- Compatibility
- Updating
- Questions
- License
Note: Godot Rust CLI is below v1.0.0 and may contain bugs, please report any bugs as issues in the GitHub repo.
Godot Rust CLI is a simple command line interface to help you create and update Rust components for your Godot projects.
Using Rust in your Godot project is great for performance critical code and with Godot Rust CLI, you can create your entire project in Rust or you can mix it with new or existing gdscript.
Currently, Godot Rust CLI supports creating Rust modules for Windows, MacOS, and Linux. If you need support for any other platform just put in a request as an issue in the GitHub repo and it'll be added if possible.
Note: Godot Rust CLI is the successor to Godot Rust Helper. Godot Rust CLI aims to be much more simple but more strict. This also means that Godot Rust CLI doesn't have as many features and it enforces a much more strict project structure.
Note: Godot Rust CLI currently builds Rust modules using the godot-rust (gdnative) crate.
Note: All refrences to modules
refer to project-level modules. Godot Rust CLI does not build editor-level modules.
Godot Rust CLI requires the following prerequisites:
-
bindgen
- This is required to build the requiredgdnative
crate so you should follow the instructions to install it for your operating system. -
The latest version of Rust.
-
rustfmt
- This is need to format files after creating/editing them. You can install this withrustup component add rustfmt
.
To install Godot Rust CLI, use:
cargo install godot-rust-cli
To upgrade your version of Godot Rust CLI to the latest version, use:
cargo install --force godot-rust-cli
Godot Rust Version | Godot Rust CLI Version |
---|---|
0.9.1 | >=0.1.1 |
0.9.3 | >=0.2.0 |
To update your project to be compatible with 0.2.x versions from 0.1.x versions, you will need to rename your project.toml
file to godot-rust-cli.toml
.
Libraries have switched from a toml config to a json config so if you want to update your library it is recommended to check out what the json config looks like and update your local one to match.
A tool is in development to make upgrading between major changes easier. If you need help, questions and concerns are always welcome on Discord.
If you have been developing a plugin, there is unfortunately no way to upgrade without creating a new project as there was a major overhaul to plugin creation.
Check out the Discord to ask any questions or concerns about the cli or Godot + Rust in general.