Skip to main content

CLI Quick Start Guide

Get your plugin deployed to TagadaPay in just a few minutes! This guide will walk you through installing the CLI, authenticating, and deploying your first plugin.

Prerequisites

Before you begin, make sure you have:
  • Node.js 18+ installed (Download)
  • A TagadaPay account with access to a store
  • Your plugin built and ready to deploy
Check your Node.js version:
node --version
# Should show v18.0.0 or higher

Installation

1

Install the CLI globally

npm install -g @tagadapay/plugin-cli
Installs the latest version (v3.0.0+)
2

Verify installation

tgdcli --version
You should see: 3.0.0 or higher
3

Login to TagadaPay

tgdcli login
This opens your browser for secure authentication. Once complete, you’ll see:
βœ… Successfully logged in as [email protected]
πŸͺ Available stores: 3

Your First Deployment

The easiest way to deploy is using interactive mode:
tgdcli interactive
πŸŽ›οΈ  TagadaPay Plugin Manager
────────────────────────────

? What would you like to do? (Use arrow keys)
❯ πŸš€ Deploy Plugin
  πŸ“‹ List Deployments
  πŸ”Œ Install Plugin from Store
  πŸ”— Mount Plugin to Alias
  πŸ“Š List Instances
  🌐 Manage Domains
  ❌ Exit
Select β€πŸš€ Deploy Plugin” and follow the wizard:
  1. Store Selection: Choose which store to deploy to
  2. Config Selection: Pick a configuration file (or none)
  3. Confirmation: Review details before deploying
  4. Deployment: Watch real-time progress
  5. Success: Get your deployment ID and CDN URL

Option 2: Command Line

For automation or scripts, use the direct command:
# Navigate to your plugin directory
cd my-plugin

# Deploy (auto-detects plugin.manifest.json)
tgdcli deploy --store-id store_abc123

# Deploy with configuration
tgdcli deploy --store-id store_abc123 --config config/production.json

Plugin Structure

Your plugin directory should look like this:
my-plugin/
β”œβ”€β”€ plugin.manifest.json    # Required: Plugin metadata
β”œβ”€β”€ dist/                   # Required: Built files
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   └── style.css
β”‚   └── images/
β”œβ”€β”€ config/                 # Optional: Configuration variants
β”‚   β”œβ”€β”€ development.json
β”‚   β”œβ”€β”€ staging.json
β”‚   └── production.json
└── .local.json            # Optional: Local development config

Create plugin.manifest.json

If you don’t have one yet, create it:
plugin.manifest.json
{
  "pluginId": "my-first-plugin",
  "name": "My First Plugin",
  "version": "1.0.0",
  "description": "My awesome TagadaPay plugin",
  "author": "Your Name",
  "pages": [
    {
      "path": "/",
      "features": ["landing"],
      "isDefault": true,
      "remappable": false
    }
  ],
  "mode": "direct-mode"
}

Build Your Plugin

Make sure your plugin is built:
# Build with your preferred build tool
npm run build

# Verify dist directory exists
ls -la dist/

Step-by-Step Deployment Walkthrough

Step 1: Prepare Your Plugin

# Verify required files
ls plugin.manifest.json  # Should exist
ls dist/                 # Should exist and contain built files
ls config/              # Optional: check for configs

Step 2: Login & Select Store

# Login (if not already)
tgdcli login

# Check current user
tgdcli whoami

# Start interactive mode
tgdcli interactive

Step 3: Deploy

tgdcli interactive
  1. Select πŸš€ Deploy Plugin
  2. Choose your store from the list
  3. Select a configuration (or skip)
  4. Confirm and deploy
  5. Copy your deployment ID and URL

Step 4: Verify Deployment

# List all deployments
tgdcli list --store-id store_abc123

# Or use interactive list
tgdcli interactive
# > Select: πŸ“‹ List Deployments
You should see your deployment:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ID          β”‚ Plugin ID         β”‚ Version β”‚ Status       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ dep_abc123  β”‚ my-first-plugin   β”‚ 1.0.0   β”‚ βœ… Active    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step 5: Mount to Alias (Optional)

To make your plugin accessible at a custom path:
# Mount to /my-plugin
tgdcli mount-alias dep_abc123 /my-plugin --store-id store_abc123

# Or use interactive mount
tgdcli interactive
# > Select: πŸ”— Mount Plugin to Alias
Now your plugin is accessible at: https://yourstore.com/my-plugin

Common Workflows

Deploy to Multiple Environments

