VECTOR
Vector Pro

Developer Tools

Tools to make working with the Vector platform easier—whether you're integrating into your application, managing sites from the command line, or maintaining WordPress installations.

PHP SDK

A typed PHP client for the Vector Pro API with full IDE autocompletion and proper error handling.

Installation

composer require built-fast/vector-pro-sdk

Requires PHP 8.3+ and a PSR-18 HTTP client:

composer require guzzlehttp/guzzle

Basic Usage

use VectorPro\Sdk\Client;

$client = new Client('your-api-key');

// List all sites
$sites = $client->getSites();

// Create a site
$site = $client->createSite([
    'partner_customer_id' => 'cust_123',
    'dev_php_version' => '8.3',
]);

// Create an environment
$environment = $client->createEnvironment($site['id'], [
    'name' => 'production',
    'php_version' => '8.3',
    'is_production' => true,
]);

// Deploy
$deployment = $client->createDeployment($site['id'], $environment['id']);

Available Methods

The SDK covers all API endpoints:

Sites

$client->getSites(page: 1, perPage: 15);
$client->getSite('site_id');
$client->createSite([...]);
$client->updateSite('site_id', [...]);
$client->deleteSite('site_id');
$client->suspendSite('site_id');
$client->unsuspendSite('site_id');
$client->purgeSiteCache('site_id', ['paths' => ['/css/*']]);

Environments

$client->getEnvironments('site_id');
$client->getEnvironment('site_id', 'env_id');
$client->createEnvironment('site_id', [...]);
$client->updateEnvironment('site_id', 'env_id', [...]);
$client->deleteEnvironment('site_id', 'env_id');

Deployments

$client->getDeployments('site_id', 'env_id');
$client->getDeployment('site_id', 'env_id', 'deploy_id');
$client->createDeployment('site_id', 'env_id');
$client->rollbackDeployment('site_id', 'env_id', 'deploy_id');

Error Handling

use VectorPro\Sdk\Exceptions\ClientException;

try {
    $client->createSite([]);
} catch (ClientException $e) {
    if ($e->isValidationError()) {
        $errors = $e->getValidationErrors();
    }
    if ($e->isAuthenticationError()) { /* 401 */ }
    if ($e->isNotFoundError()) { /* 404 */ }
    if ($e->isServerError()) { /* 5xx */ }
}

Laravel Integration

// config/services.php
'vector' => [
    'api_key' => env('VECTOR_API_KEY'),
],

// Usage
$client = new Client(config('services.vector.api_key'));

Vector CLI

Manage sites and deployments from your terminal. Outputs human-readable tables interactively, JSON when piped.

Installation

composer global require built-fast/vector-pro-cli

Or download the PHAR from releases.

Authentication

vector auth:login                      # Interactive
vector auth:login --token=your-token   # Direct
export VECTOR_API_KEY=your-token       # Environment variable

vector auth:status                     # Check status
vector auth:logout                     # Remove stored token

Site Management

vector site:list
vector site:show <site-id>
vector site:create --customer-id=cust_123 --php-version=8.3
vector site:update <site-id> --php-version=8.4
vector site:delete <site-id>
vector site:suspend <site-id>
vector site:unsuspend <site-id>
vector site:purge-cache <site-id>
vector site:logs <site-id> --type=error --lines=200

Environments & Deployments

vector env:list --site=<site-id>
vector env:create --site=<site-id> --name=staging --php-version=8.3
vector env:delete <env-id> --site=<site-id>

vector deploy:list --site=<site-id> --env=<env-id>
vector deploy:create --site=<site-id> --env=<env-id>
vector deploy:rollback <deploy-id> --site=<site-id> --env=<env-id>

Output Formats

vector site:list              # Table output in terminal
vector site:list | jq .       # JSON output when piped
vector site:list --json       # Force JSON output

GitHub Actions

Deploy automatically from GitHub using the Vector CLI in your workflow.

