Pinecone CLI
PineconeOfficialPublished by Pinecone
- Skill
- Tool integration
- Cloud and DevOps
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Pinecone CLI (pc) provides a comprehensive command-line interface for interacting with Pinecone resources. Unlike other integration methods, the CLI supports all index types—including standard, integrated, and sparse—and enables full control over vector operations, backups, namespaces, and project management. It is designed for developers who require batch processing, CI/CD automation, and direct terminal-based management of their vector database infrastructure.
What it does
- Create, list, describe, and configure Pinecone indexes.
- Perform vector operations including upsert, query, fetch, update, and delete.
- Manage namespaces and perform index backups and restores.
- Support batch processing of vector data from JSON and JSONL files.
- Enable CI/CD automation via service account authentication.
- Output data in JSON format for integration with shell scripting tools like jq.
When to use it
- When you need to manage indexes or vector data outside of an application's runtime.
- When performing bulk data operations or migrations.
- When automating database tasks within CI/CD pipelines.
- When working with index types or operations not supported by other integration tools.
- When you need to perform destructive operations with a dry-run preview.
Advantages
- Full feature parity with Pinecone's API capabilities.
- Supports all index types including sparse and standard indexes.
- Enables scriptable workflows using JSON output.
- Provides robust tools for production safety, such as deletion protection and dry-run updates.
- Optimized for both interactive development and automated environments.
Usage examples
- “Create a new serverless index named my-index with 1536 dimensions.”
- The CLI executes the index creation command, setting up the index with specified parameters like cosine metric and cloud provider.
- “Upsert vectors from a local JSON file into my-index.”
- The CLI reads the vectors from the specified file and performs a batch upsert operation into the target index.
- “Query my-index using a specific vector and filter results by metadata.”
- The CLI returns the top-k matches based on the provided vector values and metadata filter criteria.
- “List all index names in JSON format for a script.”
- The CLI outputs the list of indexes as a JSON array, which can be piped into jq to extract specific fields.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/pinecone-io/pinecone-cli/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip pinecone-cli.zip -d .agents/skills
Documentation by Pinecone
Pinecone CLI (pc)
Manage Pinecone from the terminal. The CLI is especially valuable for vector operations across all index types — something the MCP currently can't do.
CLI vs MCP
| 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 | ✅ | ❌ |
Setup
Install (macOS)
brew tap pinecone-io/tap
brew install pinecone-io/tap/pineconeOther platforms (Linux, Windows) — download from GitHub Releases.
Authenticate
# 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_KEYCheck status: pc auth status · pc target --show
Note for agent sessions: If you need to run
pc logininside 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.
Authenticating the CLI does not set PINECONE_API_KEY
pc login authenticates the CLI tool itself — it does not set PINECONE_API_KEY in your environment. Python scripts, Node.js SDKs, and other tools that use the Pinecone SDK need PINECONE_API_KEY set separately.
Use the CLI to create a key and export it in one step:
KEY=$(pc api-key create --name agent-sdk-key --json | jq -r '.value')
export PINECONE_API_KEY="$KEY"Without jq: run pc api-key create --name agent-sdk-key --json and copy the "value" field manually.
Common Commands
| Task | Command |
|---|---|
| List indexes | pc index list |
| Create serverless index | pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 |
| Index stats | pc index stats -n my-index |
| Upload vectors from file | pc index vector upsert -n my-index --file ./vectors.json |
| Query by vector | pc index vector query -n my-index --vector '[0.1, ...]' -k 10 --include-metadata |
| Query by vector ID | pc index vector query -n my-index --id "doc-123" -k 10 |
| Fetch vectors by ID | pc index vector fetch -n my-index --ids '["vec1","vec2"]' |
| List vector IDs | pc index vector list -n my-index |
| Delete vectors by filter | pc index vector delete -n my-index --filter '{"genre":"classical"}' |
| List namespaces | pc index namespace list -n my-index |
| Create backup | pc backup create -i my-index -n "my-backup" |
| JSON output (for scripting) | Add -j to any command |
Interesting Things You Can Do
Query with custom vectors (not just text)
Unlike the MCP, the CLI lets you query any index with raw vector values — useful when you generate embeddings externally (OpenAI, HuggingFace, etc.):
pc index vector query -n my-index \
--vector '[0.1, 0.2, ..., 0.9]' \
--filter '{"source":{"$eq":"docs"}}' \
-k 20 --include-metadataPipe embeddings directly into queries
jq -c '.embedding' doc.json | pc index vector query -n my-index --vector - -k 10Bulk metadata update with preview
# 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"}'Backup and restore
# 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-restoredAutomate in CI/CD
export 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 1000Script against JSON output
# 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
fiReference Files
Full command reference — all commands with flags and examples
Documentation
Files
- ATTRIBUTION.mdAdded by AutoGineer853 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md5.5 KiB
- references/command-reference.md6.0 KiB
- references/troubleshooting.md2.8 KiB
references/command-reference.md
Pinecone CLI — Full Command Reference
Index Management
Create Index
# 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 \
--field-map text=chunk_text
# Sparse vector index
pc index create -n sparse-index -m dotproduct -c aws -r us-east-1 --vector-type sparse
# With deletion protection
pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 --deletion-protection enabled
# From collection
pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1 --source-collection my-collectionList / Describe / Stats
pc index list # Summary view
pc index list --wide # Additional columns (host, embed, tags)
pc index list -j # JSON output
pc index describe -n my-index
pc index describe -n my-index -j
pc index stats -n my-index
pc index stats -n my-index --filter '{"genre":{"$eq":"rock"}}'Configure / Delete
# Enable deletion protection
pc index configure -n my-index --deletion-protection 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
pc index delete -n my-indexVector Operations
Upsert
# From JSON file (with "vectors" array)
pc index vector upsert -n my-index --file ./vectors.json
# From JSONL file (one vector per line)
pc index vector upsert -n my-index --file ./vectors.jsonl
# Inline JSON
pc index vector upsert -n my-index --file '{"vectors": [{"id": "vec1", "values": [0.1, 0.2, 0.3]}]}'
# From stdin
cat vectors.json | pc index vector upsert -n my-index --file -
# With namespace, custom batch size
pc index vector upsert -n my-index --namespace tenant-a --file ./vectors.json --batch-size 1000File formats:
// JSON (vectors.json)
{"vectors": [{"id": "vec1", "values": [0.1, 0.2, 0.3], "metadata": {"genre": "comedy"}}]}
// JSONL (vectors.jsonl)
{"id": "vec1", "values": [0.1, 0.2, 0.3], "metadata": {"genre": "comedy"}}
{"id": "vec2", "values": [0.4, 0.5, 0.6], "metadata": {"genre": "drama"}}Query
# By vector values
pc index vector query -n my-index --vector '[0.1, 0.2, 0.3]' -k 10 --include-metadata
# By vector ID
pc index vector query -n my-index --id "doc-123" -k 10 --include-metadata
# With metadata filter
pc index vector query -n my-index \
--vector '[0.1, 0.2, 0.3]' \
--filter '{"genre":{"$eq":"sci-fi"}}' \
--include-metadata
# Sparse vectors
pc index vector query -n my-index \
--sparse-indices '[0, 5, 12]' \
--sparse-values '[0.5, 0.3, 0.8]' \
-k 15
# From stdin
jq -c '.embedding' doc.json | pc index vector query -n my-index --vector - -k 10Fetch
pc index vector fetch -n my-index --ids '["vec1","vec2","vec3"]'
pc index vector fetch -n my-index --filter '{"genre":{"$eq":"rock"}}'
pc index vector fetch -n my-index --namespace tenant-a --ids '["doc-123"]'
pc index vector fetch -n my-index --filter '{"genre":{"$eq":"rock"}}' --limit 100List / Update / Delete
# List vector IDs
pc index vector list -n my-index
pc index vector list -n my-index --namespace tenant-a --limit 50
# Update metadata or values
pc index vector update -n my-index --id "vec1" --metadata '{"category":"updated"}'
pc index vector update -n my-index --id "vec1" --values '[0.2, 0.3, 0.4]'
# Bulk update with dry-run
pc index vector update -n my-index \
--filter '{"genre":{"$eq":"sci-fi"}}' \
--metadata '{"genre":"fantasy"}' \
--dry-run
# Delete by IDs or filter
pc index vector delete -n my-index --ids '["vec1","vec2"]'
pc index vector delete -n my-index --filter '{"genre":"classical"}'
pc index vector delete -n my-index --namespace old-data --all-vectorsNamespace Management
pc index namespace create -n my-index --name tenant-a
pc index namespace create -n my-index --name tenant-b --schema "category,brand"
pc index namespace list -n my-index
pc index namespace list -n my-index --prefix "tenant-"
pc index namespace describe -n my-index --name tenant-a
pc index namespace delete -n my-index --name tenant-a # WARNING: deletes all vectorsBackup and Restore
# Create / list / describe
pc backup create -i my-index -n "nightly-backup" -d "Backup before deployment"
pc backup list
pc backup list --index-name my-index
pc backup describe -i <backup-uuid>
# Restore (creates a new index)
pc backup restore -i <backup-uuid> -n restored-index
pc backup restore -i <backup-uuid> -n restored-index --deletion-protection enabled
# Check restore job status
pc backup restore list
pc backup restore describe -i rj-abc123
# Delete backup
pc backup delete -i <backup-uuid>Project Management
pc project list
pc project create -n "demo-project"
pc project create -n "demo-project" --target
pc project describe -i proj-abc123
pc project update -i proj-abc123 -n "new-name"
pc project delete -i proj-abc123Organization Management
pc organization list
pc organization describe -i org-abc123
pc organization update -i org-abc123 -n "new-name"
pc organization delete -i org-abc123 # WARNING: highly destructiveAPI Key Management
pc api-key create -n "my-key"
pc api-key create -n "my-key" --store
pc api-key create -n "my-key" -i proj-abc123
pc api-key list
pc api-key describe -i key-abc123
pc api-key update -i key-abc123 --roles ProjectEditor
pc api-key delete -i key-abc123Global Flags
Available on all commands:
-h, --help— Show help-j, --json— JSON output (great for scripting)-q, --quiet— Suppress output--timeout— Command timeout (default: 60s, 0 to disable)
Exit Codes
0— success1— error
if pc index describe -n my-index 2>/dev/null; then
echo "Index exists"
else
pc index create -n my-index -d 1536 -m cosine -c aws -r us-east-1
fiRequirements and compatibility
Written for: Claude Code
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Claude Code frontmatter, Needs an API key, Needs a command-line tool
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Pinecone
- Publisher
- Pinecone (Official)
- Source
- pinecone-io/skills · skills/pinecone-cli · commit 885dc53
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Pinecone or Pinecone.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pinecone-cli.zip