Tooling
CLI
Terminal commands to inspect and test Surf-enabled websites
CLI#
The @surfjs/cli package provides terminal commands to inspect and test Surf-enabled websites.
bash
# Check if a site is Surf-enabledsurf ping https://shop.example.com# โ
https://shop.example.com is Surf-enabled (42ms)ย # Inspect all commandssurf inspect https://shop.example.com# ๐ My Store (Surf v1.0)# 6 commands available:## search(query: string, limit?: number)# Search products## cart.add(sku: string, quantity?: number) ๐# Add item to cartย # Inspect with full parameter detailssurf inspect https://shop.example.com --verboseย # Execute a command interactivelysurf test https://shop.example.com search --query "laptop"# Executing search on https://shop.example.com...# OK# { "results": [...], "total": 42 }# โฑ 47ms execute / 89ms totalย # Machine-readable JSON outputsurf test https://shop.example.com search --query "laptop" --jsonย # With authenticationsurf test https://shop.example.com order.create --auth sk-token --sku LAPTOP-01ย # Override execute path for @surfjs/next deploymentssurf test https://my-app.vercel.app search --base-path /api/surf/execute --query "laptop"The CLI prompts for missing required parameters interactively and coerces values to the correct type.
| Flag | Description |
|------|-------------|
| --json | Machine-readable JSON output |
| --auth <token> | Bearer token for authenticated commands |
| --verbose | Show full parameter schemas (inspect only) |
| --base-path <path> | Override execute path (default: /surf/execute). Use /api/surf/execute for @surfjs/next. |