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

# CLI command reference

> CLI command reference: This document provides a complete reference for all Pinecone CLI commands.

<Note>
  This feature is in [public preview](/release-notes/feature-availability).
</Note>

This document provides a complete reference for all Pinecone CLI commands.

## Command structure

The Pinecone CLI uses a hierarchical command structure. Each command consists of a primary command followed by one or more subcommands and optional flags.

```bash theme={null}
pc <command> <subcommand> [flags]
pc <command> <subcommand> <subcommand> [flags]
```

For example:

```bash theme={null}
# Top-level command with flags
pc target -o "organization-name" -p "project-name"

# Command (index) and subcommand (list)
pc index list

# Command (index) and subcommand (create) with flags
pc index create \
  --name my-index \
  --dimension 1536 \
  --metric cosine \
  --cloud aws \
  --region us-east-1

# Command (auth) and nested subcommands (local-keys prune) with flags
pc auth local-keys prune --id proj-abc123 --skip-confirmation
```

## Getting help

The CLI provides help for commands at every level:

```bash theme={null}
# top-level help
pc --help
pc -h

# command help
pc auth --help
pc index --help
pc project --help

# subcommmand help
pc index create --help
pc project create --help
pc auth configure --help

# nested subcommand help
pc auth local-keys prune --help
```

## Exit codes

All commands return exit code `0` for success and `1` for error.

## Available commands

This section describes all commands offered by the Pinecone CLI.

### Top-level commands

