Zero-install CLI for safer local ports

Pick a safe port before Docker does.

Generate a high, non-common, currently available port for Docker mappings and local development scripts.

npx safe-port
# 23456

PORT=$(npx safe-port)
docker run -p "$PORT:80" nginx

npx safe-port --count 3 --format json

Safe defaults

Uses a high default range and avoids common service ports such as 3000, 5432, 6379, and 8080.

Script friendly

Choose plain, JSON, or environment output for Docker, CI, and shell scripts.

No install needed

Run it with npx when you need it, then leave no global tool behind.