name: Deploy to Vector

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Install Vector CLI
        run: |
          curl -sL https://github.com/built-fast/vector-cli/releases/latest/download/vector-x86_64-unknown-linux-gnu.tar.gz | tar xz
          sudo mv vector /usr/local/bin/

      - name: Deploy to production
        env:
          VECTOR_API_KEY: ${{ secrets.VECTOR_API_KEY }}
        run: vector deploy create ${{ vars.VECTOR_SITE_ID }} production

Store your API key as a repository secret (VECTOR_API_KEY) and your site ID as a variable (VECTOR_SITE_ID).

WP-CLI Commands

Every Vector site comes with extended WP-CLI commands for site management, diagnostics, and migrations. These are available via SSH on your development containers.

Site Blueprints

Export and import WordPress sites as portable archives—useful for migrating configured sites or creating templates.

# Export a site
wp vector blueprint export backup.tar.gz
wp vector blueprint export backup.tar.gz --include-uploads --max-upload-size=100M
wp vector blueprint export backup.tar.gz --include-plugins=my-plugin,another-plugin
wp vector blueprint export backup.tar.gz --exclude-tables=wp_sessions,wp_logs

# Import a site
wp vector blueprint import backup.tar.gz --target-url=https://newsite.com
wp vector blueprint import backup.tar.gz --target-url=https://newsite.com --dry-run

# Validate an archive
wp vector blueprint validate backup.tar.gz

Database Cleanup

Clean up common sources of database bloat:

wp vector cleanup revisions              # Delete all revisions
wp vector cleanup revisions --keep=5     # Keep 5 revisions per post
wp vector cleanup transients             # Delete expired transients
wp vector cleanup trash                  # Empty trash
wp vector cleanup orphans                # Delete orphaned postmeta
wp vector cleanup all                    # Run all cleanup tasks
wp vector cleanup all --dry-run          # Preview what would be deleted

Database Diagnostics

wp vector db                             # Show database summary
wp vector db tables                      # List tables with sizes
wp vector db revisions                   # Count revisions per post
wp vector db transients                  # Show transient stats
wp vector db orphans                     # Find orphaned data

Media Management

wp vector media                          # Show media library summary
wp vector media orphaned                 # Find files not in media library
wp vector media missing                  # Find attachments with missing files
wp vector media duplicates               # Find duplicate files

Options Inspection

wp vector options autoload               # List autoloaded options by size
wp vector options autoload --limit=50    # Show more options
wp vector options search <pattern>       # Search option names/values
wp vector options size                   # Show total options table size

Cron Inspection

wp vector cron                           # List scheduled events
wp vector cron --overdue                 # Show only overdue events
wp vector cron --hook=woocommerce        # Filter by hook name
wp vector cron status                    # Show cron system status

Other Commands

wp vector env                            # PHP, WordPress, database, server info
wp vector health                         # Site health summary
wp vector security                       # Run security checks
wp vector users admins                   # List all admin users
wp vector uploads-size                   # Check uploads size
wp change-domain old.example.com new.example.com  # Change site domain
wp user impersonate admin                # Generate one-time login URL

Claude Integration (MCP)

Vector Pro supports the Model Context Protocol (MCP), allowing you to manage hosting infrastructure through Claude. Instead of writing API calls or clicking through dashboards, use natural language to perform operations.

Setup with Vector CLI

The fastest way to get started:

vector mcp setup

This will automatically configure Claude Desktop with your API credentials.

Full MCP documentation

What You Can Do

Once configured, ask Claude things like:

  • "List my Vector sites"
  • "Deploy site abc123 to staging"
  • "What's the status of the last deployment?"
  • "Purge the CDN cache for production"
  • "Block IP 192.168.1.100 on site abc123"
  • "Rollback production to the previous deployment"

Quick Reference

Task Tool
Integrate Vector API into your appPHP SDK
Manage sites from terminalVector CLI
CI/CD deploymentsVector CLI or PHP SDK
Manage via natural languageClaude (MCP)
Migrate a WordPress sitewp vector blueprint
Clean up database bloatwp vector cleanup
Diagnose performance issueswp vector db, wp vector options
Audit media librarywp vector media
Security checkwp vector security
Generate support loginwp user impersonate