> ## 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 create-token

Create a revocable token for accessing the sccache cache.

`nsc cache sccache create-token` generates a revocable token scoped to
accessing Namespace's remote cache for [sccache](https://github.com/mozilla/sccache).
It's useful for provisioning access outside of the interactive
[`nsc cache sccache setup`](/docs/reference/cli/sccache-setup) flow — for
example, distributing a scoped credential to a CI/CD pipeline or another
environment that shouldn't share your personal login session.

The generated token can be written to a file and used wherever a bearer
token is accepted for sccache authentication, or revoked at any time with
[`nsc token revoke`](/docs/reference/cli/token-revoke).

## Usage

```bash theme={null}
nsc cache sccache create-token [--cache_name <name>] \
    [--expires_in <duration>] \
    [--scope <tenant|user>] \
    [--token <path>]
```

### Example

Create a token scoped to a specific cache with a 10-day expiration:

```bash theme={null}
nsc cache sccache create-token \
  --cache_name my-cache \
  --expires_in 10d \
  --token sccache-token.json
```

## Options

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

Select a sccache cache to grant access to. By default, all sccache caches
can be accessed.

<h3 id="--expires_in">
  \--expires\_in
</h3>

Duration until the token expires. Defaults to `2160h` (90 days). Available
time units are: `h` (hours), `d` (days), `w` (weeks), and `y` (years).

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

Set the scope of the generated access token. Valid options: `tenant`,
`user`. Defaults to `user`. Tokens with `user` scope are bound to the
tenant membership of the current user.

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

Write the token to this file in JSON format. Defaults to `token.json`.

## Related Topics

* [nsc cache sccache setup](/docs/reference/cli/sccache-setup) - Configure sccache to use Namespace's remote cache
* [nsc token create](/docs/reference/cli/token-create) - Create a general-purpose revocable token with custom grants
* [nsc token revoke](/docs/reference/cli/token-revoke) - Revoke a token
