> ## 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 sccache setup

Set up a remote sccache cache.

`cache sccache setup` configures [sccache](https://github.com/mozilla/sccache) to use Namespace's high-performance remote caching and outputs the required environment variables.

## Usage

```bash theme={null}
nsc cache sccache setup [--cache_name <name>] \
    [--output <plain|json>] \
    [--site <site>] \
    [--token <path>]
```

### Example output

Run the setup command to print the required environment variables:

```bash theme={null}
nsc cache sccache setup
```

```text nocopy Output theme={null}
SCCACHE_WEBDAV_ENDPOINT=https://cache.namespace.so:8080
SCCACHE_WEBDAV_KEY_PREFIX=sccache/my-cache/
SCCACHE_WEBDAV_TOKEN=scc_token_abc123...
```

### Example in a local shell

<Steps titleSize="h4">
  <Step title="Export the configuration">
    Export the generated `KEY=value` configuration into your shell:

    ```bash theme={null}
    export $(nsc cache sccache setup)
    ```
  </Step>

  <Step title="Start sccache">
    Start the sccache server with the exported configuration:

    ```bash theme={null}
    sccache --start-server
    ```
  </Step>
</Steps>

### Example in GitHub Actions

<Steps titleSize="h4">
  <Step title="Configure the environment">
    Append the generated configuration to `$GITHUB_ENV` in one workflow step:

    ```bash theme={null}
    nsc cache sccache setup >> "$GITHUB_ENV"
    ```
  </Step>

  <Step title="Start sccache">
    Start the sccache server in a subsequent workflow step:

    ```bash theme={null}
    sccache --start-server
    ```
  </Step>
</Steps>

## Options

<h3 id="--output--o-format">
  \--output, -o \<format>
</h3>

Output format. One of `plain` or `json`. Default is `plain`.

<h3 id="--cache_name-name">
  \--cache\_name \<name>
</h3>

A name for the cache.

<h3 id="--site-site">
  \--site \<site>
</h3>

Site preference (e.g. `iad`, `fra`). If not set, determined automatically.

<h3 id="--token-path">
  \--token \<path>
</h3>

Use the bearer token stored at this location for authentication instead of the default.
