## Getting started

To use Pants caching, you can produce a ready-to-use configuration using the [CLI](/content/docs/reference/cli/installation/index.html):

1. ### Configure cache access
   
   ```bash
   nsc cache pants setup --pants-toml=/tmp/pants.toml
   ```
   This command generates short-term credentials, and sets up a Pants configuration file.

2. ### Use the Pants cache
   
   ```bash
   pants --pants-config-files="['/your/own/pants.toml', '/tmp/pants.toml']" test ::
   ```
   As demonstrated, you can pass multiple configuration files allowing you to combine your existing configuration with Namespace cache access.

### GitHub Actions Example
   
   ```yaml
   jobs:
     build:
       runs-on: namespace-profile-default
       steps:
         - name: Setup Pants cache
           run: |
             nsc cache pants setup --pants-toml=/tmp/pants.toml
         - name: Pants test
           run: |
             pants --pants-config-files="['/your/own/pants.toml', '/tmp/pants.toml']" test ::
   ```
   The `pants.toml` path can be customized if you need to use a specific configuration file.

## How it works

The Pants remote caching solution employs a tiered caching approach, where the hot cache lives as close to the consumer (e.g. your CI job runner) as possible. The cold caching tier is backed by our [high-performance artifact storage](/content/docs/architecture/storage/artifact-storage/index.html) and enables Pants to retain a vast amount of cached artifacts. Access to the Pants cache is granted through short-lived secure credentials.

## Usage

Namespace accounts Pants cache usage in two categories:

- Pants cache storage
- Pants cache reads

For detailed billing information for each item as well as included amounts in your plans, visit [the pricing page](/content/pricing/index.html).
