| Crates.io | gvc |
| lib.rs | gvc |
| version | 0.1.1 |
| created_at | 2025-10-26 12:00:21.648164+00 |
| updated_at | 2025-10-28 13:06:48.747319+00 |
| description | CLI manager for Gradle version catalogs—check, list, update, and add dependencies with automatic version aliases |
| homepage | https://github.com/kingsword09/gvc |
| repository | https://github.com/kingsword09/gvc |
| max_upload_size | |
| id | 1901321 |
| size | 264,712 |
A fast, standalone CLI for managing Gradle version catalogs (libs.versions.toml): check, list, update, and add dependencies or plugins with confidence.
English | 简体中文
check - View available updates without applyingupdate - Apply dependency updateslist - Display all dependencies in Maven coordinate formatadd - Insert dependencies or plugins directly into the catalog with version aliasing[versions] table with automatic resolutiongradle/libs.versions.toml)cargo install gvc
Download pre-built binaries from the releases page:
# Linux/macOS
curl -L https://github.com/kingsword09/gvc/releases/download/v0.1.1/gvc-x86_64-unknown-linux-gnu -o gvc
chmod +x gvc
sudo mv gvc /usr/local/bin/
# Or use the install script
curl -sSL https://raw.githubusercontent.com/kingsword09/gvc/main/install.sh | bash
git clone https://github.com/kingsword09/gvc.git
cd gvc
cargo install --path .
Or build manually:
cargo build --release
# Binary will be in target/release/gvc
gvc check # validate project and list available upgrades
gvc update --no-git # apply upgrades without creating a Git branch
--path /path/to/project if the catalog lives elsewhere.--verbose (or export GVC_VERBOSE=1) to inspect HTTP traffic, caching, and other diagnostics.| Command | Purpose | Key Flags |
|---|---|---|
gvc check |
Dry-run scan that validates the project and prints available dependency/plugin upgrades. | --include-unstable to add alpha/beta/RC versions; --path to target another project. |
gvc update |
Applies catalog updates, honoring stability filters and optional Git integration. | --interactive for per-change prompts; --filter "*glob*" for targeted upgrades; --no-git to skip branch/commit; --no-stable-only to include pre-releases. |
gvc list |
Displays the resolved version catalog as Maven coordinates for quick auditing. | --path to point at another project. |
gvc add |
Inserts a new entry into [libraries] (default) or [plugins]. |
-p/--plugin targets plugins; --no-stable-only allows pre-releases when resolving :latest; --alias / --version-alias override generated keys. |
View available dependency updates without modifying any files:
gvc check
# or
gvc --path /path/to/project check
By default, only stable versions are shown. To include pre-release versions:
gvc check --include-unstable
Display all dependencies in Maven coordinate format (useful for verification):
gvc list
Output example:
📦 Dependencies:
Libraries:
androidx.core:core-ktx:1.12.0
com.squareup.okhttp3:okhttp:4.12.0
org.jetbrains.compose.runtime:runtime:1.9.0
Plugins:
org.jetbrains.kotlin.jvm:1.9.0
com.android.application:8.1.0
Summary:
4 libraries
2 plugins
Apply dependency updates (stable versions only by default):
gvc update
--stable-only - Only update to stable versions (enabled by default)--no-stable-only - Allow updates to unstable versions (alpha, beta, RC)-i, --interactive - Review each proposed change before applying it--filter <glob> - Limit updates to dependencies whose alias matches the glob (e.g. *okhttp*)--no-git - Skip Git operations (no branch/commit)--path, -p - Specify project directoryInteractive mode will pause on each candidate upgrade, showing the old/new version and letting you accept, skip, apply all remaining changes, or cancel the run.
When --filter is provided, GVC lists every matching library/version alias/plugin so you can pick a single target. Combine it with -i/--interactive to choose the exact version (stable or pre-release) you want to install.
# Review and pick a version for dependencies with "okhttp" in their alias
gvc update --filter "*okhttp*" --interactive
--interactive; GVC selects the newest version that satisfies the stability rules.--no-stable-only when you want to evaluate beta/RC builds.Examples:
# Update to stable versions only (default behavior)
gvc update
# Include unstable versions (alpha, beta, RC)
gvc update --no-stable-only
# Review each update before writing changes
gvc update --interactive
# Target a single dependency by alias pattern
gvc update --filter "*okhttp*"
# Update without Git integration
gvc update --no-git
# Update a specific project
gvc update --path /path/to/project
When you pass --filter, GVC narrows the scope to aliases that match your glob expression (case-insensitive). The CLI will:
-i), let you choose from recent stable and pre-release versions (use m to show more, s to skip, q to cancel).--stable-only flag, so you can script targeted upgrades.This makes it easy to bump a single dependency—even to a specific pre-release—without touching the rest of the catalog.
Create new catalog entries directly from Maven or plugin coordinates:
# Libraries: group:artifact:version (default target)
gvc add androidx.lifecycle:lifecycle-runtime-ktx:2.6.2
# Plugins: plugin.id:version (-p mirrors npm-style short flags)
gvc add -p org.jetbrains.kotlin.jvm:1.9.24
# Resolve the newest available version automatically
gvc add com.squareup.okhttp3:okhttp:latest
gvc add -p org.jetbrains.kotlin.android:latest --no-stable-only # allow pre-releases when needed
--alias / --version-alias to override).{ module = "group:artifact", version = { ref = "<alias>" } }.{ id = "plugin.id", version = { ref = "<alias>" } }.--no-stable-only to include pre-release versions when resolving :latest.--path flag works exactly as with other commands.GVC directly queries Maven repositories without requiring Gradle:
gradle/libs.versions.toml and gradlewtoml_edit to parse version catalog while preserving formatting[versions] tableGVC supports all Gradle version catalog formats:
# Simple string format
[libraries]
okhttp = "com.squareup.okhttp3:okhttp:4.11.0"
# Table format with module
okhttp = { module = "com.squareup.okhttp3:okhttp", version = "4.11.0" }
# Table format with group and name
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version = "4.11.0" }
# Version references (automatically resolved)
[versions]
okhttp = "4.11.0"
[libraries]
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
GVC automatically filters repository requests based on dependency group:
google.*, android.*, androidx.* packagesmavenContent.includeGroupByRegex patternsThis significantly reduces unnecessary HTTP requests and speeds up checks.
src/workflow.rs orchestrate CLI commands, progress output, and Git handoff.ProjectScannerAgent validates Gradle structure and locates libs.versions.toml.DependencyUpdater reads, evaluates, and mutates the catalog with repository-aware version lookups.VersionControlAgent guards Git cleanliness and creates update branches plus commits when enabled.Your Gradle project must have:
gradle/libs.versions.tomlgradlew or gradlew.bat (for repository detection)No Gradle plugins required! GVC directly queries Maven repositories and updates your TOML file.
GVC automatically reads repository configuration from your Gradle build files:
settings.gradle.kts / settings.gradlebuild.gradle.kts / build.gradleDetected repositories:
mavenCentral()google()gradlePluginPortal()maven { url = "..." } declarationsmavenContent.includeGroupByRegex)$ gvc check
Checking for available updates (stable versions)...
1. Validating project structure...
✓ Project structure is valid
2. Reading Gradle repository configuration...
Found 3 repositories:
• Maven Central (https://repo1.maven.org/maven2)
• Google Maven (https://dl.google.com/dl/android/maven2)
• Gradle Plugin Portal (https://plugins.gradle.org/m2)
3. Checking for available updates...
Checking version variables...
[========================================] 10/10
Checking library updates...
[========================================] 25/25
✓ Check completed
📦 Available Updates:
Found 5 update(s)
(showing stable versions only)
Version updates:
• okio-version 3.16.0 → 3.16.2
• kotlin-version 2.2.20 → 2.2.21
• ktor-version 3.3.0 → 3.3.1
Library updates:
• some-direct-lib 0.9.0 → 0.10.0 (stable)
To apply these updates, run:
gvc update --stable-only
$ gvc list
Listing dependencies in version catalog...
1. Validating project structure...
✓ Project structure is valid
2. Reading version catalog...
✓ Catalog loaded
📦 Dependencies:
Libraries:
androidx.core:core-ktx:1.17.0
com.squareup.okhttp3:okhttp:4.12.0
io.ktor:ktor-server-core:3.3.0
org.jetbrains.compose.runtime:runtime:1.9.0
Plugins:
org.jetbrains.kotlin.jvm:2.2.20
com.android.application:8.13.0
Summary:
4 libraries
2 plugins
Ensure your project has gradlew (Linux/Mac) or gradlew.bat (Windows) in the root directory.
Make sure your project uses Gradle version catalogs and the file exists at gradle/libs.versions.toml.
Commit or stash your changes before running the update command, or use --no-git to skip Git operations.
gvc/
├── src/
│ ├── main.rs # Entry point
│ ├── cli.rs # CLI argument parsing
│ ├── workflow.rs # Command orchestration
│ ├── error.rs # Error types
│ ├── agents/
│ │ ├── dependency_updater.rs # Core update logic
│ │ ├── project_scanner.rs # Project validation
│ │ └── version_control.rs # Git operations
│ ├── gradle/
│ │ └── config_parser.rs # Gradle configuration parsing
│ └── maven/
│ ├── repository.rs # Maven HTTP client
│ ├── version.rs # Version comparison
│ └── mod.rs # Maven coordinate parsing
├── Cargo.toml
└── README.md
# Development
cargo build
# Release (optimized)
cargo build --release
cargo test
# Check updates
cargo run -- check
# List dependencies
cargo run -- list
# Update dependencies
cargo run -- update --no-git
See AGENTS.md for an in-depth guide to the agent modules that power these workflows.
Apache-2.0
Contributions are welcome! Please feel free to submit a Pull Request.
Clone the repository:
git clone https://github.com/kingsword09/gvc.git
cd gvc
Build and test:
cargo build
cargo test
cargo fmt
cargo clippy --all-targets --all-features
Run locally:
cargo run -- check
cargo run -- update --no-git
See CONTRIBUTING.md for more details.
See CHANGELOG.md for release history.
.gvcrc)