Loading...
Loading...
Guide for using the Pinecone CLI (pc) to manage Pinecone resources from the terminal. The CLI supports ALL index types (standard, integrated, sparse) and all vector operations — unlike the MCP which only supports integrated indexes. Use for batch operations, vector management, backups, namespaces, CI/CD automation, and full control over Pinecone resources.
npx skill4agent add pinecone-io/skills pinecone-clipc| CLI | MCP | |
|---|---|---|
| Index types | All (standard, integrated, sparse) | Integrated only |
| Vector ops (upsert, query, fetch, update, delete) | ✅ | ❌ |
| Text search on integrated indexes | ✅ | ✅ |
| Backups, namespaces, org/project mgmt | ✅ | ❌ |
| CI/CD / scripting | ✅ | ❌ |
brew tap pinecone-io/tap
brew install pinecone-io/tap/pinecone# Interactive (recommended for local dev)
pc login
pc target -o "my-org" -p "my-project"
# Service account (recommended for CI/CD)
pc auth configure --client-id "$PINECONE_CLIENT_ID" --client-secret "$PINECONE_CLIENT_SECRET"
# API key (quick testing)
pc config set-api-key $PINECONE_API_KEYpc auth statuspc target --showNote for agent sessions: If you need to runinside an agent loop, the browser auth link may not surface correctly. It's best to authenticate before starting an agent session. Runpc loginin your terminal directly, then invoke the agent once you're authenticated.pc login
PINECONE_API_KEYpc loginPINECONE_API_KEYPINECONE_API_KEYKEY=$(pc api-key create --name agent-sdk-key --json | jq -r '.value')
export PINECONE_API_KEY="$KEY"jqpc api-key create --name agent-sdk-key --json"value"| Task | Command |
|---|---|
| List indexes | |
| Create serverless index | |
| Index stats | |
| Upload vectors from file | |
| Query by vector | |
| Query by vector ID | |
| Fetch vectors by ID | |
| List vector IDs | |
| Delete vectors by filter | |
| List namespaces | |
| Create backup | |
| JSON output (for scripting) | Add |
pc index vector query -n my-index \
--vector '[0.1, 0.2, ..., 0.9]' \
--filter '{"source":{"$eq":"docs"}}' \
-k 20 --include-metadatajq -c '.embedding' doc.json | pc index vector query -n my-index --vector - -k 10# Preview first
pc index vector update -n my-index \
--filter '{"env":{"$eq":"staging"}}' \
--metadata '{"env":"production"}' \
--dry-run
# Apply
pc index vector update -n my-index \
--filter '{"env":{"$eq":"staging"}}' \
--metadata '{"env":"production"}'# Snapshot before a migration
pc backup create -i my-index -n "pre-migration"
# Restore to a new index if something goes wrong
pc backup restore -i <backup-uuid> -n my-index-restoredexport PINECONE_CLIENT_ID="..."
export PINECONE_CLIENT_SECRET="..."
pc auth configure --client-id "$PINECONE_CLIENT_ID" --client-secret "$PINECONE_CLIENT_SECRET"
pc index vector upsert -n my-index --file ./vectors.jsonl --batch-size 1000# Get all index names as a list
pc index list -j | jq -r '.[] | .name'
# Check if an index exists before creating
if ! pc index describe -n my-index -j 2>/dev/null | jq -e '.name' > /dev/null; then
pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1
fi