랭킹으로 돌아가기

killercup/cargo-edit

Rustkillercup.github.io/cargo-edit/

A utility for managing cargo dependencies from the command line.

rustcargocli
스타 성장
스타
3.4k
포크
165
주간 성장
이슈
67
1k2k3k
2015년 8월2019년 3월2022년 11월2026년 7월
아티팩트crates.iocargo add cargo-edit
README

cargo edit

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:

Build Status Coverage Status crates.io Join the chat at https://gitter.im/cargo-edit/Lobby

Installation

Packaging status

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.

Available Subcommands

cargo add

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-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>
    • If adding multiple crates, qualify the feature like cargo add serde -F serde/derive serde_json
    • See rust-lang/cargo#10809

cargo rm

cargo 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 upgrade

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, 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).

Examples

# 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

Usage

$ cargo-upgrade upgrade --help
Upgrade dependency version requirements in Cargo.toml manifest files

Usage: cargo upgrade [OPTIONS]

Options:
  -n, --dry-run               Print changes to be made without making them
      --manifest-path <PATH>  Path to the manifest to upgrade
      --rust-version <VER>    Override `rust-version`
      --ignore-rust-version   Ignore `rust-version` specification in packages
      --locked                Require `Cargo.toml` to be up to date
  -v, --verbose...            Increase logging verbosity
  -q, --quiet...              Decrease logging verbosity
  -Z <FLAG>                   Unstable (nightly-only) flags
  -h, --help                  Print help
  -V, --version               Print version

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

cargo set-version

Set the version in your Cargo.toml.

Examples

# 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

Usage

$ 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
  -n, --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
  -v, --verbose...            Increase logging verbosity
  -q, --quiet...              Decrease logging verbosity
  -Z <FLAG>                   Unstable (nightly-only) flags
  -h, --help                  Print help
  -V, --version               Print version

For more on metadata, see the semver crate's documentation.

Contribution

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.

License

Apache-2.0/MIT

관련 저장소
farion1231/cc-switch

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Rustcrates.ioMIT Licenseai-toolsclaude-code
ccswitch.io
119.8k8k
rustdesk/rustdesk

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

Rustcrates.ioGNU Affero General Public License v3.0remote-controlremote-desktop
rustdesk.com
118.6k18.1k
rust-lang/rust

Empowering everyone to build reliable and efficient software.

Rustcrates.ioApache License 2.0rustcompiler
rust-lang.org
114.8k15.4k
tauri-apps/tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.

Rustcrates.ioApache License 2.0rustwebview
tauri.app
109.3k3.8k
denoland/deno

A modern runtime for JavaScript and TypeScript.

Rustcrates.ioMIT Licensedenotypescript
deno.com
107.8k6.2k
oven-sh/bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

Rustcrates.ioOtherbunbundler
bun.com
95k4.9k
unionlabs/union

The trust-minimized, zero-knowledge bridging protocol, designed for censorship resistance, extremely high security, and usage in decentralized finance.

Rustcrates.ioApache License 2.0blockchaincosmos
union.build
73.9k3.9k
rtk-ai/rtk

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Rustcrates.ioApache License 2.0agentic-codingai-coding
rtk-ai.app
72.4k4.5k
toeverything/AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

TypeScriptnpmOthereditorcrdt
affine.pro
70.7k5.1k
openinterpreter/openinterpreter

A coding agent for open models like Kimi K3

Rustcrates.ioApache License 2.0coding-agentdeepseek
openinterpreter.com
67.1k5.8k
BurntSushi/ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

Rustcrates.ioThe Unlicenseripgreprecursively-search
66.4k2.7k
alacritty/alacritty

A cross-platform, OpenGL terminal emulator.

Rustcrates.ioApache License 2.0terminal-emulatorsopengl
alacritty.org
65k3.5k