dvcli - Develocity CLI Client
An AI agent friendly command-line tool for querying Gradle build information from a Develocity server.
Features
- Query Gradle build scan details from Develocity REST API
- Display build results, deprecations, failures, and test details
- Human-readable colored output or JSON for scripting
- Configurable via CLI arguments, environment variables, or config file
- Shell completions for bash, zsh, fish, and PowerShell
Installation
From crates.io
From Source
# Binary is at target/release/dvcli
Move to PATH (optional, source build)
Usage
Arguments
| Argument | Description |
|---|---|
BUILD_SCAN_ID |
The Build Scan ID (e.g., abc123xyz) |
Options
| Option | Environment Variable | Description | Default |
|---|---|---|---|
-s, --server <URL> |
DEVELOCITY_SERVER |
Develocity server URL | - |
-t, --token <TOKEN> |
DEVELOCITY_API_KEY |
Access key for authentication | - |
-o, --output <FORMAT> |
- | Output format: json, human |
human |
-i, --include <ITEMS> |
- | Data to include: result, deprecations, failures, tests, all |
all |
-v, --verbose |
- | Show stacktraces and verbose output | false |
--timeout <SECS> |
- | Request timeout in seconds | 30 |
-c, --config <PATH> |
- | Config file path | ~/.develocity/config.toml |
Examples
# Basic usage
# Using environment variables
# JSON output for scripting
|
# Only show failures with stacktraces
# Show result and deprecations (no failures)
# Show only test results
# Show test results with detailed output (stdout/stderr, stacktraces)
Configuration
Config File
Create ~/.develocity/config.toml:
= "https://ge.example.com"
= "your-access-key"
= 60
Configuration Priority
- CLI arguments (highest priority)
- Environment variables
- Config file (
~/.develocity/config.toml) - Default values
Output
Human-Readable (default)
Build Scan: https://ge.example.com/s/abc123xyz
─────────────────────────────────────────────
Result
Status: SUCCESS
Duration: 45s
Project: my-project
Gradle: 8.5
Requested: build
Tags: CI, main
User: ci-user
Host: build-agent-01
Deprecations (2)
├─ The BuildListener.buildStarted(Gradle) method has been deprecated
│ Removal: Gradle 9.0
│ Advice: Use BuildListener.beforeSettings(Settings) instead
│ Usages: 1 in plugin
│
└─ ...
Failures
Build Failures (1)
✗ Execution failed for task ':compileJava'
Compilation failed; see compiler error output for details.
Test Failures (3)
✗ com.example.MyTest.testSomething
Expected true but was false
Tests (95 passed, 3 failed, 2 skipped)
Total: 100 tests in 45s
Pass rate: 95.0%
✗ Failed Tests:
1. com.example.MyTest > testSomething (120ms)
Expected true but was false
2. com.example.OtherTest > testFeature (85ms)
NullPointerException: value cannot be null
JSON
Shell Completions
Generate shell completions for your shell:
# Bash (add to ~/.bashrc)
# Zsh (add to ~/.zshrc)
# Fish
# PowerShell (add to profile)
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success (even if build failed - failure data is valid output) |
| 1 | Configuration error (missing server/token) |
| 2 | Network error (connection failed, timeout) |
| 3 | Authentication error (invalid token) |
| 4 | Not found (build scan doesn't exist) |
| 5 | Wrong build type (not a Gradle build) |
| 6 | API error (unexpected response) |
API Endpoints Used
GET /api/builds/{id}- Validate build exists, check build tool typeGET /api/builds/{id}/gradle-attributes- Build result informationGET /api/builds/{id}/gradle-deprecations- Deprecation warningsGET /api/builds/{id}/gradle-tests- Test execution resultsGET /api/builds/{id}/gradle-build-cache-performance- (future)
Requirements
- Rust 1.70+ (for building from source)
- Develocity server with API access enabled
- Valid access key with read permissions
License
MIT