skills/outport/SKILL.md
Manage dev ports with Outport. Use when setting up a new project, adding services, resolving port conflicts, configuring monorepo cross-service URLs, or working with worktrees and multiple instances. Triggers on "outport", "port conflict", "port allocation", "dev ports", "outport.yml", "port management", "env var ports", "computed values", "cross-service URLs", "CORS origins from ports", ".test domains", "local DNS", "reverse proxy", "cookie isolation", "tunnel", "share localhost", "public URL", "cloudflare tunnel", "outport doctor", "health check", "diagnose outport", "QR code", "mobile access", "phone testing", "LAN IP", "hostname aliases", "multiple hostnames", "subdomain routing". Also use when the user mentions running multiple instances of a project, worktree port setup, or when services need to discover each other's URLs.
npx skillsauth add steveclarke/outport outportInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Outport allocates deterministic, non-conflicting ports for dev services,
assigns .test hostnames, and writes everything to .env files. Every
framework reads .env — Rails, Nuxt, Django, Docker Compose — so ports and
URLs just work without manual configuration.
# Project commands
outport init # Create outport.yml (interactive)
outport up # Allocate ports, assign hostnames, write .env
outport up --force # Clear and re-allocate all ports from scratch
outport down # Remove ports and clean .env files
# Inspect & diagnose
outport status # Show project status (ports, health, URLs)
outport status --computed # Include computed values
outport ports # Show ports with live process info (PID, memory, uptime)
outport ports --all # Full machine scan (Outport + non-Outport ports)
outport ports --down # Include ports with no running process
outport ports kill <svc> # Kill process by service name or port number
outport ports kill --orphans # Kill all orphaned dev processes
outport open # Open HTTP services in browser
outport open web # Open a specific service
outport share # Tunnel HTTP services to public URLs
outport share web # Tunnel a specific service
outport qr # Show QR codes for mobile device access
outport qr --tunnel # Show QR codes with tunnel URLs
outport doctor # Check system health and project config
# System commands (machine-wide)
outport system start # Install DNS, CA, and start the daemon
outport system stop # Stop the daemon
outport system restart # Re-write plist and restart the daemon
outport system status # Show all registered projects
outport system status --check # Show with health checks (up/down)
outport system prune # Remove stale registry entries
outport system uninstall # Remove DNS resolver, daemon, and CA
# Instance management
outport rename <old> <new> # Rename the current instance
outport promote # Promote the current instance to main
All commands support --json for machine-readable output.
outport.ymlRun outport init for interactive setup, or create manually:
name: my-project
services:
web:
env_var: PORT
postgres:
env_var: DB_PORT
redis:
env_var: REDIS_PORT
outport upAllocates deterministic ports (hashed from project name + service name) and
writes them to .env. Same inputs always produce the same ports.
.envMost frameworks read .env natively or with minimal setup:
.env automatically. Use ${DB_PORT:-5432} in
compose.ymldotenv-rails gem, or reference env vars in config:
port: ENV.fetch("DB_PORT", 5432).env natively. Runtime config values can be overridden
via NUXT_* env vars.env automatically.env. Source it in your start script:
if [ -f .env ]; then set -a; source .env; set +a; fi
outport.yml, gitignore .envoutport.yml is project config — commit it so worktrees and teammates
inherit it. .env contains allocated ports — gitignore it. Each checkout
gets its own.
Running outport system start once enables friendly .test hostnames for
your services. After setup, https://myapp.test routes to your app instead
of http://localhost:24920.
outport system start installs three components (requires sudo for DNS and CA trust):
*.test queries to a
local DNS server on port 15353, which resolves all *.test names to
127.0.0.1. On macOS this is /etc/resolver/test; on Linux it's a
systemd-resolved drop-in config.Host header to the correct service port, and auto-updates
when you run outport up. WebSocket connections are proxied transparently.
Managed by launchd on macOS, systemd on Linux.outport system start # Install DNS + CA + daemon (one-time, prompts for sudo)
outport system stop # Stop the daemon
outport system restart # Re-write plist and restart the daemon
outport system uninstall # Remove everything — reverse of start
Add hostname to a service to assign it a .test URL:
name: myapp
services:
web:
env_var: PORT
hostname: myapp.test # → https://myapp.test
postgres:
env_var: DB_PORT # no hostname: port allocation only
Hostname rules:
myapp.test, app.myapp.test)Each instance gets its own .test hostname, so browser cookies and
sessions are isolated automatically — no incognito windows needed:
myapp [main] web → 24920 http://myapp.test
myapp [bkrm] web → 28104 http://myapp-bkrm.test
| Field | Required | Description |
|-------|----------|-------------|
| name | yes | Project identifier. Used for port allocation and hostname generation. |
| open | no | List of service names that outport open opens by default. When omitted, opens all services with a hostname. |
| Field | Required | Description |
|-------|----------|-------------|
| env_var | yes | Environment variable name written to .env |
| hostname | no | .test hostname for this service (e.g., myapp.test). Implies HTTP. Non-main instances get the instance code appended. |
| aliases | no | Named alternative hostnames (map of label → hostname). Each alias routes to the same port. Requires hostname. |
| subdomains | no | Enable wildcard subdomain routing (*.myapp.test). All subdomains route to the same port. Requires hostname. |
| preferred_port | no | Port to try first. Falls back to hash-based allocation if already in use |
| env_file | no | Where to write. String or array. Defaults to .env in project root |
.env FilesFor monorepos, a port often needs to appear in multiple .env files. Use an
array for env_file:
services:
rails:
env_var: RAILS_PORT
env_file:
- backend/.env
- frontend/.env # Frontend needs this to construct API URLs
Applications don't just need port numbers — they need URLs. Computed values
compute environment variables from your service map and write finished values
to .env.
computed:
API_URL:
value: "${rails.url:direct}/api/v1" # http://localhost:24920/api/v1
env_file: frontend/.env
CORS_ORIGINS:
value: "${web.url}" # http://myapp.test (or localhost:PORT)
env_file: backend/.env
${service_name.field} references service fieldsenv_file is required (no default — you must be explicit)env_var names| Template | Resolves to | Use case |
|----------|------------|----------|
| ${rails.port} | 24920 | Raw port number |
| ${rails.hostname} | myapp.test (or localhost if no hostname set) | Hostname only |
| ${rails.url} | http://myapp.test | Browser-facing URLs (CORS, asset hosts), routed via proxy |
| ${rails.url:direct} | http://localhost:24920 | Server-to-server calls that bypass the proxy |
| ${rails.env_var} | PORT | Env var name for the service |
| ${rails.alias.NAME} | app.myapp.test | Alias hostname by label |
| ${rails.alias_url.NAME} | https://app.myapp.test | Alias URL by label |
When to use url vs url:direct:
${service.url} — for values the browser sends (CORS origins, asset
hosts, OAuth redirect URIs). Uses the .test hostname when configured.${service.url:direct} — for server-to-server calls (API base URLs a
backend fetches, WebSocket connections from a Node server). Always uses
localhost — no proxy hop.Computed values support standalone variables and bash-style parameter expansion for instance-aware configuration:
| Variable | Main instance | Worktree instance (e.g., bxcf) |
|----------|--------------|----------------------------------|
| ${project_name} | myapp | myapp |
| ${instance} | (empty string) | bxcf |
| ${instance:-default} | default | bxcf |
| ${instance:+replacement} | (empty string) | replacement |
| ${instance:+-${instance}} | (empty string) | -bxcf |
Common pattern — Docker Compose project name:
computed:
COMPOSE_PROJECT_NAME:
value: "${project_name}${instance:+-${instance}}"
env_file: .env
This produces myapp for the main instance and myapp-bxcf for worktrees,
giving each instance isolated Docker containers.
When the same env var needs different values in different files (common in
monorepos where multiple apps share a framework convention), use the object
syntax for env_file entries:
computed:
NUXT_API_BASE_URL:
env_file:
- file: frontend/apps/main/.env
value: "${rails.url:direct}/api/v1"
- file: frontend/apps/portal/.env
value: "${rails.url:direct}/portal/api/v1"
You can mix plain string entries (which use the top-level value) with
object entries in the same list.
Rails backend with two Nuxt frontends. Backend needs CORS origins from
frontend .test URLs. Frontends need the Rails API URL for server-side
fetches:
name: myapp
services:
rails:
env_var: RAILS_PORT
hostname: myapp.test
env_file: backend/.env
frontend_main:
env_var: MAIN_PORT
hostname: app.myapp.test
env_file:
- frontend/apps/main/.env
- backend/.env # Backend needs this for CORS
frontend_portal:
env_var: PORTAL_PORT
hostname: portal.myapp.test
env_file:
- frontend/apps/portal/.env
- backend/.env # Backend needs this for CORS
computed:
# Server-to-server API URLs (bypass proxy — use direct localhost)
NUXT_API_BASE_URL:
env_file:
- file: frontend/apps/main/.env
value: "${rails.url:direct}/api/v1"
- file: frontend/apps/portal/.env
value: "${rails.url:direct}/portal/api/v1"
# Backend CORS (browser-facing — use .test hostnames)
CORE_CORS_ORIGINS:
value: "${frontend_main.url},${frontend_portal.url}"
env_file: backend/.env
# Backend asset host (browser-facing)
SHRINE_ASSET_HOST:
value: "${rails.url}"
env_file: backend/.env
After outport up, every service has the right ports AND the right URLs.
No hardcoded values survive.
When setting up computed values, knowing how frameworks map env vars to config is essential:
| Framework | Convention | Example |
|-----------|-----------|---------|
| Nuxt | NUXT_ prefix maps to runtimeConfig | NUXT_API_BASE_URL overrides runtimeConfig.apiBaseUrl |
| Rails (AnyWayConfig) | PREFIX_ATTR maps to config class | CORE_CORS_ORIGINS overrides CoreConfig.cors_origins |
| Rails (Shrine) | Same AnyWayConfig pattern | SHRINE_ASSET_HOST overrides ShrineConfig.asset_host |
| Django | Typically reads os.environ directly | Name vars however your settings.py expects |
| Docker Compose | Reads .env automatically | ${DB_PORT:-5432} in compose.yml |
The computed values feature is most powerful when it writes env vars that match these framework conventions — the framework reads the value natively and no config code changes are needed.
Outport writes managed variables in a fenced block at the bottom of each
.env file:
# Your own variables — Outport never touches these
SECRET_KEY=abc123
RAILS_ENV=development
# --- begin outport.dev ---
DB_PORT=21536
RAILS_PORT=24920
NUXT_API_BASE_URL=http://localhost:24920/api/v1
# --- end outport.dev ---
On each outport up, the fenced block is replaced with current values.
Variables removed from outport.yml disappear from the block. Everything
outside the block is preserved.
Outport detects git worktrees automatically. Each worktree gets unique ports
and its own .test hostname — no configuration needed:
# Main checkout
$ outport up
my-app [main]
rails RAILS_PORT → 24920 http://my-app.test
web MAIN_PORT → 21349
# Worktree — different ports, different hostname, zero conflicts
$ cd ../my-app-feature && outport up
Registered as my-app-bkrm. Use 'outport rename bkrm <name>' to rename.
my-app [bkrm]
rails RAILS_PORT → 20192 http://my-app-bkrm.test
web MAIN_PORT → 21133
Computed values are recomputed per instance — CORS origins, API URLs, and all other computed values automatically use that instance's ports and hostnames. Two full instances run simultaneously with no port collisions, no hostname collisions, and no manual configuration.
Manage instances with:
outport rename bkrm my-feature # Rename an instance
outport promote # Promote current instance to main
Run outport up early in your project's setup flow — after .env file
creation but before services start. Make it optional so developers without
Outport aren't blocked:
# In bin/setup or similar
if command -v outport > /dev/null 2>&1; then
outport up
else
echo "Outport not found — using default ports"
echo "Install: brew install steveclarke/tap/outport"
fi
Run outport up in both projects. Outport's registry ensures no
collisions across all registered projects.
Run outport up --force to clear and re-allocate.
Run outport down to remove from registry and free all ports.
Add it to outport.yml and run outport up. Existing allocations
are preserved — only the new service gets a port.
Run outport status --json for structured output with ports, health, and URLs.
Check outport system status to see all allocations. If another project
holds the ports you want, run outport down in it first, then
outport up --force in yours.
Run outport qr to display a QR code encoding the LAN URL for each HTTP
service. Scan with your phone on the same Wi-Fi to open the app. Use
outport qr --tunnel while outport share is running to get a QR for the
public tunnel URL instead. QR codes are also available in the dashboard at
outport.test.
Run outport share to tunnel all HTTP services to public Cloudflare URLs.
Requires cloudflared (brew install cloudflared). Press Ctrl+C to stop.
Run outport doctor to check DNS, daemon, certificates, registry, and
project config. Each check shows pass/fail with a fix suggestion.
Run outport doctor to diagnose. Common causes: daemon not running
(outport system start) or DNS resolver missing (outport system start).
Report bugs or request new features at https://github.com/steveclarke/outport/issues
development
Audit all documentation for staleness after code changes. Checks README, CLAUDE.md, init presets, and release docs. Use after completing a feature, merging a PR, or when asked to check docs.
devops
Release a new version of outport. Use when the user says "release", "let's release", "tag a release", "ship it", "cut a release", "push a new version", or asks about the release process. Also use when the user asks to deploy docs after a release.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.