gitmyhub

portless

TypeScript ★ 9.8k updated 9d ago

Replace port numbers with stable, named local URLs. For humans and agents.

Portless is a command-line tool for local web development that replaces port numbers with readable, named URLs. Instead of opening your app at something like http://localhost:3000, you get https://myapp.localhost. The name stays the same every time, works in any browser tab, and includes HTTPS by default, which matters because some browser features only work on secure connections.

The problem it solves is that developers working on multiple projects at once often run them on different port numbers, which are easy to forget or confuse. Port conflicts are also common when two services try to use the same number. Portless assigns each app a random port behind the scenes and routes traffic through a local proxy, so you never have to think about port numbers again.

You install it once globally with npm and then prefix your usual start command: instead of next dev, you run portless myapp next dev. The tool supports most popular frameworks including Next.js, Express, Nuxt, Vite, Astro, and React Native. For frameworks that need special handling, portless automatically injects the right flags.

For developers working on large projects with multiple services (a web frontend, an API, a docs site), portless lets each one live at its own subdomain: myapp.localhost, api.myapp.localhost, docs.myapp.localhost. It also has built-in support for git worktrees, a workflow where you keep multiple branches of a project checked out at once. Each branch automatically gets its own URL, so you can test two versions of your app in the same browser simultaneously without them interfering.

The tool was released by Vercel Labs, the experimental arm of the company behind the Next.js framework. The README is detailed and covers monorepo setups, custom domain suffixes, and configuration options. The full README is longer than what was shown.