How the portal-tunnel client CLI (cmd/portal-tunnel) is structured and invoked — expose/agent/list/update subcommands, flags, validation rules, and x402/routing options. Use when changing or testing client-side tunnel behavior.
npx skills add https://github.com/gosuda/portal-tunnel --skill portal-tunnel-cli
Entrypoint cmd/portal-tunnel/main.go. Subcommands are dispatched by the repo's own utils.RunCommands (std flag package, NOT cobra/urfave). Commands: expose, agent {run,dashboard,stop,restart}, list, update, version, help. Flags are defined in code (main.go, agent.go); --help prints usage + examples but does NOT enumerate flags — read the source for the authoritative list.
Publishes a local service. Key flags (many have env fallbacks, shown in ENV):
<target> (e.g. 3000, localhost:8080) OR --http-route "PATH=UPSTREAM[ METHOD,...:AMOUNT]" (repeatable) OR --serve <dir|file> for static.--relays (extra API URLs), --discovery (default true), --max-active-relays (default 3, MAX_ACTIVE_RELAYS).--multi-hop (explicit ordered URLs, MULTI_HOP) OR --multi-hop-depth (default 0, MULTI_HOP_DEPTH) — mutually exclusive.--identity-path (default identity.json, IDENTITY_PATH), --identity-json (IDENTITY_JSON).--ban-mitm (BAN_MITM).--udp/--udp-addr (UDP_ENABLED/UDP_ADDR), --tcp (TCP_ENABLED).--name --description --tags --owner --thumbnail --hide.--x402-pay-to, --x402-network (Sui/Casper CAIP-2), --x402-asset, --x402-testnet, --x402-endpoint (repeatable), --x402-facilitator-token (CSPR_CLOUD_API_KEY).--metrics-addr. Parsed values flow into sdk.ExposeConfig (main.go ~224-281).--http-route.--serve cannot combine with target/--http-route/--udp/--tcp.--http-route payment amounts require --x402-pay-to.--x402-asset.--multi-hop cannot combine with --multi-hop-depth.portal expose 3000
portal expose localhost:8080 --name my-app
portal expose --serve ./site --name my-app
portal expose --http-route /api=http://127.0.0.1:3001 --http-route /=http://127.0.0.1:5173
portal expose 3000 --udp --udp-addr 127.0.0.1:5353
portal expose 3000 --relays https://portal.example.com --discovery=false
portal expose 3000 --multi-hop-depth 3
agent run (--config default service.DefaultConfigPath(), --service, --foreground); agent dashboard/stop (--config, --state-dir); agent restart (--config). See cmd/portal-tunnel/agent.go.list (--relays, --default-relays default true).update (--version, empty = latest).Default public relays come from embedded registry.json → types.BootstrapRelays; version/protocol from config.toml → types.ReleaseVersion/SDKVersion/DiscoveryVersion (embedded via manifest.go).
Take gosuda/portal-tunnel-cli from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.