A utility for managing cargo dependencies from the command line.
A utility for managing cargo dependencies from the command line.
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 libssl-dev and pkg-config packages.
$ cargo install cargo-edit(Please check cargo's documentation to learn how cargo install works and how to set up your system so it finds binaries installed by cargo.)
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 addcargo 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-edit v0.9.1
cargo add <path> is unsupported, instead use cargo add --path <path>cargo add <crate> +<feature> is unsupported, instead use cargo add <crate> -F <feature>cargo add serde -F serde/derive serde_jsoncargo rmcargo rm is now integrated into cargo as of v1.66. If you want access in older versions of cargo, you'll need to install cargo-edit v0.11 or earlier.
cargo upgradeUpgrade 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,
e.g. cargo upgrade -p docopt@~0.9.0 -p serde@>=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 docopt@~0.9 -p serde@>=0.9,<2.0
# Upgrade all dependencies except docopt and serde
$ cargo upgrade --exclude docopt --exclude serde…cargo set-versionSet the version in your Cargo.toml.
# 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…For more on metadata, see the
semver crate's documentation.
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.
cargo-edit uses rustfmt for formatting and clippy for linting.
Apache-2.0/MIT
No open issues yet, or sync has not completed.