port-selector
Installation
SKILL.md
Port Selector
Use port-selector instead of hard-coded ports or hand-written lsof loops. Allocate from the same working directory in which the service runs because allocations are stable per (directory, name).
Start a local service
- Confirm the CLI is available with
command -v port-selector. If it is missing, install it with the repository's documented method before continuing. - Choose a short stable service name such as
web,api,docs,preview, ore2e. Use different names for services that run concurrently from the same directory. - Allocate and start the process in one shell command. Quote the port variable.
PORT="$(port-selector --name preview)"
python3 -m http.server "$PORT"
Adapt how the port is passed to the program: