Grapevine CLI
Command-line interface for managing Grapevine feeds and entries.
Features
🚀 Fast operations - Quick feed and entry management
💻 Interactive commands - Easy-to-use interface
📦 Batch operations - Process multiple items
🔧 Configuration - Save credentials securely
📊 Rich output - Formatted, colorful results
Installation
Install globally to use the CLI anywhere:
# Using npm
npm install -g @pinata/grapevine-cli
# Using Bun
bun add -g @pinata/grapevine-cli
# Using pnpm
pnpm add -g @pinata/grapevine-cliVerify installation:
grapevine --version
grapevine --helpAuthentication
Option 1: Environment Variable
Set your private key:
export PRIVATE_KEY="0xYourPrivateKeyHere"Add to your .bashrc or .zshrc for persistence:
echo 'export PRIVATE_KEY="0x..."' >> ~/.bashrcOption 2: Command-Line Flag
Use --key with each command:
grapevine --key "0xYourPrivateKeyHere" feed listOption 3: Configuration File
Save your configuration:
grapevine auth login --key "0xYourPrivateKeyHere" --network testnetThis creates ~/.grapevine/config.json with your settings.
Global Options
Available for all commands:
-n, --network <network> # Network: testnet or mainnet (default: testnet)
-k, --key <key> # Private key (or use PRIVATE_KEY env var)
-d, --debug # Enable debug output
--version # Show version
--help # Show helpQuick Start
Create a feed and add content:
# Create a feed
grapevine feed create "My Blog" --description "Tech articles" --tags tech,blog
# Add an entry
grapevine entry add <feed-id> "Hello World!" --title "First Post"
# List entries
grapevine entry list <feed-id>Feed Commands
Create Feed
grapevine feed create <name> [options]-d, --description <desc>- Feed description-t, --tags <tags>- Comma-separated tags--image <url>- Cover image URL
# Basic feed
grapevine feed create "My Feed"
# With options
grapevine feed create "Tech Blog" \
--description "Latest tech articles" \
--tags tech,programming,tutorial
# With image
grapevine feed create "Photo Gallery" \
--description "My photos" \
--image "https://example.com/cover.jpg"List Feeds
grapevine feed list [options]-o, --owner <address>- Filter by owner wallet-t, --tags <tags>- Filter by tags-a, --active- Only show active feeds-l, --limit <n>- Limit results (default: 10)
# List your feeds
grapevine feed list --limit 20
# Filter by tags
grapevine feed list --tags tech,ai --active
# Filter by owner
grapevine feed list --owner 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbGet Feed
grapevine feed get <feed-id>Shows detailed feed information including stats.
Update Feed
grapevine feed update <feed-id> [options]-n, --name <name>- New name-d, --description <desc>- New description-t, --tags <tags>- New tags--active <true|false>- Set active status
grapevine feed update <feed-id> \
--name "Updated Name" \
--description "New description" \
--active trueDelete Feed
grapevine feed delete <feed-id>Soft-deletes the feed and all its entries.
Entry Commands
Add Entry
grapevine entry add <feed-id> <content> [options]-t, --title <title>- Entry title-d, --description <desc>- Entry description--tags <tags>- Comma-separated tags-f, --file- Treat content as file path-m, --mime <type>- MIME type (auto-detected if not provided)--paid- Make entry paid (default: free)-p, --price <amount>- Price in USDC units (e.g., 1000000 = 1 USDC)
# Add text entry
grapevine entry add <feed-id> "Hello World" --title "First Post"
# Add from file
grapevine entry add <feed-id> ./article.md --file --title "Article"
# Add paid entry
grapevine entry add <feed-id> "Premium content" \
--title "Premium Article" \
--paid \
--price 1000000
# Add with specific MIME type
grapevine entry add <feed-id> ./data.json \
--file \
--mime application/json \
--title "JSON Data"List Entries
grapevine entry list <feed-id> [options]--free- Only show free entries--paid- Only show paid entries-t, --tags <tags>- Filter by tags-l, --limit <n>- Limit results (default: 10)
# List all entries
grapevine entry list <feed-id>
# List free entries
grapevine entry list <feed-id> --free --limit 20
# Filter by tags
grapevine entry list <feed-id> --tags tutorial,videoGet Entry
grapevine entry get <feed-id> <entry-id>Shows detailed entry information.
Delete Entry
grapevine entry delete <feed-id> <entry-id>Deletes the entry.
Other Commands
List Categories
grapevine categoriesShows all available categories.
Show Info
grapevine infoDisplays:
- Runtime information (Bun/Node)
- Network configuration
- API endpoint
- Wallet address (if configured)
Configuration Commands
Save Authentication
grapevine auth [options]-k, --key <key>- Private key to save-n, --network <network>- Default network
grapevine auth --key "0x..." --network testnetSaves to ~/.grapevine/config.json.
Show Configuration
grapevine config showDisplays saved configuration (without exposing private key).
Advanced Usage
Batch Operations
Create multiple entries from files:
# Add all markdown files
for file in posts/*.md; do
grapevine entry add $FEED_ID "$file" \
--file \
--title "$(basename $file .md)" \
--tags blog
doneScripting
Use in scripts:
#!/bin/bash
FEED_ID="your-feed-id"
# Create multiple entries
cat urls.txt | while read url; do
content=$(curl -s "$url")
grapevine entry add "$FEED_ID" "$content" \
--title "$url" \
--tags scraped
doneJSON Output
For programmatic access, parse CLI output:
# Save feed list to JSON
grapevine feed list --limit 100 > feeds.jsonExamples
Content Publishing Workflow
# 1. Create feed
FEED_ID=$(grapevine feed create "Tech Blog" \
--description "Daily tech articles" \
--tags tech,blog | grep -o 'Feed created: .*' | cut -d' ' -f3)
# 2. Add welcome post (free)
grapevine entry add $FEED_ID "Welcome to my blog!" \
--title "Welcome" \
--tags welcome
# 3. Add premium articles (paid)
grapevine entry add $FEED_ID ./article1.md \
--file \
--title "Advanced Tutorial" \
--paid \
--price 2000000
# 4. List all entries
grapevine entry list $FEED_IDData Publishing
# Create data feed
grapevine feed create "API Data" --tags data,json
# Add JSON data
echo '{"temperature": 72, "humidity": 45}' | \
grapevine entry add $FEED_ID /dev/stdin \
--title "Weather Data" \
--mime application/jsonTroubleshooting
Authentication Failed
❌ Private key required. Use --key or set PRIVATE_KEY env variableSolution: Set PRIVATE_KEY environment variable or use --key flag.
Network Errors
❌ Error: Network errorSolution: Check your internet connection and network configuration.
Payment Failures
❌ Payment required but failedSolution: Ensure you have sufficient USDC for the operation.
Environment Variables
| Variable | Description | Example |
|---|---|---|
PRIVATE_KEY | Wallet private key | 0x... |
GRAPEVINE_NETWORK | Default network | testnet |
GRAPEVINE_DEBUG | Enable debug mode | true |
Configuration File
Location: ~/.grapevine/config.json
{
"network": "testnet",
"apiUrl": "https://api.grapevine.markets"
}Note: Private keys are never saved to the config file for security.
Next Steps
- CLI Installation - Detailed setup
- Feed Commands - Feed management
- Entry Commands - Entry management
- SDK Documentation - Programmatic access
- Examples - More examples