#cargo #subcommand #testing

app cargo-no-dev-deps

Cargo subcommand for running cargo without dev-dependencies

4 releases

0.2.2 Feb 28, 2023
0.2.1 Jan 24, 2023
0.2.0 Jan 20, 2023
0.1.0 Jan 11, 2023

#307 in Cargo plugins

Download history 25/week @ 2023-01-08 28/week @ 2023-01-15 57/week @ 2023-01-22 34/week @ 2023-01-29 42/week @ 2023-02-05 53/week @ 2023-02-12 40/week @ 2023-02-19 35/week @ 2023-02-26 14/week @ 2023-03-05

142 downloads per month

Apache-2.0 OR MIT

904 lines


crates.io license rustc build status

Cargo subcommand for running cargo without dev-dependencies.

This is an extraction of the cargo-hack's --no-dev-deps flag to be used as a stand-alone cargo subcommand.


$ cargo no-dev-deps --help

Cargo subcommand for running cargo without dev-dependencies.

    cargo no-dev-deps [CARGO_OPTIONS]

To run cargo check without dev-deps:

cargo no-dev-deps check

Note: cargo-no-dev-deps modifies Cargo.toml and Cargo.lock while running and restores it when finished. Any changes you made to those files during running will not be preserved.

If you want exclude publish = false crates, you can exclude these crates by using --no-private flag.

cargo no-dev-deps --no-private check

This flag is more powerful than cargo-hack's --ignore-private flag, which also prevents private crate from affecting lockfile and metadata.


From source

cargo +stable install cargo-no-dev-deps --locked

Compiler support: requires rustc 1.60+

cargo-no-dev-deps is usually runnable with Cargo versions older than the Rust version required for installation (e.g., cargo +1.59 no-dev-deps check).

From prebuilt binaries

You can download prebuilt binaries from the Release page. Prebuilt binaries are available for macOS, Linux (gnu and musl), Windows (static executable), and FreeBSD.

Example of script to download cargo-no-dev-deps
# Get host target
host=$(rustc -Vv | grep host | sed 's/host: //')
# Download binary and install to $HOME/.cargo/bin
curl -LsSf https://github.com/taiki-e/cargo-no-dev-deps/releases/latest/download/cargo-no-dev-deps-$host.tar.gz | tar xzf - -C $HOME/.cargo/bin

On GitHub Actions

You can use taiki-e/install-action to install prebuilt binaries on Linux, macOS, and Windows. This makes the installation faster and may avoid the impact of problems caused by upstream changes.

- uses: taiki-e/install-action@cargo-no-dev-deps

Via Homebrew

You can install cargo-no-dev-deps using Homebrew tap on macOS and Linux:

brew install taiki-e/tap/cargo-no-dev-deps

Via Scoop (Windows)

You can install cargo-no-dev-deps using Scoop:

scoop bucket add taiki-e https://github.com/taiki-e/scoop-bucket
scoop install cargo-no-dev-deps

Via cargo-binstall

You can install cargo-no-dev-deps using cargo-binstall:

cargo binstall cargo-no-dev-deps
  • cargo-hack: Cargo subcommand to provide various options useful for testing and continuous integration.
  • cargo-llvm-cov: Cargo subcommand to easily use LLVM source-based code coverage.
  • cargo-minimal-versions: Cargo subcommand for proper use of -Z minimal-versions.
  • cargo-config2: Library to load and resolve Cargo configuration.


Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~172K SLoC