Integration

CLI Usage

Install sandboxes, generate new ones from API docs, and manage your setup -- all from the terminal.

Installation

Install the Ghostbox CLI globally or use it via npx without installing.

Global installbash
npm install -g ghostbox
One-time setup (no global install)bash
npx create-ghostbox@latest

The create-ghostbox scaffolder walks you through project setup, API key configuration, and installs your first sandbox.

ghostbox init

Initialize Ghostbox in an existing project. Creates a .ghostboxrc.json config file and prompts for your API key.

bash
ghostbox init

# Interactive prompts:
# ? Enter your Ghostbox API key: sandbox_test_...
# ? Which services do you want to add? (select with space)
#   > Stripe
#   > Resend
#   > PostHog
#   > Mailchimp
#
# Created .ghostboxrc.json
# Ready to go!

ghostbox add

Add a sandbox to your project. For built-in services, just pass the name. For custom APIs, pass a documentation URL and Ghostbox will generate a sandbox automatically.

Add a built-in sandboxbash
# Instantly available -- no generation needed
ghostbox add stripe
ghostbox add resend
ghostbox add posthog
ghostbox add mailchimp
Generate a new sandbox from API docsbash
# Provide a docs URL to generate a sandbox
ghostbox add hubspot --docs-url https://developers.hubspot.com/docs/api/overview

# Ghostbox analyzes the documentation and generates a
# full sandbox with endpoints, validation, and state.
# Once ready, it's available for all users to discover.

Search the sandbox registry for services other users have already generated.

bash
ghostbox search payment

# Results:
# stripe          28 endpoints   Built-in
# square          15 endpoints   Community
# paypal          12 endpoints   Community
#
# Use 'ghostbox add <name>' to install

ghostbox list

Show all sandboxes installed in the current project.

bash
ghostbox list

# Installed sandboxes:
# Service     Endpoints   Base URL
# stripe      28          https://ghostbox.dev/sandbox/stripe
# resend      10          https://ghostbox.dev/sandbox/resend
# posthog     10          https://ghostbox.dev/sandbox/posthog

Configuration

The .ghostboxrc.json file in your project root stores your sandbox configuration. The CLI reads and writes this file automatically.

.ghostboxrc.jsonjson
{
  "apiKey": "sandbox_test_abc123...",
  "services": {
    "stripe": {
      "baseUrl": "https://ghostbox.dev/sandbox/stripe",
      "version": "1.0.0"
    },
    "resend": {
      "baseUrl": "https://ghostbox.dev/sandbox/resend",
      "version": "1.0.0"
    },
    "hubspot": {
      "baseUrl": "https://ghostbox.dev/sandbox/hubspot",
      "version": "0.1.0",
      "generated": true
    }
  }
}

The generated: true flag indicates a sandbox was automatically generated rather than hand-crafted. Generated sandboxes support CRUD operations but may not cover all edge cases.

Command reference

CommandDescription
ghostbox initInitialize Ghostbox in current project
ghostbox add <service>Add a built-in or generated sandbox
ghostbox add <name> --docs-url <url>Generate a new sandbox from API docs
ghostbox search <query>Search the sandbox registry
ghostbox listList installed sandboxes
ghostbox remove <service>Remove a sandbox from project
ghostbox statusCheck API key validity and quota usage
ghostbox --helpShow help for all commands