<!-- llms-index: https://docs.gradle.com/develocity/llms.txt -->

<a id="component-eol-banner"></a>

You are viewing **Develocity Artifact Cache CLI 0.11**. To view the latest available version of the docs, see [1.1](https://docs.gradle.com/develocity/artifact-cache/1.1/reference/cli-commands/).

# Artifact Cache CLI Commands Reference

<a id="preamble"></a>

Please fill out [this request form](https://gradle.com/develocity/product/universal-cache/contact/) to get started with Artifact Cache or Setup Cache.

* * *

This section provides an overview of the commands available in the Artifact Cache CLI. Each command is described along with its options and their functionalities.

<a id="global-options"></a>

## Global Options

```bash
java -jar develocity-artifact-cache-cli.jar [GLOBAL OPTIONS] COMMAND
```

<a id="v-version"></a>

### `-v, --version`

Prints the version information and exits.

```bash
java -jar develocity-artifact-cache-cli.jar --version
```

<a id="commands-overview"></a>

## Commands Overview

The Artifact Cache CLI provides two primary commands:

*   `store` - Stores content in the Develocity Artifact Cache and Setup Cache
    
*   `restore` - Restores content from the Develocity Artifact Cache and Setup Cache
    

<a id="restore-command"></a>

## `restore` Command

Restores content from the Develocity Artifact Cache and Setup Cache.

<a id="syntax"></a>

### Syntax

```bash
java -jar develocity-artifact-cache-cli.jar restore [OPTIONS]
```

<a id="required-options"></a>

### Required Options

**--dv-server=<url>** — The Develocity server URL.

Example: `--dv-server=https://develocity.example.com`

<a id="cache-selection-options"></a>

### Cache Selection Options

At least one build tool has to be configured to indicate which build tool content to restore. Build tools are autodetected by default, but can also be disabled or configured explicitly.

**--autodetect=<tool>[,<tool>…​]** — Specifies which build tool to autodetect and cache for.

Defaults to all values.

Valid values: `MAVEN`, `GRADLE`, `NPM`

**--no-autodetect=<tool>[,<tool>…​]** — Specifies which build tool to exclude from autodetection.

Valid values: `MAVEN`, `GRADLE`, `NPM`

**--gradle-home=<path>** — Location to restore Gradle content.

Example: `--gradle-home=$HOME/.gradle`

**--maven-home=<path>** — Location to restore Maven content.

Example: `--maven-home=$HOME/.m2`

**--maven-repository=<path>** — Location to restore the Maven local repository. Defaults to `←-maven-home>/repository`.

Example: `--maven-repository=/custom/path/to/repo`

> [!WARNING]
> Required when using a custom Maven repository path (e.g., via `-Dmaven.repo.local` or `localRepository` in `settings.xml`).

**--npm-home=<path>** — Location to restore npm content.

Example: `--npm-home=$HOME/.npm`

<a id="image-management-options"></a>

### Image Management Options

**--image-name=<name>** — Name to use when restoring this Develocity Artifact Cache and Setup Cache image. If absent, an image name will be generated automatically for supported CI providers (GitHub Actions, Jenkins).

Can be specified multiple times to provide fallback image names.

Example: `--image-name=my-project-main --image-name=my-project-fallback`

**--refresh-every-period=<period>** — Period in ISO-8601 format (without time component) after which the cache is refreshed.

Default: `P1M` (one month)

Example: `--refresh-every-period=P2W` (refresh every 2 weeks)

When combined with `--refresh-every-generation`, the first condition to trigger will refresh the cache.

**--refresh-every-generation=<number>** — Number of generations after which the cache is refreshed (counting starts at 1).

Example: `--refresh-every-generation=10`

Combines with `--refresh-every-period` - the first condition to trigger will refresh the cache.

**--refresh-now** — Forces an unconditional refresh of the cache. Use this to manually trigger a cache refresh, typically when you want to rebuild the image from scratch.

Example: `--refresh-now`

<a id="performance-options"></a>

### Performance Options

**--timeout=<duration>** — Time to wait for the command to complete, in ISO-8601 format.

Default: `PT10M` (10 minutes)

Example: `--timeout=PT15M` (15 minutes)

**--operation-timeout=<duration>** — Time to wait for an individual operation to complete, in ISO-8601 format.

Default: `PT60S` (60 seconds)

Example: `--operation-timeout=PT120S` (2 minutes)

**--operation-concurrency=<number>** — The maximum number of parallel operations to run.

Default: Number of processors (or set to 0 for automatic detection)

Example: `--operation-concurrency=4`

<a id="security-options"></a>

### Security Options

**--allow-untrusted-server** — Allows untrusted SSL communication.

> [!WARNING]
> Only use this in development or testing environments. Never use in production.

<a id="diagnostic-options"></a>

### Diagnostic Options

**--verbose** — Enables verbose logging for the command. Useful for troubleshooting connection or performance issues.

**--reporting-directory=<path>** — Directory to write reports and logs to.

Default: `<home>/.develocity/artifact-cache/`

Example: `--reporting-directory=/tmp/ac-logs`

**--cache-metrics-file=<file>** — If set, stores cache metrics to this file. Useful for analyzing cache performance and hit rates.

Example: `--cache-metrics-file=cache-metrics.json`

**--dry-run** — Contacts Develocity and outputs statistics about artifacts that would have been downloaded from the Develocity Edge if the feature had been used. No actual restore operations are performed.

Use this to estimate potential time savings before fully implementing Artifact Cache.

<a id="complete-example"></a>

### Complete Example

```bash
java -jar develocity-artifact-cache-cli.jar restore \
  --dv-server=https://develocity.example.com \
  --gradle-home=$HOME/.gradle \
  --image-name=my-project-main \
  --refresh-every-period=P1M \
  --verbose
```

<a id="store-command"></a>

## `store` Command

Stores content in the Develocity Artifact Cache and Setup Cache.

<a id="syntax-2"></a>

### Syntax

```bash
java -jar develocity-artifact-cache-cli.jar store [OPTIONS]
```

<a id="required-options-2"></a>

### Required Options

**--dv-server=<url>** — The Develocity server URL.

Example: `--dv-server=https://develocity.example.com`

<a id="cache-selection-options-2"></a>

### Cache Selection Options

At least one build tool has to be configured to indicate which build tool content to store. Build tools are autodetected by default, but can also be disabled or configured explicitly.

**--autodetect=<tool>[,<tool>…​]** — Specifies which build tool to autodetect and cache for.

Defaults to all values.

Valid values: `MAVEN`, `GRADLE`, `NPM`

**--no-autodetect=<tool>[,<tool>…​]** — Specifies which build tool to exclude from autodetection.

Valid values: `MAVEN`, `GRADLE`, `NPM`

**--gradle-home=<path>** — Location of Gradle User Home directory to store. Activates Gradle support if provided.

Example: `--gradle-home=$HOME/.gradle`

**--maven-home=<path>** — Location of Maven M2 directory to store. Activates Maven support if provided.

Example: `--maven-home=$HOME/.m2`

**--maven-repository=<path>** — Location of the Maven local repository to store. Defaults to `<--maven-home>/repository`.

Example: `--maven-repository=/custom/path/to/repo`

> [!WARNING]
> Required when using a custom Maven repository path (e.g., via `-Dmaven.repo.local` or `localRepository` in `settings.xml`).

**--npm-home=<path>** — Location of the npm cache directory to store. Activates npm support if provided.

Example: `--npm-home=$HOME/.npm`

<a id="image-management-options-2"></a>

### Image Management Options

**--image-name=<name>** — Name to use when storing this Develocity Artifact Cache and Setup Cache image. If absent, an image name will be generated automatically for supported CI providers (GitHub Actions, Jenkins).

Example: `--image-name=my-project-main`

<a id="performance-options-2"></a>

### Performance Options

**--timeout=<duration>** — Time to wait for the command to complete, in ISO-8601 format.

Default: `PT10M` (10 minutes)

Example: `--timeout=PT15M` (15 minutes)

**--operation-timeout=<duration>** — Time to wait for an individual operation to complete, in ISO-8601 format.

Default: `PT60S` (60 seconds)

Example: `--operation-timeout=PT120S` (2 minutes)

**--operation-concurrency=<number>** — The maximum number of parallel operations to run.

Default: Number of processors (or set to 0 for automatic detection)

Example: `--operation-concurrency=4`

<a id="security-options-2"></a>

### Security Options

**--allow-untrusted-server** — Allows untrusted SSL communication.

> [!WARNING]
> Only use this in development or testing environments. Never use in production.

<a id="diagnostic-options-2"></a>

### Diagnostic Options

**--verbose** — Enables verbose logging for the command. Useful for troubleshooting connection or performance issues.

**--reporting-directory=<path>** — Directory to write reports and logs to.

Default: `<home>/.develocity/artifact-cache/`

Example: `--reporting-directory=/tmp/ac-logs`

**--cache-metrics-file=<file>** — If set, stores cache metrics to this file. Useful for analyzing cache performance and upload statistics.

Example: `--cache-metrics-file=cache-metrics.json`

**--dry-run** — Displays statistics about discovered artifacts that would have been stored if the feature had been used. No actual store operations are performed.

Use this to estimate network usage and storage requirements before fully implementing Artifact Cache.

<a id="complete-example-2"></a>

### Complete Example

java -jar develocity-artifact-cache-cli.jar store \\ --dv-server=https://develocity.example.com \\ --gradle-home=$HOME/.gradle \\ --image-name=my-project-main \\ --verbose

<a id="environment-variables"></a>

## Environment Variables

The Artifact Cache CLI respects the following environment variables:

**DEVELOCITY_ACCESS_KEY** — The Develocity access key in the format `<host_name>=<access_key_value>`.

Example: `DEVELOCITY_ACCESS_KEY=develocity.example.com=abcd1234efgh5678`

<a id="related-documentation"></a>

## Related Documentation

*   [Understanding Images](https://docs.gradle.com/develocity/artifact-cache/0.11/concepts/images/)
    
*   [System Requirements](https://docs.gradle.com/develocity/artifact-cache/0.11/reference/requirements/)