Usage

The xpose CLI exposes a local port to the internet through a Cloudflare Worker tunnel.

Basic usage

Expose a local server running on port 3000:

npx xpose-dev 3000

Multiple ports

Expose multiple ports at once. Each gets its own tunnel:

npx xpose-dev 3000 8787

Custom subdomain

Choose a prefix for your subdomain. A short random code is always appended to prevent collisions:

npx xpose-dev 3000 --subdomain my-app

This gives you a URL like https://my-app-x7k2m4.xpose.dev

Set a TTL

Limit how long the tunnel stays active (in seconds):

npx xpose-dev 3000 --ttl 3600

Default: 14400 seconds (4 hours). Maximum: 86400 seconds (24 hours).

Session resume

When you exit the TUI, your session is saved automatically. Resume within 10 minutes to reconnect to the same tunnel URLs:

npx xpose-dev -r

This is useful when you need to restart the CLI without changing the URLs you shared. The session file is stored in ~/.config/xpose/.

Turborepo integration

If you use Turborepo, xpose can auto-discover the port from a running dev task:

npx xpose-dev --from-turbo