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, test details, task execution performance, network activity, and resolved dependencies
- Filter test results by outcome (passed, failed, skipped, flaky, notSelected)
- 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)
Pre-built binaries (Linux)
See Releasing to build and publish tarballs. Consumers (e.g. Docker) can then use DVCLI_RELEASE_BASE_URL to download instead of building from source.
Releasing
To build Linux binaries for GitHub Releases (used by the hachi-worker Docker image and others):
-
From macOS: install cross so you can cross-compile to Linux:
-
Build and package:
This reads the version from
Cargo.toml, builds forx86_64-unknown-linux-gnuandaarch64-unknown-linux-gnu, and writes:dist/dvcli-<version>-x86_64-unknown-linux-gnu.tar.gzdist/dvcli-<version>-aarch64-unknown-linux-gnu.tar.gz
Each tarball contains a single binary nameddvcli.
-
Create a GitHub release and upload the tarballs:
-
Consumers can then use the pre-built binary, e.g. in Docker:
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, task-execution, network-activity, dependencies, all |
all |
-v, --verbose |
- | Show stacktraces, per-task details, and verbose output | false |
--test-outcomes <OUTCOMES> |
- | Filter tests by outcome (comma-separated): passed, failed, skipped, flaky, notSelected |
- |
--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 only failed tests
# Show failed and flaky tests with detailed output
# Show task execution performance (cache avoidance, per-task timing)
# Show per-task details with cache artifact sizes
# Show network activity (downloads, repositories, HTTP methods)
# Show all repositories (not just top 5)
# Show resolved dependencies (grouped by type)
# Show dependencies with repository and purl details
# Note: the same dependency may appear multiple times in the output if the API
# reports it resolved from multiple sources (e.g., once from local/configuration
# cache without a repository URL, and once from a remote repository).
# Investigate a build failure: result + failures + task execution
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
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)
2. com.example.OtherTest > testFeature (85ms)
Task Execution (350 tasks, 62% avoidance)
──────────────────────────────────────────
Build time: 2m 15s
Task execution: 1m 48s (effective), 12m 30s (serial)
Parallelism: 6.9x serialization factor
Avoided: 218 tasks (saved 8m 45s)
• Up-to-date: 6m 12s
• Local cache: 1m 30s
• Remote cache: 1m 3s
Executed: 132 tasks
▸ Breakdown:
218 UP-TO-DATE
45 FROM-CACHE (local)
12 FROM-CACHE (remote)
75 EXECUTED (cacheable)
[Use --verbose for per-task details]
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-failures- Build and test failuresGET /api/tests/build/{id}- Test execution resultsGET /api/builds/{id}/gradle-build-cache-performance- Task execution and cache performanceGET /api/builds/{id}/gradle-network-activity- Network activity (requires Gradle 3.5+ with Develocity Gradle Plugin 1.6+)GET /api/builds/{id}/gradle-dependencies- Resolved dependency list
Requirements
- Rust 1.70+ (for building from source)
- Develocity server with API access enabled
- Valid access key with read permissions
License
MIT