portless-local
Named .localhost URLs for local development - replaces port numbers with stable, readable URLs
What this skill does
# Portless - Named .localhost URLs Replace port numbers with stable, named `.localhost` URLs for local development. For humans and agents. > **Note:** By default, use HTTP (`http://myapp.localhost`). Only enable HTTPS (`--https` or `PORTLESS_HTTPS=1`) if the user specifically requests it (e.g., for OAuth, secure cookies, or HTTPS-only features). ## Why Portless? Local dev with port numbers is fragile. Portless fixes that by giving each dev server a stable, named `.localhost` URL. | Problem | With Ports | With Portless | | -------------------------- | ------------------------------------------------------- | ----------------------------------------------- | | **Port conflicts** | Two projects on :3000 = EADDRINUSE | Auto-assigned ports, named URLs - no collisions | | **Memorizing ports** | "Was the API on 3001 or 8080?" | Always `http://api.localhost` | | **Wrong app on refresh** | Stop one server, start another on same port = confusion | Named URLs eliminate this | | **Monorepo chaos** | Every service needs a unique port | Distinct hostnames for each service | | **Agent confusion** | AI agents guess/hardcode wrong ports | `http://myapp.localhost` is deterministic | | **Cookie/storage clashes** | Cookies bleed across ports on localhost | Each `.localhost` subdomain gets its own scope | | **Hardcoded config** | CORS, OAuth, .env break when ports change | URLs are stable across restarts | | **Sharing URLs** | "What port is that on?" in Slack | Everyone uses the same named URL | | **Browser history** | `localhost:3000` history is a jumble | Named URLs keep things organized | ## Installation ```bash # Global (recommended) npm install -g portless # Or as a project dev dependency npm install -D portless ``` > **Note:** portless is pre-1.0. When installed per-project, different contributors may run different versions. ## Usage Invoke via skill command or use CLI directly: ```bash # Via skill command /portless-local <NAME> <COMMAND> [OPTIONS] # Or use CLI directly portless <NAME> <COMMAND> [OPTIONS] ``` ## Commands ### Run an App ```bash portless run [--name <name>] <cmd> [args...] # Infers name from package.json, git root, or directory portless <name> <cmd> [args...] # Explicit name, no inference ``` `portless run` infers the project name from package.json, git root, or directory name. Use `--name` to override the inferred name while still applying worktree prefixes. | Flag | Description | | --------------------- | --------------------------------------------------------------------------------------------------- | | `--name <name>` | Override the inferred base name (worktree prefix still applies). Only for `portless run`. | | `--app-port <number>` | Use a fixed port for the app instead of auto-assignment. Also configurable via `PORTLESS_APP_PORT`. | | `--force` | Override an existing route registered by another process | **Examples:** ```bash portless run next dev # Infer name from project portless run --name myapp next dev # Override inferred name portless myapp next dev # Explicit name portless api pnpm start # API service portless docs.myapp next dev # Subdomain ``` ### Get a Service URL ```bash portless get <name> ``` Print the URL for a service. Useful for wiring services together in scripts or env vars: ```bash BACKEND_URL=$(portless get backend) ``` Applies worktree prefix detection by default. Use `--no-worktree` to skip it. ### Alias (Static Routes) ```bash portless alias <name> <port> # Register a static route portless alias <name> <port> --force # Force override existing portless alias --remove <name> # Remove the alias ``` Register a route for a service not managed by portless (e.g. a Docker container). Aliases persist across stale-route cleanup. ```bash portless alias my-postgres 5432 # -> http://my-postgres.localhost portless alias redis 6379 # -> http://redis.localhost portless alias --remove my-postgres # Remove the alias ``` ### List Routes ```bash portless list ``` Shows active routes and their assigned ports. ### Trust the CA ```bash portless trust ``` Adds the portless certificate authority to your system trust store. Required once for HTTPS with auto-generated certs. If you skipped the trust prompt on first run, run `portless trust` to add the CA later. ### HTTPS & HTTP/2 HTTP/2 + TLS is enabled by default for faster dev server page loads. **Why HTTP/2 matters:** Browsers limit HTTP/1.1 to 6 connections per host, which bottlenecks dev servers serving many unbundled files. HTTP/2 multiplexes all requests over a single connection. **First run:** Generates a local CA and server certs, then adds the CA to your system trust store. After that, no prompts, no browser warnings. **Custom certificates:** Use your own certs (e.g., from mkcert): ```bash portless proxy start --cert ./cert.pem --key ./key.pem ``` **Disable HTTPS:** Use `--no-tls` to run with plain HTTP on port 80: ```bash portless proxy start --no-tls portless myapp next dev --no-tls ``` ### Clean Up ```bash portless clean ``` Stops the proxy, removes the CA from OS trust store, deletes allowlisted files under `~/.portless`, the system state directory, and removes the portless block from `/etc/hosts`. May prompt for elevated privileges. ### Proxy Control #### Start Proxy ```bash portless proxy start ``` | Flag | Description | | --------------------- | -------------------------------------------------------------------------- | | `-p, --port <number>` | Proxy port (default: 443, or 80 with `--no-tls`). Auto-elevates with sudo. | | `--no-tls` | Disable HTTPS (use plain HTTP on port 80) | | `--https` | Enable HTTPS (default, accepted for compatibility) | | `--lan` | Enable LAN mode (mDNS `.local` domains for real device testing) | | `--ip <address>` | Override auto-detected LAN IP (use with `--lan`) | | `--tld <tld>` | Use a custom TLD instead of `.localhost` (e.g. `.test`) | | `--cert <path>` | Custom TLS certificate | | `--key <path>` | Custom TLS private key | | `--foreground` | Run in foreground instead of daemon mode | #### Stop Proxy ```bash portless proxy stop ``` ### LAN Mode Access services from phones and other devices on the same WiFi via mDNS (`.local` domains): ```bash portless proxy start --lan portless proxy start --lan --https portless proxy start --lan --ip 192.168.1.42 # Manual IP override ``` Make it permanent by adding `export PORTLESS_LAN=1` to your shell profile. Portless also remembers LAN mode via `proxy.lan`, so a stopped LAN proxy starts in LAN mode again. **Framework notes for LAN:** - **Next.js:** Add `allowedDevOrigins: ['myapp.local', '*.myapp.local']` to `next.config.js` - **Vite / React Router / SvelteKit / Astro:** Handled automatically via `__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS` - **Expo / React Native:** Add `NSAllowsLocalNetworking` to `app.json` for iOS ATS ### Hosts ```bash portless
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.