> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# nsc cache buck2 setup

Set up remote caching for Buck2.

`nsc cache buck2 setup` generates a Buck2 configuration for Remote Execution
API storage. Use `--config` to write the configuration to a file and
`--storage` to choose read-only or read-write access.

## Usage

```bash theme={null}
nsc cache buck2 setup [--config <path>] \
    [--key <name>] \
    [--output <plain|json>] \
    [--static] \
    [--static_token_duration <duration>] \
    [--storage <read-only|read-write>] \
    [--token <path>]
```

### Example

Generate a Buck2 configuration for remote caching:

```bash theme={null}
nsc cache buck2 setup --config namespace-cache.buckconfig
```

## Options

### --config string

Write the generated Buck2 configuration to this path. No path is set by
default.

### --key string

Stable identifier that disambiguates parallel execution or storage clusters.
Defaults to `default`. Use a distinct key for a separate cluster.

### -o, --output string

Output format, either `plain` or `json`. Defaults to `plain`.

### --static

Authenticate with a static bearer token instead of an mTLS client
certificate. This is a boolean flag.

### --static\_token\_duration duration

The minimum duration of the configured static token. Requires `--static`.
Defaults to `4h0m0s` (4 hours).

### --storage string

Storage access mode, either `read-only` or `read-write`. Defaults to
`read-write`.

### --token string

Use the bearer token stored at this path for authentication. Implies
`--static`. No token path is set by default.

## Related Topics

* [nsc cache bazel setup](https://namespace.so/docs/reference/cli/bazel-cache-setup.md) - Configure remote caching for Bazel


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.