[go: up one dir, main page]

Skip to main content
This feature is in public preview.
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.
pc <command> <subcommand> [flags]
pc <command> <subcommand> <subcommand> [flags]
For example:
# 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:
# 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

DescriptionAuthenticate via a web browser. After login, set a target org and project 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
pc login
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Log in via browser
pc login

# Then set target context
pc target -o "my-org" -p "my-project"
This is an alias for pc auth login. Both commands perform the same operation.
DescriptionClears 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
pc logout
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Clear all credentials and context
pc logout
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.
DescriptionSet 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.Usage
pc target [flags]
Flags
Long flagShort flagDescription
--clearClear target context
--jsonOutput in JSON format
--org-oOrganization name
--organization-idOrganization ID
--project-pProject name
--project-idProject ID
--show-sDisplay current target context
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
DescriptionDisplays version information for the CLI, including the version number, commit SHA, and build date.Usage
pc version
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Display version information
pc version
DescriptionDisplays information about the currently authenticated user. To use this command, you must be authenticated via user login.Usage
pc whoami
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
pc whoami
This is an alias for pc auth whoami. Both commands perform the same operation.

Authentication

DescriptionSelectively clears specific authentication data without affecting other credentials. At least one flag is required.Usage
pc auth clear [flags]
Flags
Long flagShort flagDescription
--api-keyClear only the default (manually specified) API key
--service-accountClear only service account credentials
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Clear only the default (manually specified) API key
pc auth clear --api-key
pc auth status

# Clear service account
pc auth clear --service-account
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.
DescriptionConfigures 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.Usage
pc auth configure [flags]
Flags
Long flagShort flagDescription
--api-keyDefault API key to use for authentication
--client-idService account client ID
--client-secretService account client secret
--client-secret-stdinRead client secret from stdin
--jsonOutput in JSON format
--project-id-pTarget project ID (optional, interactive if omitted)
--prompt-if-missingPrompt for missing credentials
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
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.
DescriptionDisplays all managed API keys stored locally by the CLI, with various details.Usage
pc auth local-keys list [flags]
Flags
Long flagShort flagDescription
--jsonOutput in JSON format
--revealShow the actual API key values (sensitive)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
DescriptionDeletes locally stored managed API keys from local storage and Pinecone’s servers. Filters by origin (cli/user/all) or project ID.Usage
pc auth local-keys prune [flags]
Flags
Long flagShort flagDescription
--dry-runPreview deletions without applying
--idPrune keys for specific project ID only
--jsonOutput in JSON format
--origin-oFilter by origin - cli, user, or all (default: all)
--skip-confirmationSkip confirmation prompt
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
This deletes keys from both local storage and Pinecone servers. Use --dry-run to preview before committing.
DescriptionAuthenticate via user login in the web browser. After login, set a target org and project.Usage
pc auth login
pc login  # shorthand
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Login and set target
pc auth login
pc target -o "my-org" -p "my-project"
pc index list
Tokens expire after 30 minutes, but they refresh automatically for up to 24 hours. After that point, you must re-authenticate. Logging in clears any existing service account credentials. This command does the same thing as pc login.
DescriptionClears 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
pc auth logout
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Clear all credentials and context
pc auth logout
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.
DescriptionShows details about all configured authentication methods.Usage
pc auth status [flags]
Flags
Long flagShort flagDescription
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Check status after login
pc auth login
pc auth status

# JSON output for scripting
pc auth status --json
DescriptionDisplays information about the currently authenticated user. To use this command, you must be authenticated via user login.Usage
pc auth whoami
FlagsNoneGlobal Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
pc auth whoami
This command does the same thing as pc whoami.

Indexes

DescriptionModifies the configuration of an existing index.Usage
pc index configure [flags]
Flags
Long flagShort flagDescription
--deletion_protection-pEnable or disable deletion protection -enabled or disabled
--jsonOutput in JSON format
--name-nIndex name (required)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Enable deletion protection
pc index configure -n my-index -p enabled

# Verify changes
pc index describe -n my-index
Configuration changes may take some time to take effect.
DescriptionCreates a new serverless index in your Pinecone project, with various configuration optons.Usage
pc index create [flags]
Flags
Long flagShort flagDescription
--cloud-cCloud provider - aws, gcp, or azure (required for serverless)
--deletion_protectionDeletion protection - enabled or disabled
--dimension-dVector dimension (required for standard indexes, optional for integrated)
--field_mapField mapping for integrated embedding (JSON map)
--jsonOutput in JSON format
--metric-mSimilarity metric - cosine, euclidean, or dotproduct (required)
--modelIntegrated embedding model name
--name-nIndex name (required)
--read_parametersRead parameters for embedding model (JSON map)
--region-rCloud region
--source_collectionName of the source collection from which to create the index
--tagsCustom user tags (key=value pairs)
--vector_type-vVector type - dense or sparse (serverless only)
--write_parametersWrite parameters for embedding model (JSON map)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Create serverless index
pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1

# With integrated embedding model
pc index create -n my-index -m cosine -c aws -r us-east-1 --model multilingual-e5-large

# 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
For a list of valid regions for a serverless index, see Create a serverless index.
DescriptionPermanently deletes an index and all its data. This operation cannot be undone.Usage
pc index delete [flags]
Flags
Long flagShort flagDescription
--name-nIndex name (required)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
DescriptionDisplays detailed configuration and status information for a specific index.Usage
pc index describe [flags]
Flags
Long flagShort flagDescription
--jsonOutput in JSON format
--name-nIndex name (required)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Describe an index
pc index describe -n my-index

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

