cargo-edit alternatives and similar packages
Based on the "Cargo" category.
Alternatively, view cargo-edit alternatives based on common mentions on social networks and blogs.
cargo-watch8.0 8.1 cargo-edit VS cargo-watchWatches over your Cargo project's source.
cargo-outdated6.8 0.0 cargo-edit VS cargo-outdatedA cargo subcommand for displaying when Rust dependencies are out of date
cargo-script6.0 0.0 cargo-edit VS cargo-scriptCargo script subcommand
cargo-graph4.6 0.0 cargo-edit VS cargo-graphupdated fork of cargo-dot with additional features
cargo-count3.3 0.0 cargo-edit VS cargo-counta cargo subcommand for counting lines of code in Rust projects
cargo-check2.9 0.0 cargo-edit VS cargo-checka wrapper around cargo rustc -- -Zno-trans which can be helpful for running a faster compile if you only need correctness checks
cargo-dot1.8 0.0 cargo-edit VS cargo-dotGenerate graphs of a Cargo project's dependencies
cargo-do1.3 0.0 cargo-edit VS cargo-doallows you to run multiple cargo commands in a row
cratehub1.0 6.3 cargo-edit VS cratehub🦀 A browser extension to explore rust cargo dependencies on GitHub repos
cargo-multi0.8 0.0 cargo-edit VS cargo-multiExtends cargo to execute the given command on multiple crates - upstream is at
cargo-infoqueries crates.io for crates details from command line
TestGPT | Generating meaningful tests for busy devs
Do you think we are missing an alternative of cargo-edit or a related project?
This tool extends Cargo to allow you to add, remove, and upgrade dependencies by modifying your
Cargo.toml file from the command line.
Currently available subcommands:
Ensure that you have a fairly recent version of rust/cargo installed. On Ubuntu you would also need to install
$ cargo install cargo-edit
If you wish to use a bundled version of
$ cargo install cargo-edit --features vendored-openssl
Compiler support: requires rustc 1.44+
cargo's documentation to learn how
cargo install works and how to set up your system so it finds binaries installed by
Install a sub-set of the commands with
cargo install -f --no-default-features --features "<COMMANDS>", where
<COMMANDS> is a space-separated list of commands; i.e.
add rm upgrade for the full set.
cargo add is now integrated into
cargo as of v1.62. If you want access in older versions of
cargo, you'll need to install
cargo-edit v0.9 or earlier.
Known differences from
cargo add <path>is unsupported, instead use
cargo add --path <path>
cargo add <crate> +<feature>is unsupported, instead use
cargo add <crate> -F <feature>
- If adding multiple crates, qualify the feature like
cargo add serde -F serde/derive serde_json
- See rust-lang/cargo#10809
- If adding multiple crates, qualify the feature like
Remove dependencies from your
$ # Remove a dependency $ cargo rm regex $ # Remove a development dependency $ cargo rm regex --dev $ # Remove a build dependency $ cargo rm regex --build
$ cargo-rm rm --help Remove a dependency from a Cargo.toml manifest file Usage: cargo rm [OPTIONS] <DEP_ID>... Arguments: <DEP_ID>... Dependencies to be removed Options: --manifest-path <PATH> Path to the manifest to remove a dependency from -p, --package <PKGID> Package to remove from -Z <FLAG> Unstable (nightly-only) flags --dry-run Don't actually write the manifest -q, --quiet Do not print any output in case of success -h, --help Print help information -V, --version Print version information Section: -D, --dev Remove as development dependency -B, --build Remove as build dependency --target <TARGET> Remove as dependency from the given target platform
Upgrade dependencies in your
Cargo.toml to their latest versions.
To specify a version to upgrade to, provide the dependencies in the
<crate name>@<version> format,
cargo upgrade -p [email protected]~0.9.0 -p [email protected]>=0.9,<2.0.
This command differs from
cargo update, which updates the dependency versions recorded in the
local lock file (Cargo.lock).
# Upgrade all dependencies for the current crate $ cargo upgrade # Upgrade docopt (to ~0.9) and serde (to >=0.9,<2.0) $ cargo upgrade -p [email protected]~0.9 -p [email protected]>=0.9,<2.0 # Upgrade all dependencies except docopt and serde $ cargo upgrade --exclude docopt --exclude serde
$ cargo-upgrade upgrade --help Upgrade dependency version requirements in Cargo.toml manifest files Usage: cargo upgrade [OPTIONS] Options: --dry-run Print changes to be made without making them --manifest-path <PATH> Path to the manifest to upgrade --offline Run without accessing the network --locked Require `Cargo.toml` to be up to date -v, --verbose Use verbose output -Z <FLAG> Unstable (nightly-only) flags -h, --help Print help information -V, --version Print version information Version: --compatible [<allow|ignore>] Upgrade to latest compatible version [default: allow] -i, --incompatible [<allow|ignore>] Upgrade to latest incompatible version [default: ignore] --pinned [<allow|ignore>] Upgrade pinned to latest incompatible version [default: ignore] Dependencies: -p, --package <PKGID[@<VERSION>]> Crate to be upgraded --exclude <PKGID> Crates to exclude and not upgrade --recursive [<true|false>] Recursively update locked dependencies [default: true]
Set the version in your
# Set the version to the version 1.0.0 $ cargo set-version 1.0.0 # Bump the version to the next major $ cargo set-version --bump major # Bump version to the next minor $ cargo set-version --bump minor # Bump version to the next patch $ cargo set-version --bump patch
$ cargo-set-version set-version --help Change a package's version in the local manifest file (i.e. Cargo.toml) Usage: cargo set-version [OPTIONS] [TARGET] Arguments: [TARGET] Version to change manifests to Options: --bump <BUMP> Increment manifest version -m, --metadata <METADATA> Specify the version metadata field (e.g. a wrapped libraries version) --manifest-path <PATH> Path to the manifest to upgrade -p, --package <PKGID> Package id of the crate to change the version of --all [deprecated in favor of `--workspace`] --workspace Modify all packages in the workspace --dry-run Print changes to be made without making them --exclude <EXCLUDE> Crates to exclude and not modify --offline Run without accessing the network --locked Require `Cargo.toml` to be up to date -Z <FLAG> Unstable (nightly-only) flags -h, --help Print help information -V, --version Print version information
For more on
metadata, see the
semver crate's documentation.
Related Cargo Commands
Thanks for your interest - we gratefully welcome contributions.
Questions can be asked in issues, or on Gitter.
To help us help you get pull requests merged quickly and smoothly, open an issue before submitted large changes. Please keep the contents of pull requests and commits short. Commit messages should include the intent of the commit.
cargo-edit has a moderately comprehensive test suite. Contributions that add/improve tests are awesome. Please add tests for every change.
rustfmt for formatting and
clippy for linting.
*Note that all licence references and agreements mentioned in the cargo-edit README section above are relevant to that project's source code only.