Tunnel Command
Expose a local port to the internet with a single command. The CLI provisions a tunnel, debits your credits, and connects via WebSocket - all automatically (run otterkit login once first).
npx otterkit tunnel <port>This creates a public URL like https://agent-a1b2c3d4.otterkit.app that forwards all HTTP traffic to your local port. The tunnel stays alive as long as the terminal is open. Billed at 1 credit per connected hour (first hour charged up front), capped at 10 credits/day.
$ npx otterkit tunnel 3000
Checking login…
Provisioning tunnel...
Tunnel provisioned: agent-a1b2c3d4
Tunnel ready: https://agent-a1b2c3d4.otterkit.app -> 127.0.0.1:3000
Press Ctrl+C to disconnect
200 GET / (12ms)
200 GET /api/users (8ms)Add --log to also capture every request (headers, body, status, duration) to a local JSONL file for later inspection with otterkit inspect:
# Forward to port 3000 and log every request
npx otterkit tunnel 3000 --logAdd --auth user:pass to protect the public URL with HTTP Basic auth. The check runs in the CLI on your machine, before anything reaches your local server — requests without valid credentials get a 401 and are never forwarded. Credentials are not sent to or stored by OtterKit's servers.
# Only requests with valid Basic auth reach port 3000
npx otterkit tunnel 3000 --auth admin:s3cret
# Callers authenticate the usual way
curl -u admin:s3cret https://agent-a1b2c3d4.otterkit.app/