amalshaji/portr/portr-cli
- community
Checking that the SKILL.md file is still in the repository.
Use when an AI agent or harness needs to operate the Portr CLI: authenticate a client, add users to teams, create HTTP/WebSocket/TCP/stub tunnels, run config-defined tunnels, inspect request logs, replay captured requests, or control tunnels through the local app-server API. This skill is compatible with Claude Code and Codex through vercel-labs/skills.
Install
npx vskill@latest install amalshaji/portr/portr-cliSKILL.md
Portr CLI
Use this skill to operate an installed portr binary from an AI agent, test harness, or automation script. Portr manages team membership, exposes local services through public HTTP/WebSocket or TCP tunnels, can serve stubbed templated responses, stores local HTTP request logs, can replay stored requests, and can run a local API for programmatic tunnel lifecycle control.
Agent Rules
- Prefer
portr --config <temp-config.yaml> ...for automation so user config, auth tokens, and local request logs are not accidentally changed. - Treat
portr http,portr tcp,portr stub,portr start, andportr app-serveras long-running processes. Keep their process/session IDs so the harness can stop them. - Prefer
--jsonforportr logsandportr replaywhen a harness needs to parse output. - Use
portr app-serverfor programmatic lifecycle management instead of scraping TUI output. - Do not overwrite
~/.portr/config.yaml,~/.portr/db.sqlite, or auth tokens unless the user explicitly asks. - Do not create public tunnels for production services or sensitive local ports unless the user explicitly asks.
- Treat a generated user password as a secret. Show it only in the requested command output and never repeat, log, or persist it elsewhere.
- Adding a user changes server state. Confirm the email, team slug, and role from the user's request before running the command; use
default-teamandmemberonly when those values were omitted. - If a command's flags are uncertain, run
portr <command> --helpagainst the installed binary.
Command Map
--config,-c: YAML config path. Defaults to~/.portr/config.yaml.--help,-h: show help.--version,-v: print version.
Commands:
portr help [command]: show general help or command-specific help.portr auth set: configure client auth.portr admin users add: add a user to a team.portr config edit: open the default config in the OS editor.portr config pull: replace the local tunnels and groups with the team template.portr http: expose a local HTTP/WebSocket port.portr tcp: expose a local TCP port.portr stub: serve a templated response through a public HTTP tunnel without a local server.portr start: start one or more tunnels from config.portr logs: read local stored HTTP request logs.portr replay: replay a stored HTTP request.portr app-server: start a local HTTP API for harness-controlled tunnels.
Auth And Config
--token,-t: Portr client secret token from the server/admin UI. Required.--remote,-r: Portr server domain or URL. Required. Bare domains become HTTPS;localhost:*becomes HTTP unless a scheme is already provided.config editonly edits the default config path. For harnesses, write a temp config file and pass--config.config pulloverwrites the default config'stunnelsandgroupswith the team template configured in the admin dashboard, and fails if the team has no template. Everything else in the file, includingsecret_keyand comments, is left alone. It also only acts on the default config path.
Team Administration
- Uses the
server_urlandsecret_keyin the selected config. The credential must belong to an administrator of the target team; a superuser credential can target any team. --team: target team slug. Defaults todefault-teamwhen omitted.--role:memberoradmin. Defaults tomember.- When GitHub auto signup is disabled, a newly created user receives an initial password and the CLI prints a
Password:line. - When GitHub auto signup is enabled, new users are passwordless and the CLI omits the password line.
- Existing users keep their credentials, so adding them to another team never resets or prints their password.
- A missing default team is an error; do not create it implicitly.
Minimal automation config:
Global config keys:
server_url: admin/server URL.ssh_url: SSH tunnel server address.tunnel_url: public tunnel host suffix.secret_key: client auth secret.use_localhost: use HTTP rather than HTTPS for server/tunnel URLs.debug: enable debug behavior.use_vite: use the Vite-backed local UI path when supported by the running binary.dashboard_port: local inspector port. Default7777.disable_dashboard: skip the local inspector dashboard.enable_request_logging: store HTTP request logs locally. Defaulttrue.connection_log_retention_days: auto-delete old connection logs;0disables cleanup.health_check_interval: health check interval in seconds. Default3.health_check_max_retries: max health check retry count. Default10.disable_tui: run without the interactive terminal UI.disable_update_check: suppress release update checks.insecure_skip_host_key_verification: skip SSH host key verification. Defaulttrue.
One-Off Tunnels
HTTP/WebSocket:
- Exposes
localhost:<local-port>as a public HTTP/WebSocket tunnel. - If
--subdomainis omitted, Portr generates one. - Starts local request capture when request logging is enabled.
TCP:
- Exposes
localhost:<local-port>as a public TCP tunnel. - Use for databases and raw TCP protocols.
- TCP traffic is not available through
portr logs.
Stub:
--subdomain,-s: public stub subdomain. Required.--response-format: responseContent-Type, such asapplication/json,application/yml, ortext/plain. Required.--response-tmpl: inline response template.--response-tmpl-file: path to response template file.- Use exactly one of
--response-tmplor--response-tmpl-file. - Stub templates can read request values using Portr's template placeholders.
Config-Defined Tunnels
Config tunnel fields:
name: identifier used byportr start.type:http,tcp, orstub. Defaults tohttp.host: local host. Defaults tolocalhostexcept stubs.port: local port forhttpandtcp.subdomain: public subdomain. Required forstub; generated for one-off HTTP when omitted.pool_size: worker count for non-stub tunnels. Defaults to2; stubs use1.response_format,response_tmpl,response_tmpl_file: stub response settings.
Top-level groups maps a group name to tunnel names. A group name must not match a tunnel name, and every member must be an existing tunnel name.
Start configured tunnels:
- No names starts all configured tunnels.
- Passing names starts only those tunnel entries.
- A group name expands to its tunnel names, and can be mixed with tunnel names.
Request Logs
- Reads local HTTP request logs from
~/.portr/db.sqlite. - Logs are only available for traffic captured on the current machine with request logging enabled.
- Results are newest first.
- Positional filter is a case-insensitive URL substring.
--count,-n: max records to return. Default20.--since: RFC3339 timestamp orYYYY-MM-DD.--json: emit full records. Binary body fields stay base64-encoded; UTF-8 payloads also include text fields.- Use log IDs from this output with
portr replay.
Request Replay
- Replays a stored HTTP request through the original tunnel host.
--latest: choose the newest matching stored request instead of passing an ID.--subdomain: required with--latest.--filter: case-insensitive URL substring filter for--latest.--since: RFC3339 timestamp orYYYY-MM-DDfilter for--latest.--method: override HTTP method.--path: override path and query. Must start with/.--header 'Key: Value': add or override a header. Repeatable.--drop-header <name>: remove inherited header. Repeatable.--body <value>: inline body override.--body-file <path>: read body override from file.--stdin: read body override from stdin.--body-encoding:utf8orbase64.--json: emit replay details, effective request, response, and structured errors.- Body sources are mutually exclusive: use only one of
--body,--body-file, or--stdin. - Changing the body does not change the method; set
--method POST,PUT, orPATCHwhen the body must matter.
App Server For Harnesses
- Starts a local HTTP API around Portr tunnel lifecycle management.
- Default bind address is
127.0.0.1:7778. --host: bind host.--port: bind port.--token: bearer token required by the API.PORTR_APP_SERVER_TOKEN: env var alternative for--token.- If no token is configured, the local API is unauthenticated. Prefer a token in harnesses.
API endpoints:
| Method | Path | Purpose | |
|---|---|---|---|
GET | /api/v1/health | Health check. | |
POST | /api/v1/tunnels | Start a managed tunnel. | |
GET | /api/v1/tunnels | List managed tunnels. | |
GET | /api/v1/tunnels/{id} | Get one tunnel status. | |
DELETE | /api/v1/tunnels/{id} | Stop one tunnel. | |
POST | /api/v1/tunnels/{id}/shutdown | Stop one tunnel. | |
GET | /api/v1/events | List lifecycle events. | |
GET | /api/v1/events?tunnel_id={id} | List lifecycle events for one tunnel. |
Create tunnel JSON:
Stub tunnel JSON:
Useful response fields:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/portr-cli/SKILL.md
Popularity
- Repository stars
- 3,184
- Repository forks
- 113
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/amalshaji/portr/portr-cli)