Rust
Publish Commands
Publish Rust crates to crates.io for the community. Learn to prepare, version, and publish packages with proper metadata, licensing, and documentation.
6 commands
Pro Tips
Use 'cargo publish --dry-run' to verify everything is correct before actually publishing.
Add 'include' or 'exclude' in Cargo.toml to control which files are packaged — skip tests and examples.
Use 'cargo login' with a token from crates.io/settings/tokens. Keep the token secure.
Common Mistakes
Published crates cannot be deleted from crates.io, only yanked. Double-check before publishing.
Yanked versions are still downloadable by existing Cargo.lock files. Yanking prevents new usage, not existing.