Skip to content

auth

Configure authentication credentials for the Grapevine CLI to interact with your wallet and create content.

Commands

login

Configure authentication with your private key and network settings.

grapevine auth login [options]

Options

--key, -k
  • Type: string
  • Required: Yes

Set your private key for authentication.

grapevine auth login --key "0xYourPrivateKeyHere"
--network, -n
  • Type: string
  • Default: testnet
  • Options: testnet, mainnet

Set the blockchain network to use.

grapevine auth login --key "0x..." --network testnet

status

Display current authentication status and wallet information.

grapevine auth status

Shows:

  • Current wallet address
  • Network configuration
  • API endpoint being used
  • Basic wallet statistics

logout

Remove all stored authentication data.

grapevine auth logout

Examples

Initial Setup

# Set up authentication with private key for testnet
grapevine auth login --key "0xYourPrivateKeyHere" --network testnet

Mainnet Setup

# Configure for mainnet (production)
grapevine auth login --key "0x..." --network mainnet

Check Status

# View current authentication status
grapevine auth status

Reset Authentication

# Clear all saved credentials
grapevine auth logout

Output

Successful Login

grapevine auth login --key "0x..." --network testnet
🔐 Configuring Grapevine CLI Authentication
 
✅ Private key configured
✅ Network set to: testnet
✅ Wallet address: 0x1234567890abcdef1234567890abcdef12345678
✅ Configuration saved to: ~/.grapevine/config.json
 
💰 Wallet Status:
   ETH Balance: 0.45 ETH
   USDC Balance: 127.50 USDC
   
🎉 Authentication setup complete!
   You can now create feeds and add entries.
 
Next steps:
   â€ĸ Create your first feed: grapevine feed create "My Blog"
   â€ĸ List categories: grapevine categories
   â€ĸ View CLI info: grapevine info

Authentication Status

grapevine auth status
🔐 Grapevine CLI Authentication Status
 
✅ Authenticated
   Wallet: 0x1234567890abcdef1234567890abcdef12345678
   Network: testnet
   API: https://api.grapevine.markets
   
💰 Wallet Balances:
   ETH: 0.45 ETH
   USDC: 127.50 USDC
   
📊 Account Stats:
   Feeds Created: 3
   Entries Published: 47
   Total Revenue: $23.75 USDC
   
🕒 Last Activity: 2 hours ago

Logout

grapevine auth logout
🔐 Clearing Grapevine CLI Authentication
 
✅ Authentication data cleared
✅ Configuration file updated
 
â„šī¸  You'll need to run 'grapevine auth login' to authenticate again.

Security Methods

Environment Variable (Recommended)

# Set environment variable
export PRIVATE_KEY="0xYourPrivateKeyHere"
 
# Use CLI without --key flag
grapevine feed create "My Blog"

Command Line Flag

# Pass key directly (less secure)
grapevine --key "0xYourPrivateKeyHere" feed create "My Blog"

Configuration File

# Store in config file
grapevine auth login --key "0xYourPrivateKeyHere" --network testnet
 
# Use CLI without specifying key
grapevine feed create "My Blog"

Security Best Practices

Private Key Safety

  1. Never Share: Never share your private key with anyone
  2. Secure Storage: Use environment variables or secure config files
  3. Regular Rotation: Consider rotating keys periodically
  4. Backup: Keep secure backups of your private key

Environment Setup

# Add to your shell profile (.bashrc, .zshrc, etc.)
export PRIVATE_KEY="0xYourPrivateKeyHere"
 
# Reload your shell
source ~/.zshrc
 
# Verify it works
grapevine auth status

Test Account Setup

For development and testing:

# Use testnet for development
grapevine auth login --key "0xTestPrivateKey" --network testnet
 
# Get testnet funds from faucet
# https://www.alchemy.com/faucets/base-sepolia

Network Configuration

Mainnet (Production)

grapevine auth login --key "0x..." --network mainnet
# Uses real ETH and USDC on Base

Testnet (Development)

grapevine auth login --key "0x..." --network testnet
# Uses test tokens on Base Sepolia, safe for development

Troubleshooting

Invalid Private Key

❌ Error: Invalid private key format
   Expected: 64-character hexadecimal string starting with '0x'
   Example: 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

Network Connection Issues

# Check current authentication status
grapevine auth status
 
# Try switching networks
grapevine auth login --key "0x..." --network testnet

Insufficient Funds

âš ī¸  Warning: Low wallet balance
   ETH: 0.001 ETH (need ~0.01 ETH for gas)
   USDC: 0.00 USDC (need USDC for payments)
   
   Please fund your wallet before creating content.

Configuration File

The authentication data is stored in ~/.grapevine/config.json:

{
  "network": "testnet",
  "apiUrl": "https://api.grapevine.markets",
  "walletAddress": "0x1234...5678",
  "encryptedPrivateKey": "encrypted-key-data"
}

Note: Private keys are encrypted before storage for security.

Related Commands