<AccordionGroup>
  <Accordion title="pc login (Authenticate via user login)">
    **Description**

    Authenticate via a web browser. After login, set a [target org and project](/reference/cli/target-context) with `pc target` before accessing data. This command defaults to an initial organization and project to which
    you have access (these values display in the terminal), but you can change them with `pc target`.

    **Usage**

    ```bash theme={null}
    pc login
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Log in via browser
    pc login

    # Then set target context
    pc target -o "my-org" -p "my-project"
    ```

    <Note>
      This is an alias for `pc auth login`. Both commands perform the same operation.
    </Note>
  </Accordion>

  <Accordion title="pc logout (Clear credentials / log out)">
    **Description**

    Clears all authentication data from local storage, including:

    * User login token
    * Service account credentials (client ID and secret)
    * Default (manually specified) API key
    * Locally managed keys (for all projects)
    * Target organization and project context

    **Usage**

    ```bash theme={null}
    pc logout
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Clear all credentials and context
    pc logout
    ```

    <Note>
      This is an alias for `pc auth logout`. Both commands perform the same operation. Does not delete managed API keys from Pinecone's servers. Run `pc auth local-keys prune` before logging out to fully clean up.
    </Note>
  </Accordion>

  <Accordion title="pc target (Set target organization and project)">
    **Description**

    Set the target organization and project for the CLI. Supports interactive organization and project selection or direct specification via flags.  For details, see [CLI target context](/reference/cli/target-context).

    **Usage**

    ```bash theme={null}
    pc target [flags]
    ```

    **Flags**

    | Long flag           | Short flag | Description                    |
    | :------------------ | :--------- | :----------------------------- |
    | `--clear`           |            | Clear target context           |
    | `--json`            | `-j`       | Output in JSON format          |
    | `--org`             | `-o`       | Organization name              |
    | `--organization-id` |            | Organization ID                |
    | `--project`         | `-p`       | Project name                   |
    | `--project-id`      |            | Project ID                     |
    | `--show`            | `-s`       | Display current target context |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Interactive targeting after login
    pc login
    pc target

    # Set specific organization and project
    pc target -o "my-org" -p "my-project"

    # Show current context
    pc target --show

    # Clear all context
    pc target --clear
    ```
  </Accordion>

  <Accordion title="pc version (Show CLI version)">
    **Description**

    Displays version information for the CLI, including the version number, commit SHA, and build date.

    **Usage**

    ```bash theme={null}
    pc version
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Display version information
    pc version
    ```
  </Accordion>

  <Accordion title="pc whoami (Show current user)">
    **Description**

    Displays information about the currently authenticated user. To use this command, you must be authenticated via user login.

    **Usage**

    ```bash theme={null}
    pc whoami
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    pc whoami
    ```

    <Note>
      This is an alias for `pc auth whoami`. Both commands perform the same operation.
    </Note>
  </Accordion>
</AccordionGroup>

### Authentication

<AccordionGroup>
  <Accordion title="pc auth clear (Clear specific credentials)">
    **Description**

    Selectively clears specific authentication data without affecting other credentials. At least one flag is required.

    **Usage**

    ```bash theme={null}
    pc auth clear [flags]
    ```

    **Flags**

    | Long flag           | Short flag | Description                                         |
    | :------------------ | :--------- | :-------------------------------------------------- |
    | `--api-key`         |            | Clear only the default (manually specified) API key |
    | `--service-account` |            | Clear only service account credentials              |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Clear only the default (manually specified) API key
    pc auth clear --api-key
    pc auth status

    # Clear service account
    pc auth clear --service-account
    ```

    <Note>
      More surgical than `pc auth logout`. Does not clear user login token or managed keys. For those, use `pc auth logout` or `pc auth local-keys prune`.
    </Note>
  </Accordion>

  <Accordion title="pc auth configure (Configure service account or API key)">
    **Description**

    Configures service account credentials or a default (manually specified) API key.

    Service accounts automatically target the organization and prompt for project selection, unless there is only one project. A default API key overrides any previously specified target organization/project context. When setting a service account, this operation clears the user login token, if one exists.
    For details, see [CLI target context](/reference/cli/target-context).

    **Usage**

    ```bash theme={null}
    pc auth configure [flags]
    ```

    **Flags**

    | Long flag               | Short flag | Description                                          |
    | :---------------------- | :--------- | :--------------------------------------------------- |
    | `--api-key`             |            | Default API key to use for authentication            |
    | `--client-id`           |            | Service account client ID                            |
    | `--client-secret`       |            | Service account client secret                        |
    | `--client-secret-stdin` |            | Read client secret from stdin                        |
    | `--json`                | `-j`       | Output in JSON format                                |
    | `--project-id`          | `-p`       | Target project ID (optional, interactive if omitted) |
    | `--prompt-if-missing`   |            | Prompt for missing credentials                       |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Service account setup (auto-targets org and prompts for project)
    pc auth configure --client-id my-id --client-secret my-secret

    # Service account with specific project
    pc auth configure \
      --client-id my-id \
      --client-secret my-secret \
      -p proj-123

    # Default API key (overrides any target context)
    pc auth configure --api-key pcsk_abc123
    ```

    <Note>
      `pc auth configure --api-key "YOUR_API_KEY"` does the same thing as `pc config set-api-key "YOUR_API_KEY"`. To learn about targeting a project after authenticating with a service account, see [CLI target context](/reference/cli/target-context).
    </Note>
  </Accordion>

  <Accordion title="pc auth local-keys list (List managed keys)">
    **Description**

    Displays all [managed API keys](/reference/cli/authentication#managed-keys) stored locally by the CLI, with various details.

    **Usage**

    ```bash theme={null}
    pc auth local-keys list [flags]
    ```

    **Flags**

    | Long flag  | Short flag | Description                                |
    | :--------- | :--------- | :----------------------------------------- |
    | `--json`   | `-j`       | Output in JSON format                      |
    | `--reveal` |            | Show the actual API key values (sensitive) |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List all locally managed keys
    pc auth local-keys list

    # Show key values
    pc auth local-keys list --reveal

    # After storing a key
    pc api-key create -n "my-key" --store
    pc auth local-keys list
    ```
  </Accordion>

  <Accordion title="pc auth local-keys prune (Delete managed keys)">
    **Description**

    Deletes locally stored [managed API keys](/reference/cli/authentication#managed-keys) from local storage and Pinecone's servers. Filters by origin (`cli`/`user`/`all`) or project ID.

    **Usage**

    ```bash theme={null}
    pc auth local-keys prune [flags]
    ```

    **Flags**

    | Long flag             | Short flag | Description                                                 |
    | :-------------------- | :--------- | :---------------------------------------------------------- |
    | `--dry-run`           |            | Preview deletions without applying                          |
    | `--id`                |            | Prune keys for specific project ID only                     |
    | `--json`              | `-j`       | Output in JSON format                                       |
    | `--origin`            | `-o`       | Filter by origin - `cli`, `user`, or `all` (default: `all`) |
    | `--skip-confirmation` |            | Skip confirmation prompt                                    |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Preview deletions
    pc auth local-keys prune --dry-run

    # Delete CLI-created keys only
    pc auth local-keys prune -o cli --skip-confirmation

    # Delete for specific project
    pc auth local-keys prune --id proj-abc123

    # Before/after check
    pc auth local-keys list
    pc auth local-keys prune -o cli
    pc auth local-keys list
    ```

    <Note>
      This deletes keys from both local storage and Pinecone servers. Use `--dry-run` to preview before committing.
    </Note>
  </Accordion>

  <Accordion title="pc auth login (Authenticate via user login)">
    **Description**

    Authenticate via user login in the web browser. After login, [set a target org and project](/reference/cli/target-context).

    **Usage**

    ```bash theme={null}
    pc auth login
    pc login  # shorthand
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Login and set target
    pc auth login
    pc target -o "my-org" -p "my-project"
    pc index list
    ```

    <Note>
      Tokens refresh automatically and remain valid for up to 120 days. If you're inactive for more than 30 days, you must re-authenticate. Logging in clears any existing service account credentials. This command does the same thing as `pc login`.
    </Note>
  </Accordion>

  <Accordion title="pc auth logout (Clear authentication credentials)">
    **Description**

    Clears all authentication data from local storage, including:

    * User login token
    * Service account credentials (client ID and secret)
    * Default (manually specified) API key
    * Locally managed keys (for all projects)
    * Target organization and project context

    **Usage**

    ```bash theme={null}
    pc auth logout
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Clear all credentials and context
    pc auth logout
    ```

    <Note>
      This command does the same thing as `pc logout`. Does not delete managed API keys from Pinecone's servers. Run `pc auth local-keys prune` before logging out to fully clean up.
    </Note>
  </Accordion>

  <Accordion title="pc auth status (Show authentication status)">
    **Description**

    Shows details about all configured authentication methods.

    **Usage**

    ```bash theme={null}
    pc auth status [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--json`  | `-j`       | Output in JSON format |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Check status after login
    pc auth login
    pc auth status

    # JSON output for scripting
    pc auth status --json
    ```
  </Accordion>

  <Accordion title="pc auth whoami (Show current user information)">
    **Description**

    Displays information about the currently authenticated user. To use this command, you must be authenticated via user login.

    **Usage**

    ```bash theme={null}
    pc auth whoami
    ```

    **Flags**

    None

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    pc auth whoami
    ```

    <Note>
      This command does the same thing as `pc whoami`.
    </Note>
  </Accordion>
</AccordionGroup>

### Indexes

<AccordionGroup>
  <Accordion title="pc index configure (Update index configuration)">
    **Description**

    Modifies the configuration of an existing index.

    **Usage**

    ```bash theme={null}
    pc index configure [flags]
    ```

    **Flags**

    | Long flag                | Short flag | Description                                                     |
    | :----------------------- | :--------- | :-------------------------------------------------------------- |
    | `--name`                 | `-n`       | Index name (required)                                           |
    | `--deletion-protection`  | `-p`       | Enable or disable deletion protection - `enabled` or `disabled` |
    | `--tags`                 |            | Custom user tags (key=value pairs)                              |
    | **Dedicated read nodes** |            |                                                                 |
    | `--read-mode`            |            | Read capacity mode - `ondemand` or `dedicated`                  |
    | `--read-node-type`       |            | Node type for dedicated read - `b1` or `t1`                     |
    | `--read-shards`          |            | Number of shards for dedicated read capacity                    |
    | `--read-replicas`        |            | Number of replicas for dedicated read capacity                  |
    | **Integrated embedding** |            |                                                                 |
    | `--model`                |            | Embedding model name                                            |
    | `--field-map`            |            | Field mapping for embedding (key=value pairs)                   |
    | `--read-parameters`      |            | Read parameters for embedding model (key=value pairs)           |
    | `--write-parameters`     |            | Write parameters for embedding model (key=value pairs)          |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Enable deletion protection
    pc index configure -n my-index -p enabled

    # Add tags
    pc index configure -n my-index --tags environment=production,team=ml

    # Switch to dedicated read capacity
    pc index configure -n my-index \
      --read-mode dedicated \
      --read-node-type b1 \
      --read-shards 2 \
      --read-replicas 2

    # Verify changes
    pc index describe -n my-index
    ```

    <Note>
      Configuration changes may take some time to take effect.
    </Note>
  </Accordion>

  <Accordion title="pc index create (Create a new index)">
    **Description**

    Creates a new index in your Pinecone project. Supports serverless, pod-based, integrated (with embedding model), and BYOC (Bring Your Own Cloud) index types.

    **Usage**

    ```bash theme={null}
    pc index create [flags]
    ```

    **Flags**

    | Long flag                | Short flag | Description                                                                    |
    | :----------------------- | :--------- | :----------------------------------------------------------------------------- |
    | `--name`                 | `-n`       | Index name (required)                                                          |
    | `--dimension`            | `-d`       | Vector dimension (required for standard indexes, optional for integrated)      |
    | `--metric`               | `-m`       | Similarity metric - `cosine`, `euclidean`, or `dotproduct` (default: `cosine`) |
    | `--cloud`                | `-c`       | Cloud provider - `aws`, `gcp`, or `azure`                                      |
    | `--region`               | `-r`       | Cloud region                                                                   |
    | `--vector-type`          | `-v`       | Vector type - `dense` or `sparse` (serverless only)                            |
    | `--source-collection`    |            | Name of the source collection from which to create the index                   |
    | `--schema`               |            | Metadata schema to control which fields are indexed (comma-separated)          |
    | `--deletion-protection`  |            | Deletion protection - `enabled` or `disabled`                                  |
    | `--tags`                 |            | Custom user tags (key=value pairs)                                             |
    | `--json`                 | `-j`       | Output in JSON format                                                          |
    | **Integrated indexes**   |            |                                                                                |
    | `--model`                |            | Integrated embedding model name                                                |
    | `--field-map`            |            | Field mapping for integrated embedding (key=value pairs)                       |
    | `--read-parameters`      |            | Read parameters for embedding model (key=value pairs)                          |
    | `--write-parameters`     |            | Write parameters for embedding model (key=value pairs)                         |
    | **BYOC indexes**         |            |                                                                                |
    | `--byoc-environment`     |            | BYOC environment to use for the index                                          |
    | **Dedicated read nodes** |            |                                                                                |
    | `--read-mode`            |            | Read capacity mode - `ondemand` or `dedicated` (default: `ondemand`)           |
    | `--read-node-type`       |            | Node type for dedicated read - `b1` or `t1`                                    |
    | `--read-shards`          |            | Number of shards (each shard provides 250 GB storage)                          |
    | `--read-replicas`        |            | Number of replicas for higher throughput                                       |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Create serverless index
    pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1

    # Create sparse vector index
    pc index create -n sparse-index -m dotproduct -c aws -r us-east-1 --vector-type sparse

    # With integrated embedding model
    pc index create \
      -n my-index \
      -m cosine \
      -c aws \
      -r us-east-1 \
      --model multilingual-e5-large \
      --field-map text=chunk_text

    # With dedicated read capacity
    pc index create \
      -n my-index \
      -d 1536 \
      -m cosine \
      -c aws \
      -r us-east-1 \
      --read-mode dedicated \
      --read-node-type b1 \
      --read-shards 2 \
      --read-replicas 2

    # With deletion protection
    pc index create \
      -n my-index \
      -d 1536 \
      -m cosine \
      -c aws \
      -r us-west-2 \
      --deletion-protection enabled

    # From collection
    pc index create \
      -n my-index \
      -d 1536 \
      -m cosine \
      -c aws \
      -r eu-west-1 \
      --source-collection my-collection
    ```

    <Note>
      For a list of valid regions for a serverless index, see [Create a serverless index](/guides/index-data/create-an-index).
    </Note>
  </Accordion>

  <Accordion title="pc index delete (Delete an index)">
    **Description**

    Permanently deletes an index and all its data. This operation cannot be undone.

    **Usage**

    ```bash theme={null}
    pc index delete [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--name`  | `-n`       | Index name (required) |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete an index
    pc index delete -n my-index

    # List before and after
    pc index list
    pc index delete -n test-index
    pc index list
    ```
  </Accordion>

  <Accordion title="pc index describe (Show index details)">
    **Description**

    Displays detailed configuration and status information for a specific index.

    **Usage**

    ```bash theme={null}
    pc index describe [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--name`  | `-n`       | Index name (required) |
    | `--json`  | `-j`       | Output in JSON format |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe an index
    pc index describe -n my-index

    # JSON output
    pc index describe -n my-index -j

    # Check newly created index
    pc index create -n test-index -d 1536 -m cosine -c aws -r us-east-1
    pc index describe -n test-index
    ```
  </Accordion>

  <Accordion title="pc index stats (Show index statistics)">
    **Description**

    Displays statistics for an index, including total vector count and namespace breakdown. Optionally filter results with a metadata filter.

    **Usage**

    ```bash theme={null}
    pc index stats [flags]
    ```

    **Flags**

    | Long flag      | Short flag | Description                                                    |
    | :------------- | :--------- | :------------------------------------------------------------- |
    | `--index-name` | `-n`       | Index name (required)                                          |
    | `--filter`     | `-f`       | Metadata filter (inline JSON, `./path.json`, or `-` for stdin) |
    | `--json`       | `-j`       | Output in JSON format                                          |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Get stats for an index
    pc index stats -n my-index

    # Get stats with a metadata filter
    pc index stats -n my-index --filter '{"genre":{"$eq":"rock"}}'

    # Filter from file
    pc index stats -n my-index --filter ./filter.json

    # JSON output
    pc index stats -n my-index -j
    ```
  </Accordion>

  <Accordion title="pc index list (List all indexes)">
    **Description**

    Displays all indexes in your current target project, including various details.

    **Usage**

    ```bash theme={null}
    pc index list [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                                         |
    | :-------- | :--------- | :-------------------------------------------------- |
    | `--json`  | `-j`       | Output in JSON format (includes full index details) |
    | `--wide`  | `-w`       | Show additional columns (host, embed, tags)         |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List all indexes
    pc index list

    # Show additional details
    pc index list --wide

    # JSON output for scripting
    pc index list -j

    # After creating indexes
    pc index create -n test-1 -d 768 -m cosine -c aws -r us-east-1
    pc index list
    ```
  </Accordion>
</AccordionGroup>

### Namespaces

<AccordionGroup>
  <Accordion title="pc index namespace create (Create a namespace)">
    **Description**

    Creates a new namespace within an index. Namespaces allow you to partition vectors within an index.

    **Usage**

    ```bash theme={null}
    pc index namespace create [flags]
    ```

    **Flags**

    | Long flag      | Short flag | Description                                         |
    | :------------- | :--------- | :-------------------------------------------------- |
    | `--index-name` | `-n`       | Index name (required)                               |
    | `--name`       |            | Namespace name (required)                           |
    | `--schema`     |            | Metadata schema for the namespace (comma-separated) |
    | `--json`       | `-j`       | Output in JSON format                               |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Create a namespace
    pc index namespace create -n my-index --name tenant-a

    # Create with metadata schema (comma-separated list of filterable metadata fields)
    pc index namespace create -n my-index --name tenant-b --schema "category,brand"

    # JSON output
    pc index namespace create -n my-index --name tenant-c -j
    ```
  </Accordion>

  <Accordion title="pc index namespace delete (Delete a namespace)">
    **Description**

    Deletes a namespace and all its vectors from an index. This operation cannot be undone.

    **Usage**

    ```bash theme={null}
    pc index namespace delete [flags]
    ```

    **Flags**

    | Long flag      | Short flag | Description               |
    | :------------- | :--------- | :------------------------ |
    | `--index-name` | `-n`       | Index name (required)     |
    | `--name`       |            | Namespace name (required) |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete a namespace
    pc index namespace delete -n my-index --name tenant-a
    ```

    <Warning>
      Deleting a namespace removes all vectors in that namespace. This operation cannot be undone.
    </Warning>
  </Accordion>

  <Accordion title="pc index namespace describe (Show namespace details)">
    **Description**

    Displays detailed information about a specific namespace, including record count and schema configuration.

    **Usage**

    ```bash theme={null}
    pc index namespace describe [flags]
    ```

    **Flags**

    | Long flag      | Short flag | Description               |
    | :------------- | :--------- | :------------------------ |
    | `--index-name` | `-n`       | Index name (required)     |
    | `--name`       |            | Namespace name (required) |
    | `--json`       | `-j`       | Output in JSON format     |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe a namespace
    pc index namespace describe -n my-index --name tenant-a

    # JSON output
    pc index namespace describe -n my-index --name tenant-a -j
    ```
  </Accordion>

  <Accordion title="pc index namespace list (List namespaces)">
    **Description**

    Lists all namespaces within an index, including vector counts.

    **Usage**

    ```bash theme={null}
    pc index namespace list [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                    |
    | :------------------- | :--------- | :----------------------------- |
    | `--index-name`       | `-n`       | Index name (required)          |
    | `--limit`            | `-l`       | Maximum number of results      |
    | `--pagination-token` | `-p`       | Pagination token for next page |
    | `--prefix`           |            | Filter namespaces by prefix    |
    | `--json`             | `-j`       | Output in JSON format          |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List all namespaces
    pc index namespace list -n my-index

    # Filter by prefix
    pc index namespace list -n my-index --prefix "tenant-"

    # Limit results
    pc index namespace list -n my-index --limit 10

    # JSON output
    pc index namespace list -n my-index -j
    ```
  </Accordion>
</AccordionGroup>

### Vectors

<AccordionGroup>
  <Accordion title="pc index vector delete (Delete vectors)">
    **Description**

    Deletes vectors from an index by ID, filter, or deletes all vectors in a namespace.

    **Usage**

    ```bash theme={null}
    pc index vector delete [flags]
    ```

    **Flags**

    | Long flag       | Short flag | Description                                                               |
    | :-------------- | :--------- | :------------------------------------------------------------------------ |
    | `--index-name`  | `-n`       | Index name (required)                                                     |
    | `--namespace`   |            | Namespace to delete from (default: `__default__`)                         |
    | `--ids`         |            | Vector IDs to delete (inline JSON array, `./path.json`, or `-` for stdin) |
    | `--filter`      |            | Metadata filter (inline JSON, `./path.json`, or `-` for stdin)            |
    | `--all-vectors` |            | Delete all vectors in the namespace                                       |
    | `--json`        | `-j`       | Output in JSON format                                                     |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete specific vectors
    pc index vector delete -n my-index --ids '["id1"]'

    # Delete multiple vectors (inline JSON array, or JSON array in a file)
    pc index vector delete -n my-index --ids '["id1", "id2"]'

    # Delete by filter
    pc index vector delete -n my-index --filter '{"genre":"classical"}'

    # Delete all vectors in a namespace
    pc index vector delete -n my-index --namespace old-data --all-vectors
    ```

    <Warning>
      Vector deletion is permanent and cannot be undone.
    </Warning>
  </Accordion>

  <Accordion title="pc index vector fetch (Fetch vectors by ID or filter)">
    **Description**

    Retrieves vectors by their IDs or by a metadata filter, returning the vector values and metadata.

    **Usage**

    ```bash theme={null}
    pc index vector fetch [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                                                              |
    | :------------------- | :--------- | :----------------------------------------------------------------------- |
    | `--index-name`       | `-n`       | Index name (required)                                                    |
    | `--namespace`        |            | Namespace to fetch from (default: `__default__`)                         |
    | `--ids`              | `-i`       | Vector IDs to fetch (inline JSON array, `./path.json`, or `-` for stdin) |
    | `--filter`           | `-f`       | Metadata filter (inline JSON, `./path.json`, or `-` for stdin)           |
    | `--limit`            | `-l`       | Maximum number of vectors to fetch                                       |
    | `--pagination-token` | `-p`       | Pagination token for next page                                           |
    | `--body`             |            | Request body JSON (inline, `./path.json`, or `-` for stdin)              |
    | `--json`             | `-j`       | Output in JSON format                                                    |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Fetch specific vectors by ID
    pc index vector fetch -n my-index --ids '["123","456","789"]'

    # Fetch from a file
    pc index vector fetch -n my-index --ids ./ids.json

    # Fetch by metadata filter
    pc index vector fetch -n my-index --filter '{"genre":{"$eq":"rock"}}'

    # Fetch from a namespace
    pc index vector fetch -n my-index --namespace tenant-a --ids '["doc-123"]'

    # JSON output
    pc index vector fetch -n my-index --ids '["vec1"]' -j
    ```

    <Note>
      Use either `--ids` or `--filter`, not both. When using `--ids`, pagination flags are not applicable.
    </Note>
  </Accordion>

  <Accordion title="pc index vector list (List vector IDs)">
    **Description**

    Lists vector IDs in a namespace with optional pagination.

    **Usage**

    ```bash theme={null}
    pc index vector list [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                                     |
    | :------------------- | :--------- | :---------------------------------------------- |
    | `--index-name`       | `-n`       | Index name (required)                           |
    | `--namespace`        |            | Namespace to list from (default: `__default__`) |
    | `--limit`            | `-l`       | Maximum number of IDs to return                 |
    | `--pagination-token` | `-p`       | Pagination token for next page                  |
    | `--json`             | `-j`       | Output in JSON format                           |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List vector IDs
    pc index vector list -n my-index

    # List from a namespace with limit
    pc index vector list -n my-index --namespace tenant-a --limit 50

    # JSON output
    pc index vector list -n my-index -j
    ```
  </Accordion>

  <Accordion title="pc index vector query (Query vectors)">
    **Description**

    Queries an index for similar vectors using dense vectors, sparse vectors, or vector ID.

    **Usage**

    ```bash theme={null}
    pc index vector query [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                                                                |
    | :------------------- | :--------- | :------------------------------------------------------------------------- |
    | `--index-name`       | `-n`       | Index name (required)                                                      |
    | `--namespace`        |            | Namespace to query (default: `__default__`)                                |
    | `--id`               | `-i`       | Query by vector ID                                                         |
    | `--vector`           | `-v`       | Query vector values (inline JSON array, `./path.json`, or `-` for stdin)   |
    | `--sparse-indices`   |            | Sparse vector indices (inline JSON array, `./path.json`, or `-` for stdin) |
    | `--sparse-values`    |            | Sparse vector values (inline JSON array, `./path.json`, or `-` for stdin)  |
    | `--top-k`            | `-k`       | Number of results to return (default: 10)                                  |
    | `--filter`           | `-f`       | Metadata filter (inline JSON, `./path.json`, or `-` for stdin)             |
    | `--include-values`   |            | Include vector values in results                                           |
    | `--include-metadata` |            | Include metadata in results                                                |
    | `--body`             |            | Request body JSON (inline, `./path.json`, or `-` for stdin)                |
    | `--json`             | `-j`       | Output in JSON format                                                      |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Query by vector ID
    pc index vector query -n my-index --id "doc-123" -k 10 --include-metadata

    # Query by vector values
    pc index vector query -n my-index --vector '[0.1, 0.2, 0.3]' -k 25

    # Query with metadata filter
    pc index vector query -n my-index \
      --vector '[0.1, 0.2, 0.3]' \
      --filter '{"genre":{"$eq":"sci-fi"}}' \
      --include-metadata

    # Query from file (file contains a JSON array that specifies the query vector)
    pc index vector query -n my-index --vector ./embedding.json -k 20

    # Query with sparse vectors (inline)
    pc index vector query -n my-index \
      --sparse-indices '[0, 5, 12]' \
      --sparse-values '[0.5, 0.3, 0.8]' \
      -k 15

    # Query with sparse vectors from files
    # indices.json: [0, 5, 12]
    # values.json: [0.5, 0.3, 0.8]
    pc index vector query -n my-index \
      --sparse-indices ./indices.json \
      --sparse-values ./values.json \
      -k 15

    # Query from stdin (extract embedding from a document)
    # doc.json: {"id": "doc-123", "embedding": [0.1, 0.2, 0.3], "text": "..."}
    jq -c '.embedding' doc.json | pc index vector query -n my-index --vector - -k 10
    ```

    <Note>
      Use `--id`, `--vector`, or sparse vectors (`--sparse-indices` and `--sparse-values`) to specify what to query against. These options are mutually exclusive.
    </Note>
  </Accordion>

  <Accordion title="pc index vector update (Update vectors)">
    **Description**

    Updates a vector's values, sparse values, or metadata by ID, or updates metadata for multiple vectors matching a filter.

    **Usage**

    ```bash theme={null}
    pc index vector update [flags]
    ```

    **Flags**

    | Long flag          | Short flag | Description                                                                    |
    | :----------------- | :--------- | :----------------------------------------------------------------------------- |
    | `--index-name`     | `-n`       | Index name (required)                                                          |
    | `--namespace`      |            | Namespace containing the vector (default: `__default__`)                       |
    | `--id`             |            | Vector ID to update                                                            |
    | `--values`         |            | New vector values (inline JSON array, `./path.json`, or `-` for stdin)         |
    | `--sparse-indices` |            | New sparse indices (inline JSON array, `./path.json`, or `-` for stdin)        |
    | `--sparse-values`  |            | New sparse values (inline JSON array, `./path.json`, or `-` for stdin)         |
    | `--metadata`       |            | New or updated metadata (inline JSON, `./path.json`, or `-` for stdin)         |
    | `--filter`         |            | Metadata filter for bulk update (inline JSON, `./path.json`, or `-` for stdin) |
    | `--dry-run`        |            | Preview how many records would be updated without applying changes             |
    | `--body`           |            | Request body JSON (inline, `./path.json`, or `-` for stdin)                    |
    | `--json`           | `-j`       | Output in JSON format                                                          |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Update metadata for a single vector
    pc index vector update -n my-index --id "vec1" --metadata '{"category":"updated"}'

    # Update values for a single vector
    pc index vector update -n my-index --id "vec1" --values '[0.2, 0.3, 0.4]'

    # Update sparse values
    # indices.json: [0, 5, 12]
    # values.json: [0.5, 0.3, 0.8]
    pc index vector update -n my-index --id "vec1" \
      --sparse-indices ./indices.json \
      --sparse-values ./values.json

    # Bulk update metadata by filter (preview first)
    pc index vector update -n my-index \
      --filter '{"genre":{"$eq":"sci-fi"}}' \
      --metadata '{"genre":"fantasy"}' \
      --dry-run

    # Apply the bulk update
    pc index vector update -n my-index \
      --filter '{"genre":{"$eq":"sci-fi"}}' \
      --metadata '{"genre":"fantasy"}'
    ```

    <Note>
      Use either `--id` for single vector updates or `--filter` for bulk updates. These options are mutually exclusive.
    </Note>
  </Accordion>

  <Accordion title="pc index vector upsert (Upsert vectors)">
    **Description**

    Inserts or updates vectors in an index from a JSON or JSONL file, or inline JSON. The CLI automatically batches vectors for efficient uploading. Files can contain any number of vectors—the CLI splits them into batches and sends multiple API requests as needed.

    **Usage**

    ```bash theme={null}
    pc index vector upsert [flags]
    ```

    **Flags**

    | Long flag      | Short flag | Description                                                                        |
    | :------------- | :--------- | :--------------------------------------------------------------------------------- |
    | `--index-name` | `-n`       | Index name (required)                                                              |
    | `--namespace`  |            | Namespace to upsert into (default: `__default__`)                                  |
    | `--file`       |            | Request body JSON or JSONL (inline, `./path.json[l]`, or `-` for stdin) (required) |
    | `--body`       |            | Alias for `--file`                                                                 |
    | `--batch-size` | `-b`       | Size of batches to upsert (default: 500)                                           |
    | `--json`       | `-j`       | Output in JSON format                                                              |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Upsert from JSON file (with "vectors" array)
    # vectors.json: {"vectors": [{"id": "vec1", "values": [0.1, 0.2, 0.3], "metadata": {"genre": "comedy"}}]}
    pc index vector upsert -n my-index --file ./vectors.json

    # Upsert with inline JSON
    pc index vector upsert -n my-index --file '{"vectors": [{"id": "vec1", "values": [0.1, 0.2, 0.3], "metadata": {"genre": "comedy"}}]}'

    # Upsert from JSONL file (one vector per line)
    # vectors.jsonl: {"id": "vec1", "values": [0.1, 0.2, 0.3]}
    #                {"id": "vec2", "values": [0.4, 0.5, 0.6]}
    pc index vector upsert -n my-index --file ./vectors.jsonl

    # Upsert from stdin (same format as JSON or JSONL file)
    cat vectors.json | pc index vector upsert -n my-index --file -

    # Custom batch size (default: 500, max: 1000 per API request)
    pc index vector upsert -n my-index --file ./vectors.json --batch-size 1000
    ```

    <Note>
      **Batch size limits:** The API accepts up to 1000 vectors per request. The CLI defaults to batches of 500 vectors, but you can adjust this with `--batch-size` (up to 1000). Large files are automatically split into multiple batches.

      **File size:** There's no explicit file size limit—the CLI reads the entire file into memory and batches it automatically. Very large files are supported as long as they fit in available system memory.
    </Note>
  </Accordion>
</AccordionGroup>

### Backups

<AccordionGroup>
  <Accordion title="pc backup create (Create a backup)">
    **Description**

    Creates a backup of a serverless index. Backups are static copies that only consume storage.

    **Usage**

    ```bash theme={null}
    pc backup create [flags]
    ```

    **Flags**

    | Long flag       | Short flag | Description                                                          |
    | :-------------- | :--------- | :------------------------------------------------------------------- |
    | `--index-name`  | `-i`       | Name of the index to back up (required)                              |
    | `--name`        | `-n`       | Human-readable label for the backup (the backup ID is always a UUID) |
    | `--description` | `-d`       | Description for the backup                                           |
    | `--json`        | `-j`       | Output in JSON format                                                |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Create a backup
    pc backup create -i my-index

    # Create with name and description
    pc backup create -i my-index -n "nightly-backup" -d "Nightly backup before deployment"

    # JSON output
    pc backup create -i my-index -j
    ```
  </Accordion>

  <Accordion title="pc backup delete (Delete a backup)">
    **Description**

    Permanently deletes a backup. This operation cannot be undone.

    **Usage**

    ```bash theme={null}
    pc backup delete [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                    |
    | :-------- | :--------- | :----------------------------- |
    | `--id`    | `-i`       | Backup ID to delete (required) |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete a backup by ID
    pc backup delete -i c84725e5-5956-41ba-ab62-21ac7b5f2a2f
    ```

    <Warning>
      Backup deletion is permanent and cannot be undone.
    </Warning>
  </Accordion>

  <Accordion title="pc backup describe (Show backup details)">
    **Description**

    Displays detailed information about a specific backup.

    **Usage**

    ```bash theme={null}
    pc backup describe [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                      |
    | :-------- | :--------- | :------------------------------- |
    | `--id`    | `-i`       | Backup ID to describe (required) |
    | `--json`  | `-j`       | Output in JSON format            |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe a backup
    pc backup describe -i c84725e5-5956-41ba-ab62-21ac7b5f2a2f

    # JSON output
    pc backup describe -i c84725e5-5956-41ba-ab62-21ac7b5f2a2f -j
    ```
  </Accordion>

  <Accordion title="pc backup list (List backups)">
    **Description**

    Lists backups in the current project, optionally filtered by index name.

    **Usage**

    ```bash theme={null}
    pc backup list [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                    |
    | :------------------- | :--------- | :----------------------------- |
    | `--index-name`       | `-i`       | Filter backups by index name   |
    | `--limit`            | `-l`       | Maximum number of results      |
    | `--pagination-token` | `-p`       | Pagination token for next page |
    | `--json`             | `-j`       | Output in JSON format          |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List all backups in the project
    pc backup list

    # List backups for a specific index
    pc backup list --index-name my-index

    # Limit results
    pc backup list --limit 10

    # JSON output
    pc backup list -j
    ```
  </Accordion>

  <Accordion title="pc backup restore (Restore an index from a backup)">
    **Description**

    Creates a new index from a backup.

    **Usage**

    ```bash theme={null}
    pc backup restore [flags]
    ```

    **Flags**

    | Long flag               | Short flag | Description                                          |
    | :---------------------- | :--------- | :--------------------------------------------------- |
    | `--id`                  | `-i`       | Backup ID (UUID) to restore from (required)          |
    | `--name`                | `-n`       | Name for the new index (required)                    |
    | `--deletion-protection` | `-d`       | Enable deletion protection - `enabled` or `disabled` |
    | `--tags`                | `-t`       | Tags to apply to the new index (key=value pairs)     |
    | `--json`                | `-j`       | Output in JSON format                                |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Restore an index from a backup
    pc backup restore -i c84725e5-5956-41ba-ab62-21ac7b5f2a2f -n restored-index

    # Restore with tags and deletion protection
    pc backup restore -i c84725e5-5956-41ba-ab62-21ac7b5f2a2f -n restored-index \
      --tags env=prod,team=search \
      --deletion-protection enabled

    # JSON output
    pc backup restore -i c84725e5-5956-41ba-ab62-21ac7b5f2a2f -n restored-index -j
    ```
  </Accordion>

  <Accordion title="pc backup restore describe (Show restore job details)">
    **Description**

    Displays the status and details of a restore job.

    **Usage**

    ```bash theme={null}
    pc backup restore describe [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                           |
    | :-------- | :--------- | :------------------------------------ |
    | `--id`    | `-i`       | Restore job ID to describe (required) |
    | `--json`  | `-j`       | Output in JSON format                 |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe a restore job
    pc backup restore describe -i rj-abc123

    # JSON output
    pc backup restore describe -i rj-abc123 -j
    ```
  </Accordion>

  <Accordion title="pc backup restore list (List restore jobs)">
    **Description**

    Lists all restore jobs in the current project.

    **Usage**

    ```bash theme={null}
    pc backup restore list [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                    |
    | :------------------- | :--------- | :----------------------------- |
    | `--limit`            | `-l`       | Maximum number of results      |
    | `--pagination-token` | `-p`       | Pagination token for next page |
    | `--json`             | `-j`       | Output in JSON format          |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List restore jobs
    pc backup restore list

    # Limit results
    pc backup restore list --limit 10

    # JSON output
    pc backup restore list -j
    ```
  </Accordion>
</AccordionGroup>

### Projects

<AccordionGroup>
  <Accordion title="pc project create (Create a new project)">
    **Description**

    Creates a new project in your [target organization](/reference/cli/target-context), using the specified configuration.

    **Usage**

    ```bash theme={null}
    pc project create [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                                                    |
    | :------------------- | :--------- | :------------------------------------------------------------- |
    | `--force-encryption` |            | Enable encryption with CMEK                                    |
    | `--json`             | `-j`       | Output in JSON format                                          |
    | `--name`             | `-n`       | Project name (required)                                        |
    | `--target`           |            | Automatically target the project in the CLI after it's created |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Basic project creation
    pc project create -n "demo-project"
    ```
  </Accordion>

  <Accordion title="pc project delete (Delete a project)">
    **Description**

    Permanently deletes a project and all its resources. This operation cannot be undone.

    **Usage**

    ```bash theme={null}
    pc project delete [flags]
    ```

    **Flags**

    | Long flag             | Short flag | Description                                                 |
    | :-------------------- | :--------- | :---------------------------------------------------------- |
    | `--id`                | `-i`       | Project ID (optional, uses target project if not specified) |
    | `--json`              | `-j`       | Output in JSON format                                       |
    | `--skip-confirmation` |            | Skip confirmation prompt                                    |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete target project
    pc project delete

    # Delete specific project
    pc project delete -i proj-abc123

    # Skip confirmation
    pc project delete -i proj-abc123 --skip-confirmation
    ```

    <Note>
      Must delete all indexes and collections in the project first. If the deleted project is your current target, set a new target after deleting it.
    </Note>
  </Accordion>

  <Accordion title="pc project describe (Show project details)">
    **Description**

    Displays detailed information about a specific project, including various details.

    **Usage**

    ```bash theme={null}
    pc project describe [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--id`    | `-i`       | Project ID (required) |
    | `--json`  | `-j`       | Output in JSON format |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe a project
    pc project describe -i proj-abc123

    # JSON output
    pc project describe -i proj-abc123 --json

    # Find ID and describe
    pc project list
    pc project describe -i proj-abc123
    ```
  </Accordion>

  <Accordion title="pc project list (List all projects)">
    **Description**

    Displays all projects in your [target organization](/reference/cli/target-context), including various details.

    **Usage**

    ```bash theme={null}
    pc project list [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--json`  | `-j`       | Output in JSON format |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List all projects
    pc project list

    # JSON output
    pc project list --json

    # List after login
    pc auth login
    pc auth target -o "my-org"
    pc project list
    ```
  </Accordion>

  <Accordion title="pc project update (Update project settings)">
    **Description**

    Modifies the configuration of the [target project](/reference/cli/target-context), or a specific project ID.

    **Usage**

    ```bash theme={null}
    pc project update [flags]
    ```

    **Flags**

    | Long flag            | Short flag | Description                         |
    | :------------------- | :--------- | :---------------------------------- |
    | `--force-encryption` | `-f`       | Enable/disable encryption with CMEK |
    | `--id`               | `-i`       | Project ID (required)               |
    | `--json`             | `-j`       | Output in JSON format               |
    | `--name`             | `-n`       | New project name                    |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Update name
    pc project update -i proj-abc123 -n "new-name"
    ```
  </Accordion>
</AccordionGroup>

### Organizations

<AccordionGroup>
  <Accordion title="pc organization delete (Delete an organization)">
    **Description**

    Permanently deletes an organization and all its resources. This operation cannot be undone.

    **Usage**

    ```bash theme={null}
    pc organization delete [flags]
    ```

    **Flags**

    | Long flag             | Short flag | Description                |
    | :-------------------- | :--------- | :------------------------- |
    | `--id`                | `-i`       | Organization ID (required) |
    | `--json`              | `-j`       | Output in JSON format      |
    | `--skip-confirmation` |            | Skip confirmation prompt   |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete an organization
    pc organization delete -i org-abc123

    # Skip confirmation
    pc organization delete -i org-abc123 --skip-confirmation
    ```

    <Note>
      This is a highly destructive action. Deletion is permanent. If the deleted organization is your current [target](/reference/cli/target-context), set a new target after deleting.
    </Note>
  </Accordion>

  <Accordion title="pc organization describe (Show organization details)">
    **Description**

    Displays detailed information about a specific organization, including name, ID, creation date, payment status, plan, and support tier.

    **Usage**

    ```bash theme={null}
    pc organization describe [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                |
    | :-------- | :--------- | :------------------------- |
    | `--id`    | `-i`       | Organization ID (required) |
    | `--json`  | `-j`       | Output in JSON format      |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe an organization
    pc organization describe -i org-abc123

    # JSON output
    pc organization describe -i org-abc123 --json

    # Find ID and describe
    pc organization list
    pc organization describe -i org-abc123
    ```
  </Accordion>

  <Accordion title="pc organization list (List organizations)">
    **Description**

    Displays all organizations that the authenticated user has access to, including name, ID, creation date, payment status, plan, and support tier.

    **Usage**

    ```bash theme={null}
    pc organization list [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--json`  | `-j`       | Output in JSON format |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List all organizations
    pc organization list

    # JSON output
    pc organization list --json

    # List after login
    pc auth login
    pc organization list
    ```
  </Accordion>

  <Accordion title="pc organization update (Update organization settings)">
    **Description**

    Modifies the configuration of the [target organization](/reference/cli/target-context), or a specific organization ID.

    **Usage**

    ```bash theme={null}
    pc organization update [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                |
    | :-------- | :--------- | :------------------------- |
    | `--id`    | `-i`       | Organization ID (required) |
    | `--json`  | `-j`       | Output in JSON format      |
    | `--name`  | `-n`       | New organization name      |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Update name
    pc organization update -i org-abc123 -n "new-name"

    # Verify changes
    pc organization update -i org-abc123 -n "Acme Corp"
    pc organization describe -i org-abc123
    ```
  </Accordion>
</AccordionGroup>

### API keys

<AccordionGroup>
  <Accordion title="pc api-key create (Create a new API key)">
    **Description**

    Creates a new API key for the current [target project](/reference/cli/target-context) or a specific project ID. Optionally stores the key locally for CLI use.

    **Usage**

    ```bash theme={null}
    pc api-key create [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                                                                             |
    | :-------- | :--------- | :-------------------------------------------------------------------------------------- |
    | `--id`    | `-i`       | Project ID (optional, uses target project if not specified)                             |
    | `--json`  | `-j`       | Output in JSON format                                                                   |
    | `--name`  | `-n`       | Key name (required)                                                                     |
    | `--roles` |            | Roles to assign (default: `ProjectEditor`)                                              |
    | `--store` |            | Store the key locally for CLI use (automatically replaces any existing CLI-managed key) |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Basic key creation
    pc api-key create -n "my-key"

    # Create and store locally
    pc api-key create -n "my-key" --store

    # Create with specific role
    pc api-key create -n "my-key" --store --roles ProjectEditor

    # Create for specific project
    pc api-key create -n "my-key" -i proj-abc123
    ```

    <Note>
      API keys are scoped to a specific organization and project.
    </Note>
  </Accordion>

  <Accordion title="pc api-key delete (Delete an API key)">
    **Description**

    Permanently deletes an API key. Applications using this key immediately lose access.

    **Usage**

    ```bash theme={null}
    pc api-key delete [flags]
    ```

    **Flags**

    | Long flag             | Short flag | Description              |
    | :-------------------- | :--------- | :----------------------- |
    | `--id`                | `-i`       | API key ID (required)    |
    | `--skip-confirmation` |            | Skip confirmation prompt |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Delete an API key
    pc api-key delete -i key-abc123

    # Skip confirmation
    pc api-key delete -i key-abc123 --skip-confirmation

    # Delete and clean up local storage
    pc api-key delete -i key-abc123
    pc auth local-keys prune --skip-confirmation
    ```

    <Note>
      Deletion is permanent. Applications using this key immediately lose access to Pinecone.
    </Note>
  </Accordion>

  <Accordion title="pc api-key describe (Show API key details)">
    **Description**

    Displays detailed information about a specific API key, including its name, ID, project ID, and roles.

    **Usage**

    ```bash theme={null}
    pc api-key describe [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--id`    | `-i`       | API key ID (required) |
    | `--json`  | `-j`       | Output in JSON format |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Describe an API key
    pc api-key describe -i key-abc123

    # JSON output
    pc api-key describe -i key-abc123 --json

    # Find ID and describe
    pc api-key list
    pc api-key describe -i key-abc123
    ```

    <Note>
      Does not display the actual key value.
    </Note>
  </Accordion>

  <Accordion title="pc api-key list (List all API keys)">
    **Description**

    Displays a list of all of the [target project's](/reference/cli/target-context) API keys, as found in  Pinecone (regardless of whether they are stored locally by the CLI). Displays various details about each key, including name, ID, project ID, and roles.

    **Usage**

    ```bash theme={null}
    pc api-key list [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description                                                 |
    | :-------- | :--------- | :---------------------------------------------------------- |
    | `--id`    | `-i`       | Project ID (optional, uses target project if not specified) |
    | `--json`  | `-j`       | Output in JSON format                                       |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # List keys for target project
    pc api-key list

    # List for specific project
    pc api-key list -i proj-abc123

    # JSON output
    pc api-key list --json
    ```

    <Note>
      Does not display key values.
    </Note>
  </Accordion>

  <Accordion title="pc api-key update (Update API key settings)">
    **Description**

    Updates the name and roles of an API key.

    **Usage**

    ```bash theme={null}
    pc api-key update [flags]
    ```

    **Flags**

    | Long flag | Short flag | Description           |
    | :-------- | :--------- | :-------------------- |
    | `--id`    | `-i`       | API key ID (required) |
    | `--json`  | `-j`       | Output in JSON format |
    | `--name`  | `-n`       | New key name          |
    | `--roles` | `-r`       | Roles to assign       |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Update name
    pc api-key update -i key-abc123 -n "new-name"

    # Update roles
    pc api-key update -i key-abc123 -r ProjectEditor

    # Verify changes
    pc api-key update -i key-abc123 -n "production-key"
    pc api-key describe -i key-abc123
    ```

    <Note>
      Cannot change the actual key. If you need a different key, create a new one.
    </Note>
  </Accordion>
</AccordionGroup>

### Config

<AccordionGroup>
  <Accordion title="pc config get-api-key (Show configured API key)">
    **Description**

    Displays the currently configured default (manually specified) API key, if set. By default, the full value of the key is not displayed.

    **Usage**

    ```bash theme={null}
    pc config get-api-key
    ```

    **Flags**

    | Long flag  | Short flag | Description                               |
    | :--------- | :--------- | :---------------------------------------- |
    | `--reveal` |            | Show the actual API key value (sensitive) |

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Get current API key
    pc config get-api-key

    # Verify after setting
    pc config set-api-key pcsk_abc123
    pc config get-api-key
    ```
  </Accordion>

  <Accordion title="pc config set-api-key (Set default API key)">
    **Description**

    Sets a default API key for the CLI to use for authentication. Provides direct access to control plane and data plane operations, but not Admin API operations.

    **Usage**

    ```bash theme={null}
    pc config set-api-key "YOUR_API_KEY"
    ```

    **Flags**

    None (takes API key as argument)

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Set default API key
    pc config set-api-key pcsk_abc123

    # Use immediately without targeting
    pc config set-api-key pcsk_abc123
    pc index list

    # Verify it's set
    pc auth status
    ```

    <Note>
      `pc config set-api-key "YOUR_API_KEY"` does the same thing as `pc auth configure --api-key "YOUR_API_KEY"`. For control plane and data plane operations, a default API key implicitly overrides any previously set [target context](/reference/cli/target-context), because Pinecone API keys are scoped to a specific organization and project.
    </Note>
  </Accordion>

  <Accordion title="pc config set-color (Enable/disable colored output)">
    **Description**

    Enables or disables colored output in CLI responses. Useful for terminal compatibility or log file generation.

    **Usage**

    ```bash theme={null}
    pc config set-color true
    pc config set-color false
    ```

    **Flags**

    None (takes boolean as argument)

    **Global Flags**

    | Long flag   | Short flag | Description                         |
    | :---------- | :--------- | :---------------------------------- |
    | `--help`    | `-h`       | Show help information               |
    | `--quiet`   | `-q`       | Suppress output                     |
    | `--timeout` |            | Timeout (default 60s, 0 to disable) |

    **Example**

    ```bash theme={null}
    # Enable colored output
    pc config set-color true

    # Disable colored output for CI/CD
    pc config set-color false

    # Test the change
    pc config set-color false
    pc index list
    ```
  </Accordion>
</AccordionGroup>
