Skip to content

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-cli

Verify installation:

grapevine --version
grapevine --help

Authentication

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..."' >> ~/.bashrc

Option 2: Command-Line Flag

Use --key with each command:

grapevine --key "0xYourPrivateKeyHere" feed list

Option 3: Configuration File

Save your configuration:

grapevine auth login --key "0xYourPrivateKeyHere" --network testnet

This 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 help

Quick 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]
Options:
  • -d, --description <desc> - Feed description
  • -t, --tags <tags> - Comma-separated tags
  • --image <url> - Cover image URL
Examples:
# 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]
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)
Examples:
# 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 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb

Get Feed

grapevine feed get <feed-id>

Shows detailed feed information including stats.

Update Feed

grapevine feed update <feed-id> [options]
Options:
  • -n, --name <name> - New name
  • -d, --description <desc> - New description
  • -t, --tags <tags> - New tags
  • --active <true|false> - Set active status
Example:
grapevine feed update <feed-id> \
  --name "Updated Name" \
  --description "New description" \
  --active true

Delete 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]
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)
Examples:
# 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]
Options:
  • --free - Only show free entries
  • --paid - Only show paid entries
  • -t, --tags <tags> - Filter by tags
  • -l, --limit <n> - Limit results (default: 10)
Examples:
# 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,video

Get 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 categories

Shows all available categories.

Show Info

grapevine info

Displays:

  • Runtime information (Bun/Node)
  • Network configuration
  • API endpoint
  • Wallet address (if configured)

Configuration Commands

Save Authentication

grapevine auth [options]
Options:
  • -k, --key <key> - Private key to save
  • -n, --network <network> - Default network
Example:
grapevine auth --key "0x..." --network testnet

Saves to ~/.grapevine/config.json.

Show Configuration

grapevine config show

Displays 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
done

Scripting

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
done

JSON Output

For programmatic access, parse CLI output:

# Save feed list to JSON
grapevine feed list --limit 100 > feeds.json

Examples

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_ID

Data 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/json

Troubleshooting

Authentication Failed

❌ Private key required. Use --key or set PRIVATE_KEY env variable

Solution: Set PRIVATE_KEY environment variable or use --key flag.

Network Errors

❌ Error: Network error

Solution: Check your internet connection and network configuration.

Payment Failures

❌ Payment required but failed

Solution: Ensure you have sufficient USDC for the operation.

Environment Variables

VariableDescriptionExample
PRIVATE_KEYWallet private key0x...
GRAPEVINE_NETWORKDefault networktestnet
GRAPEVINE_DEBUGEnable debug modetrue

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