agentproto CLI
Verbs

`agentproto tunnel`

text agentproto tunnel create --port <n> [--provider <slug>] [--name <slug>] [--label <text>] [--host <host>] [--autostart] [--hostname <fqdn>] [--tunnel-id <id>] [--credentials-file <path>] [--json]

agentproto tunnel

agentproto tunnel create --port <n> [--provider <slug>] [--name <slug>]
                         [--label <text>] [--host <host>] [--autostart]
                         [--hostname <fqdn>] [--tunnel-id <id>]
                         [--credentials-file <path>] [--json]
agentproto tunnel list   [--active] [--json]
agentproto tunnel stop   <id-or-name> [--json]        (alias: delete, rm)
agentproto tunnel status <id-or-name> [--json]

Manage public tunnels via the daemon's /tunnels HTTP routes. Tunnels expose a local port to the internet through Cloudflare or Ngrok, driven by the daemon — no separate tunnel CLI process to manage.

Requires a running daemon (serve.md or daemon.md). Discovery reads ~/.agentproto/runtime.json.

Providers

ProviderDescription
cloudflare-quick (default)Cloudflare Quick Tunnel — no API key, ephemeral *.trycloudflare.com URL (changes every run).
cloudflare-namedA pre-provisioned Cloudflare tunnel bound to a stable hostname. Needs --hostname and --tunnel-id.
ngrokNgrok tunnel — configure its authtoken first via the setup_tunnel_provider MCP tool.
Third-partyAny installed @scope/agentproto-adapter-<slug> provider.

Legacy aliases quick and named are accepted for the Cloudflare providers.

Named tunnel one-time setup

cloudflared tunnel create <name>
cloudflared tunnel route dns <name> <hostname>

Then reference it with --provider cloudflare-named --hostname … --tunnel-id ….

Subverbs

create

Creates a tunnel via POST /tunnels.

FlagDefaultDescription
--port <n>(required)Local port to expose (1–65535).
--provider <slug>cloudflare-quickTunnel provider.
--name <slug>Stable name for referencing the tunnel.
--label <text>Human-readable label.
--host <host>127.0.0.1Target host to forward to.
--autostartfalseRelaunch the tunnel automatically when the daemon boots.
--hostname <fqdn>(Named) Stable FQDN for the tunnel.
--tunnel-id <id>(Named) Pre-provisioned Cloudflare tunnel id.
--credentials-file <path>(Named) Path to Cloudflare credentials JSON.
--jsonfalseEmit the tunnel descriptor as JSON.

list

Lists tunnels known to the daemon via GET /tunnels.

FlagDefaultDescription
--activefalseShow only active tunnels.
--jsonfalseEmit an array of tunnel descriptors.

stop <id-or-name>

Stops a tunnel via DELETE /tunnels/:id. Accepts delete and rm as aliases.

FlagDefaultDescription
--jsonfalseEmit {"ok":bool,"tunnelId":str} as JSON.

status <id-or-name>

Prints a detailed descriptor for one tunnel via GET /tunnels/:id.

FlagDefaultDescription
--jsonfalseEmit the full descriptor as JSON.

Examples

# Quick tunnel — ephemeral URL, no credentials
agentproto tunnel create --port 3000

# Quick tunnel with a name for later reference
agentproto tunnel create --port 5173 --name vite-preview --json

# Named Cloudflare tunnel (pre-provisioned, stable hostname, autostart)
agentproto tunnel create --port 3040 --name prod-preview \
  --provider cloudflare-named \
  --hostname preview.example.com --tunnel-id my-tunnel \
  --autostart

# List active tunnels
agentproto tunnel list --active

# Inspect one
agentproto tunnel status prod-preview

# Tear down
agentproto tunnel stop prod-preview

See also

  • serve.md — daemon that hosts tunnels
  • daemon.md — managed background daemon with autostart
  • auth.md — configure Ngrok/provider credentials