Rust CLI Cheat Sheet/Minimal package manifest

Define package metadata and edition.

Section: Manifest basics

Minimal package manifest

toml
toml
[package]
name = "hello-cli"
version = "0.1.0"
edition = "2021"
Explanation

`Cargo.toml` is the package manifest written in TOML.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Manifest basics
Add dependencies table
Declare crate dependencies in the manifest.
OpenIn sheettomlsame section
Add a named binary target
Expose an extra executable from the same package.
OpenIn sheettomlsame section
Pin minimum Rust version
Require a minimum supported compiler version.
OpenIn sheettomlsame section
Locate the manifest
Print the path to the Cargo.toml file Cargo will use.
OpenIn sheetbash2 tag match
Create a new binary crate
Generate a new package for an executable.
OpenIn sheetbash1 tag match
Show Cargo help
Display top-level help for Cargo.
OpenIn sheetbash1 tag match