GVC (Gradle Version Catalog Manager)
A fast, standalone CLI for managing Gradle version catalogs (libs.versions.toml): check, list, update, and add dependencies or plugins with confidence.
English | 简体中文
Features
- 🚀 Direct Maven repository queries - No Gradle runtime needed, pure Rust performance
- 📦 Multi-repository support - Maven Central, Google Maven, custom repositories with smart filtering
- 🎯 Intelligent version detection - Semantic versioning with stability filtering (alpha, beta, RC, dev)
- 📋 Four commands:
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
- 🔒 Version reference support - Handles
[versions]table with automatic resolution - 🎨 Beautiful CLI output - Progress bars, colored output, clear summaries
- ⚡ Smart request optimization - Repository filtering based on group patterns to minimize HTTP requests
Prerequisites
- Rust stable (for building from source)
- A Gradle project using version catalogs (
gradle/libs.versions.toml) - Git (optional, for branch/commit features)
- Internet connection (to query Maven repositories)
Installation
From crates.io (Recommended)
From GitHub Releases
Download pre-built binaries from the releases page:
# Linux/macOS
# Or use the install script
|
From source
Or build manually:
# Binary will be in target/release/gvc
Quick Start
- Use
--path /path/to/projectif the catalog lives elsewhere. - Pass
--verbose(or exportGVC_VERBOSE=1) to inspect HTTP traffic, caching, and other diagnostics.
Usage
Command Reference
| 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. |
Check for Updates
View available dependency updates without modifying any files:
# or
By default, only stable versions are shown. To include pre-release versions:
List Dependencies
Display all dependencies in Maven coordinate format (useful for verification):
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
Update Dependencies
Apply dependency updates (stable versions only by default):
Options
--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 directory
Interactive 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.
Targeted Updates
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
- Skip the prompt by omitting
--interactive; GVC selects the newest version that satisfies the stability rules. - Include pre-releases with
--no-stable-onlywhen you want to evaluate beta/RC builds.
Examples:
# Update to stable versions only (default behavior)
# Include unstable versions (alpha, beta, RC)
# Review each update before writing changes
# Target a single dependency by alias pattern
# Update without Git integration
# Update a specific project
Selective Updates
When you pass --filter, GVC narrows the scope to aliases that match your glob expression (case-insensitive). The CLI will:
- List every matching version alias, library, or plugin.
- Prompt you to pick the exact entry to change.
- Fetch available versions from the configured repositories.
- In interactive mode (
-i), let you choose from recent stable and pre-release versions (usemto show more,sto skip,qto cancel). - Without interactive mode, automatically pick the first newer version that respects the
--stable-onlyflag, 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.
Add Dependencies or Plugins
Create new catalog entries directly from Maven or plugin coordinates:
# Libraries: group:artifact:version (default target)
# Plugins: plugin.id:version (-p mirrors npm-style short flags)
# Resolve the newest available version automatically
- GVC auto-generates catalog aliases and version keys (use
--alias/--version-aliasto override). - Library entries are written as
{ module = "group:artifact", version = { ref = "<alias>" } }. - Plugin entries use
{ id = "plugin.id", version = { ref = "<alias>" } }. - Coordinates are verified upstream before writing; libraries query your configured repositories, plugins query the Gradle Plugin Portal. Use
--no-stable-onlyto include pre-release versions when resolving:latest. - The
--pathflag works exactly as with other commands.
How It Works
GVC directly queries Maven repositories without requiring Gradle:
- Project Validation - Checks for
gradle/libs.versions.tomlandgradlew - Repository Configuration - Reads Gradle build files to detect configured Maven repositories
- TOML Parsing - Uses
toml_editto parse version catalog while preserving formatting - Version Resolution:
- Parses dependencies in all supported TOML formats
- Resolves version references from
[versions]table - Queries Maven repositories for latest versions via HTTP
- Applies smart filtering based on repository group patterns
- Version Comparison:
- Semantic versioning support (1.0.0, 2.1.3)
- Filters unstable versions (alpha, beta, RC, dev, snapshot, preview, etc.)
- Prevents version downgrades
- Update Application - Updates TOML file while maintaining original formatting
Supported TOML Formats
GVC supports all Gradle version catalog formats:
# Simple string format
[]
= "com.squareup.okhttp3:okhttp:4.11.0"
# Table format with module
= { = "com.squareup.okhttp3:okhttp", = "4.11.0" }
# Table format with group and name
= { = "com.squareup.okhttp3", = "okhttp", = "4.11.0" }
# Version references (automatically resolved)
[]
= "4.11.0"
[]
= { = "com.squareup.okhttp3", = "okhttp", = "okhttp" }
Smart Repository Filtering
GVC automatically filters repository requests based on dependency group:
- Google Maven - Only queries for
google.*,android.*,androidx.*packages - Maven Central - Queries for all other packages
- Custom Repositories - Respects
mavenContent.includeGroupByRegexpatterns
This significantly reduces unnecessary HTTP requests and speeds up checks.
Architecture Overview
- Workflows in
src/workflow.rsorchestrate CLI commands, progress output, and Git handoff. - Agents encapsulate core responsibilities:
ProjectScannerAgentvalidates Gradle structure and locateslibs.versions.toml.DependencyUpdaterreads, evaluates, and mutates the catalog with repository-aware version lookups.VersionControlAgentguards Git cleanliness and creates update branches plus commits when enabled.
- See AGENTS.md for a deeper dive into responsibilities, extension tips, and developer checklists.
Project Requirements
Your Gradle project must have:
- Version catalog file:
gradle/libs.versions.toml - Gradle wrapper:
gradleworgradlew.bat(for repository detection)
No Gradle plugins required! GVC directly queries Maven repositories and updates your TOML file.
Repository Detection
GVC automatically reads repository configuration from your Gradle build files:
settings.gradle.kts/settings.gradlebuild.gradle.kts/build.gradle
Detected repositories:
mavenCentral()google()gradlePluginPortal()- Custom
maven { url = "..." }declarations - Repository content filters (
mavenContent.includeGroupByRegex)
Examples
Check for Updates
)
)
)
)
[========================================]
[========================================]
)
()
)
List All Dependencies
Troubleshooting
"Gradle wrapper not found"
Ensure your project has gradlew (Linux/Mac) or gradlew.bat (Windows) in the root directory.
"gradle/libs.versions.toml not found"
Make sure your project uses Gradle version catalogs and the file exists at gradle/libs.versions.toml.
"Working directory has uncommitted changes"
Commit or stash your changes before running the update command, or use --no-git to skip Git operations.
Development
Project Structure
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
Building
# Development
# Release (optimized)
Testing
Running in development
# Check updates
# List dependencies
# Update dependencies
See AGENTS.md for an in-depth guide to the agent modules that power these workflows.
License
Apache-2.0
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
-
Clone the repository:
-
Build and test:
-
Run locally:
See CONTRIBUTING.md for more details.
Changelog
See CHANGELOG.md for release history.
Roadmap
- Async HTTP requests for concurrent version queries
- Local caching of Maven metadata
- Interactive TUI mode for selective updates
- Support for Gradle plugin updates (Gradle Plugin Portal integration) ✅
- Configuration file support (
.gvcrc) - Better error messages with suggestions