Command-line interface for the Pinarkive API v3. Upload files, pin CIDs, list files, delete files, inspect clusters, scaffold from templates, share encrypted files, run diagnostics, and watch folders—similar to the Vercel or Docker CLIs.
npm install -g @pinarkive/pinarkive-cliThen run:
pinarkive --helpgit clone <repo>
cd pinarkive-cli
npm install
npm run build
node dist/cli.js --helpOr link for local development:
npm link
pinarkive --helpStore your API key locally (required for all API commands except gateway and open):
pinarkive loginYou'll be prompted for your API key. It is saved to ~/.pinarkive/config.json.
Get your API key from Pinarkive or your dashboard.
| Command | Description |
|---|---|
login |
Save your API key to ~/.pinarkive/config.json |
upload <file> |
Upload a file; shows CID, size, and gateway URL |
pin <cid> |
Pin an existing CID |
files |
List your uploaded files (CID, size, cluster, created_at) |
delete <cid> |
Delete a file by CID |
clusters |
List your clusters |
gateway <cid> |
Print the gateway URL for a CID |
open <cid> |
Open the gateway URL in your browser |
init |
Create a new project from a template (from pinarkive-templates) |
share <file> |
Encrypt file (AES), upload, and get a share link. Options: -p password, -e expires, -c cluster |
whoami |
Show current user (email, plan, cluster count) |
doctor |
Run diagnostics: API, API key, gateway, cluster access |
watch <folder> |
Watch folder; upload and pin new files as they appear |
# Authenticate
pinarkive login
# Upload a file
pinarkive upload image.png
# Pin an existing CID
pinarkive pin bafybeigd...
# List your files
pinarkive files
# Delete a file
pinarkive delete bafybeigd...
# List clusters
pinarkive clusters
# Get gateway URL (no auth required)
pinarkive gateway bafybeigd...
# Open content in browser
pinarkive open bafybeigd...
# Create project from template (express-api, next-upload, node-script, python-upload, secure-share)
pinarkive init
# Share a file with password (encrypted upload + share link)
pinarkive share document.pdf -p mypassword
pinarkive share document.pdf -p secret -c mycluster
# Show current user
pinarkive whoami
# Run diagnostics
pinarkive doctor
# Watch folder and auto-upload new files
pinarkive watch ./uploadsUpload:
Uploading file...
✔ Upload successful
CID:
bafybeigd...
Size:
1.23 MB
Gateway:
https://gateway.pinarkive.com/ipfs/bafybeigd...
Gateway:
$ pinarkive gateway bafybeigd...
https://gateway.pinarkive.com/ipfs/bafybeigd...Share:
$ pinarkive share image.png -p mypass
✔ File encrypted
✔ Uploaded
CID:
bafy...
Share link:
https://pinarkive.com/#/bafy...:mypassDoctor:
✔ API reachable
✔ API key valid
✔ Gateway reachable
✔ Cluster access
All requests use: https://api.pinarkive.com/api/v3
Authentication: Bearer token (API key) in the Authorization header. The CLI uses the official @pinarkive/pinarkive-sdk-ts for all API calls.
npm run build— Compile TypeScript todist/npm run dev— Run CLI with ts-node:npm run dev -- upload image.pngnpm run lint— Run ESLint onsrc/
src/
cli.ts # Commander entry, command registration
api.ts # Pinarkive SDK client, base URL, auth
config.ts # Read/write ~/.pinarkive/config.json
crypto-share.ts # AES encryption for share command
types/
degit.d.ts # Type declaration for degit
commands/
login.ts
upload.ts
pin.ts
files.ts
delete.ts
clusters.ts
gateway.ts
open.ts
init.ts # Template scaffolding
share.ts # Encrypt + upload + share link
whoami.ts # Current user info
doctor.ts # Diagnostics
watch.ts # Folder watch + upload/pin
MIT