1

Deploy to Development

tgdcli deploy --config config/development.json --store-id store_dev
2

Test in Development

Visit the CDN URL and test your plugin thoroughly
3

Deploy to Staging

tgdcli deploy --config config/staging.json --store-id store_staging
4

Deploy to Production

tgdcli deploy --config config/production.json --store-id store_prod

Update Existing Deployment

To update a plugin:
  1. Update version in plugin.manifest.json:
    {
      "version": "1.0.1"  // Increment version
    }
    
  2. Rebuild your plugin:
    npm run build
    
  3. Deploy again:
    tgdcli deploy --store-id store_abc123
    
  4. Update mount (if needed):
    # Unmount old version
    tgdcli list-mounts --store-id store_abc123
    # Find and unmount old deployment
    
    # Mount new version
    tgdcli mount-alias dep_new123 /my-plugin --store-id store_abc123
    

Deploy with Different Configs (A/B Testing)

# Deploy variant A
tgdcli deploy --config config/variant-a.json --store-id store_abc123
# Returns: dep_variant_a_123

# Deploy variant B
tgdcli deploy --config config/variant-b.json --store-id store_abc123
# Returns: dep_variant_b_456

# Mount to different paths
tgdcli mount-alias dep_variant_a_123 /checkout-a --store-id store_abc123
tgdcli mount-alias dep_variant_b_456 /checkout-b --store-id store_abc123

Pro Tips πŸ’‘

1. Use Interactive Mode for Manual Operations

# Interactive mode provides:
# - Better UX with visual feedback
# - Validation before actions
# - Easy navigation between tasks
tgdcli interactive

2. Save Store ID as Default

# Set default store
export TAGADA_STORE_ID=store_abc123

# Now you can omit --store-id
tgdcli deploy
tgdcli list
tgdcli mount-alias dep_123 /checkout

3. Use Verbose Mode for Debugging

tgdcli --verbose deploy
# Shows detailed logs, API calls, and upload progress

4. Organize Configs by Environment

config/
β”œβ”€β”€ environments/
β”‚   β”œβ”€β”€ development.json
β”‚   β”œβ”€β”€ staging.json
β”‚   └── production.json
└── variants/
    β”œβ”€β”€ theme-blue.json
    └── theme-green.json

5. Validate Before Deploying

# Check manifest is valid
cat plugin.manifest.json | python -m json.tool

# Verify build output
ls -R dist/

# Dry run (if supported)
tgdcli deploy --dry-run

Troubleshooting

Problem: CLI not installed or not in PATHSolution:
# Reinstall globally
npm install -g @tagadapay/plugin-cli

# Check installation
which tgdcli
npm list -g @tagadapay/plugin-cli
Problem: Login expired or credentials invalidSolution:
# Logout and login again
tgdcli logout
tgdcli login

# Verify authentication
tgdcli whoami
Problem: Running deploy outside plugin directorySolution:
# Navigate to plugin directory
cd /path/to/your/plugin

# Verify manifest exists
ls plugin.manifest.json

# Try deploy again
tgdcli deploy
Problem: Plugin not built before deployingSolution:
# Build your plugin
npm run build

# Verify dist/ exists
ls -la dist/

# Try deploy again
tgdcli deploy
Problem: Invalid store ID or no accessSolution:
# Check available stores
tgdcli whoami

# Use interactive mode to select store
tgdcli interactive

# Or get store ID from TagadaPay dashboard

What’s Next?

Quick Reference

Essential Commands

# Authentication
tgdcli login
tgdcli logout
tgdcli whoami

# Deployment
tgdcli deploy                                    # Interactive
tgdcli deploy --store-id store_123               # Direct
tgdcli deploy --config config/prod.json          # With config

# Management
tgdcli list --store-id store_123                 # List deployments
tgdcli list-instances --store-id store_123       # List instances
tgdcli list-mounts --store-id store_123          # List mounts

# Mounting
tgdcli mount-alias dep_123 /checkout             # Mount to path
tgdcli list-mounts --store-id store_123          # View mounts

# Interactive (recommended)
tgdcli interactive                               # All-in-one interface

Common Flags

FlagDescriptionExample
--store-idSpecify store--store-id store_123
--configUse config file--config config/prod.json
--verboseDetailed logging--verbose
--base-urlAPI endpoint--base-url production
--helpShow help--help

Support

Need help? We’re here for you:
πŸŽ‰ Congratulations! You’ve successfully deployed your first plugin with the TagadaPay CLI!