CLI reference#

The authoritative reference is cargo fc --help. This page mirrors it.

Usage#

cargo fc [+toolchain] [SUBCOMMAND] [SUBCOMMAND_OPTIONS]
cargo fc [+toolchain] [OPTIONS] [CARGO_OPTIONS] [CARGO_SUBCOMMAND]

Subcommands#

SubcommandDescription
matrixPrint the JSON feature-combination matrix to stdout. Add --pretty for indented JSON.
versionPrint version information.

Options#

FlagDescription
-h, --helpPrint help information.
-V, --versionPrint version information.
--manifest-path <path>Path to the Cargo.toml to inspect.
-p, --package <name>Include only this workspace package (repeatable).
--exclude <name>Exclude a workspace package (repeatable). Pairs with --workspace for Cargo-compatible selection.
--diagnostics-onlyShow only diagnostics (warnings/errors) per combination. Requires a command that emits rustc JSON diagnostics (build, check, clippy, doc, or an equivalent alias/wrapper).
--dedupeLike --diagnostics-only, but also deduplicate identical diagnostics across combinations.
--summary-onlyHide cargo output; show only the final summary.
--fail-fastStop on the first failing combination.
--errors-onlyAllow all warnings, show errors only (-A warnings). Appends to RUSTFLAGS.
--pedanticTreat warnings like errors in the summary and under --fail-fast.
--show-prunedShow pruned (redundant) combinations in the summary.
--no-prune-impliedDisable automatic pruning of redundant combinations.
--packages-onlyIn matrix mode, emit one row per package-target instead of per combination.
--only-packages-with-lib-targetOnly consider packages that have a library target.
--aggregate-targetsBatch a combination’s configured targets into a single Cargo invocation (one --target each). Faster on many cores; falls back to serial for run and pruned summaries.
--no-targetsIgnore configured target lists for this run; use Cargo’s default single target.
--install-missing-targetsInstall missing Rust target components with rustup before running. Explicit opt-in — may mutate the toolchain and use the network.
--driver <bin>Program invoked in place of cargo for each build (e.g. cargo-zigbuild, cross). See Build drivers.

Most boolean flags can also be set as defaults in Cargo.toml; CLI flags always win for a single invocation.

Environment variables#

VariableEffect
CARGOProgram used for plain Cargo invocations.
CARGO_DRIVERSet in child processes to the resolved driver.
CARGO_FC_VERBOSEBoolean default for verbose cargo fc headers.

Notes#

  • Cargo-fc boolean flags do not accept an inline value (--summary-only=false is rejected). Configure false defaults in Cargo.toml instead.
  • --dedupe implies --diagnostics-only. Setting --dedupe together with diagnostics_only = false in config is rejected as contradictory.
  • Everything after -- is forwarded to the invoked program and never interpreted by cargo fc.