cargo-interactive-update

Crates.iocargo-interactive-update
lib.rscargo-interactive-update
version0.4.2
sourcesrc
created_at2024-10-14 17:18:26.075538
updated_at2024-10-17 16:31:28.622464
descriptionA cargo extension CLI tool to update your cargo direct dependencies interactively to the latest version
homepage
repositoryhttps://github.com/benjeau/cargo-interactive-update
max_upload_size
id1408495
size53,558
Benoît Jeaurond (BenJeau)

documentation

README

cargo-interactive-update

Build status Crates.io Version

Update your direct dependencies interactively to the latest version via crates.io, similar to pnpm update --interactive --latest from the JS ecosystem.

Installation

Install the cargo extension by installing it from crates.io:

cargo install cargo-interactive-update

Usage

Run the cargo extension:

cargo interactive-update

It will then parse the Cargo.toml file to get the direct dependencies and check them via the crates.io API.

It extracts dependencies from the dependencies, dev-dependencies, build-dependencies and workspace-dependencies sections and updates only the related sections.

If there are outdated dependencies, it will display them and let you select which ones to update, similar to the following:

7 out of the 10 direct dependencies are outdated

Dependencies (1 selected):
● crossterm    2024-08-01 0.28.0  -> 2024-08-01 0.28.1   https://github.com/crossterm-rs/crossterm - A crossplatform terminal library for manipulating terminals.
○ curl         2022-07-22 0.4.44  -> 2024-09-30 0.4.47   https://github.com/alexcrichton/curl-rust - Rust bindings to libcurl for making HTTP requests
○ semver       2024-02-19 1.0.22  -> 2024-05-07 1.0.23   https://github.com/dtolnay/semver - Parser and evaluator for Cargo's flavor of Semantic Versioni
○ serde_json   2024-08-23 1.0.127 -> 2024-09-04 1.0.128  https://github.com/serde-rs/json - A JSON serialization file format

Dev dependencies (1 selected):
● assert_cmd   2023-04-13 2.0.11  -> 2024-08-09 2.0.16   https://github.com/assert-rs/assert_cmd.git - Test CLI Applications.

Build dependencies (0 selected):
○ tonic-build  2022-11-29 0.8.3   -> 2024-09-26 0.12.3   https://github.com/hyperium/tonic - Codegen module of `tonic` gRPC implementation.

Workspace dependencies (1 selected):
● tonic        2022-11-28 0.8.3   -> 2024-09-26 0.12.3   https://github.com/hyperium/tonic - A gRPC over HTTP/2 implementation focused on high performanc


Use arrow keys to navigate, <a> to select all, <i> to invert, <space> to select/deselect, <enter> to update, <esc>/<q> to exit

After selecting the dependencies to update, it will run update the Cargo.toml file and run cargo check if you haven't disabled it via the --no-check flag.

Arguments

  • -a or --all: Selects all dependencies to be updated
  • -y or --yes: Execute without asking for confirmation
  • -n or --no-check: Don't run cargo check after updating
  • -p or --pin: Pin dependencies to exact versions, with an = prefix

For example, if you want to update all dependencies without asking for confirmation, you can run:

cargo interactive-update -ay

or using the long form:

cargo interactive-update --all --yes

License

This project is licensed under the MIT license.

Commit count: 32

cargo fmt