# 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
DescriptionDisplays all indexes in your current target project, including various details.Usage
pc index list [flags]
Flags
Long flagShort flagDescription
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# List all indexes
pc index list

# JSON output for scripting
pc index list --json

# After creating indexes
pc index create -n test-1 -d 768 -m cosine -c aws -r us-east-1
pc index list

Projects

DescriptionCreates a new project in your target organization, using the specified configuration.Usage
pc project create [flags]
Flags
Long flagShort flagDescription
--force-encryptionEnable encryption with CMEK
--jsonOutput in JSON format
--name-nProject name (required)
--targetAutomatically target the project in the CLI after it’s created
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Basic project creation
pc project create -n "demo-project"
DescriptionPermanently deletes a project and all its resources. This operation cannot be undone.Usage
pc project delete [flags]
Flags
Long flagShort flagDescription
--id-iProject ID (optional, uses target project if not specified)
--jsonOutput in JSON format
--skip-confirmationSkip confirmation prompt
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
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.
DescriptionDisplays detailed information about a specific project, including various details.Usage
pc project describe [flags]
Flags
Long flagShort flagDescription
--id-iProject ID (required)
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
DescriptionDisplays all projects in your target organization, including various details.Usage
pc project list [flags]
Flags
Long flagShort flagDescription
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
DescriptionModifies the configuration of the target project, or a specific project ID.Usage
pc project update [flags]
Flags
Long flagShort flagDescription
--force-encryption-fEnable/disable encryption with CMEK
--id-iProject ID (required)
--jsonOutput in JSON format
--name-nNew project name
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Update name
pc project update -i proj-abc123 -n "new-name"

Organizations

DescriptionPermanently deletes an organization and all its resources. This operation cannot be undone.Usage
pc organization delete [flags]
Flags
Long flagShort flagDescription
--id-iOrganization ID (required)
--jsonOutput in JSON format
--skip-confirmationSkip confirmation prompt
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Delete an organization
pc organization delete -i org-abc123

# Skip confirmation
pc organization delete -i org-abc123 --skip-confirmation
This is a highly destructive action. Deletion is permanent. If the deleted organization is your current target, set a new target after deleting.
DescriptionDisplays detailed information about a specific organization, including name, ID, creation date, payment status, plan, and support tier.Usage
pc organization describe [flags]
Flags
Long flagShort flagDescription
--id-iOrganization ID (required)
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
DescriptionDisplays all organizations that the authenticated user has access to, including name, ID, creation date, payment status, plan, and support tier.Usage
pc organization list [flags]
Flags
Long flagShort flagDescription
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# List all organizations
pc organization list

# JSON output
pc organization list --json

# List after login
pc auth login
pc organization list
DescriptionModifies the configuration of the target organization, or a specific organization ID.Usage
pc organization update [flags]
Flags
Long flagShort flagDescription
--id-iOrganization ID (required)
--jsonOutput in JSON format
--name-nNew organization name
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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

API keys

DescriptionCreates a new API key for the current target project or a specific project ID. Optionally stores the key locally for CLI use.Usage
pc api-key create [flags]
Flags
Long flagShort flagDescription
--id-iProject ID (optional, uses target project if not specified)
--jsonOutput in JSON format
--name-nKey name (required)
--rolesRoles to assign (default: ProjectEditor)
--storeStore the key locally for CLI use (automatically replaces any existing CLI-managed key)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
API keys are scoped to a specific organization and project.
DescriptionPermanently deletes an API key. Applications using this key immediately lose access.Usage
pc api-key delete [flags]
Flags
Long flagShort flagDescription
--id-iAPI key ID (required)
--skip-confirmationSkip confirmation prompt
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
Deletion is permanent. Applications using this key immediately lose access to Pinecone.
DescriptionDisplays detailed information about a specific API key, including its name, ID, project ID, and roles.Usage
pc api-key describe [flags]
Flags
Long flagShort flagDescription
--id-iAPI key ID (required)
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
Does not display the actual key value.
DescriptionDisplays a list of all of the target project’s 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
pc api-key list [flags]
Flags
Long flagShort flagDescription
--id-iProject ID (optional, uses target project if not specified)
--jsonOutput in JSON format
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
Does not display key values.
DescriptionUpdates the name and roles of an API key.Usage
pc api-key update [flags]
Flags
Long flagShort flagDescription
--id-iAPI key ID (required)
--json-jOutput in JSON format
--name-nNew key name
--roles-rRoles to assign
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
Cannot change the actual key. If you need a different key, create a new one.

Config

DescriptionDisplays the currently configured default (manually specified) API key, if set. By default, the full value of the key is not displayed.Usage
pc config get-api-key
Flags
Long flagShort flagDescription
--revealShow the actual API key value (sensitive)
Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# Get current API key
pc config get-api-key

# Verify after setting
pc config set-api-key pcsk_abc123
pc config get-api-key
DescriptionSets a default API key for the CLI to use for authentication. Provides direct access to control plane operations, but not Admin API operations.Usage
pc config set-api-key "YOUR_API_KEY"
FlagsNone (takes API key as argument)Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
pc config set-api-key "YOUR_API_KEY" does the same thing as pc auth configure --api-key "YOUR_API_KEY". For control plane operations, a default API key implicitly overrides any previously set target context, because Pinecone API keys are scoped to a specific organization and project.
DescriptionEnables or disables colored output in CLI responses. Useful for terminal compatibility or log file generation.Usage
pc config set-color true
pc config set-color false
FlagsNone (takes boolean as argument)Global Flags
Long flagShort flagDescription
--help-hShow help information
--quiet-qSuppress output
Example
# 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
I