Enable one or more package features.

Section: Features

Build with selected features

bash
bash
cargo build --features json,color
Explanation

Use a comma-separated feature list for the local package.

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 Features
Define package features
Declare named features in the manifest.
OpenIn sheettomlsame section
Disable default features
Build or test without defaults.
OpenIn sheetbashsame section
Enable all features
Build everything gated by features.
OpenIn sheetbashsame section
Build every member
Compile all packages in the workspace.
OpenIn sheetbash2 tag match
Add build dependencies
Use crates inside `build.rs` build scripts.
OpenIn sheettoml2 tag match
Add a crates.io dependency
Use a semantic version requirement.
OpenIn sheettoml1 tag match