
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@whenlabs/berth
Advanced tools
Port & Process Conflict Resolver for Developers.
See every port your dev environment is using, detect conflicts before they happen, and resolve them with one command. Berth scans your running processes, Docker containers, and project config files to give you a unified view of port usage across your entire local development stack.
| berth | lsof / netstat | kill-port | |
|---|---|---|---|
| Detects conflicts before starting | Scans configs and running processes together | Only shows what is running now | No conflict detection |
| Reads project config files | Parses .env, docker-compose.yml, package.json, Procfile | No config awareness | No config awareness |
| Suggests resolution | Recommends kill, reassign, or remap with one command | Raw process list, figure it out | Kills blindly |
| Unified dashboard | System processes + Docker + project configs in one view | Separate tools for each | Port kill only |
| Framework-aware | Knows default ports for Next.js, Vite, Django, etc. | No framework knowledge | No framework knowledge |
~/.berth/registry.json for persistent trackingpackage.json, .env, docker-compose.yml, Procfile, Makefile, and framework defaultslsof on macOS/Linux and netstat on Windowsberth check exits with code 1 on conflicts; --json flag for machine-readable outputberth predict -- Reads docker-compose.yml, package.json scripts, .env, and framework defaults to show what ports the project wants vs what is currently in use:
berth predict ~/projects/my-app
PORT WANTED BY STATUS
3000 package.json (next dev) ✗ in use (node, PID 4821)
5432 docker-compose (postgres) ✓ available
6379 docker-compose (redis) ✓ available
healthy, unhealthy, starting)Conflict: port 3000
→ kill 4821 # node (next-dev)
→ docker stop redis # redis:7-alpine (port 6379)
npm install -g berth
Requires Node.js >= 18.
berth status
Shows all active ports (system processes, dev servers), Docker containers, and configured-but-not-running ports from registered projects. Displays a summary with conflict count.
berth check ~/projects/my-app
Scans the project directory for port requirements and cross-references against what is currently running. Exit code 1 if conflicts are found (CI-friendly). Includes suggested fixes.
# Kill whatever is on port 3000
berth kill 3000
# Kill all dev processes (node, deno, bun, python, ruby, etc.)
berth kill --dev
# Skip confirmation
berth kill 3000 --force
Dev processes (node, vite, next, webpack, etc.) are distinguished from system services (postgres, redis, nginx) and handled accordingly.
cd ~/projects/my-app
berth register
# Or specify a directory
berth register --dir ~/projects/my-app
# Skip confirmation
berth register --yes
Scans the directory and records port requirements in ~/.berth/registry.json.
berth list
Shows all registered projects with their ports and running status (running, partial, stopped).
berth free my-app
Kills all active processes on ports registered to the given project.
berth reassign 3000 3001 --project my-app
Updates .env, docker-compose.yml, and package.json with the new port number. Handles PORT=, --port, -p, and URL patterns contextually.
# Auto-detect and resolve conflicts in the current directory
berth resolve
# Resolve conflicts in a specific project directory
berth resolve ~/projects/my-app
# Preview what would happen without making changes
berth resolve --dry-run
# Allow killing blocking processes
berth resolve --kill
# Choose a strategy: kill, reassign, or auto (default)
berth resolve --strategy kill
berth resolve --strategy reassign
berth resolve --strategy auto
Scans the project directory for port conflicts and resolves them automatically. The auto strategy kills dev processes and reassigns ports for system services. Use --dry-run to preview changes.
berth start my-app
berth start my-app --dry-run
Automatically resolves conflicts for a registered project: kills dev processes, remaps ports, and updates config files. Use --dry-run to preview changes without applying them.
berth watch
berth watch --interval 10
berth watch --notify
Monitors for port conflicts in real-time with configurable polling interval. The --notify flag sends desktop notifications (via node-notifier) when new conflicts are detected.
| Flag | Description |
|---|---|
--json | Machine-readable JSON output |
--verbose | Show detailed debug output |
--no-color | Disable colored output |
Active (what is running now):
lsof (macOS/Linux) or netstat (Windows)docker psConfigured (what wants to run):
package.json scripts (--port, -p, PORT=).env / .env.local / .env.development filesdocker-compose.yml / compose.yml port mappingsProcfile commandsMakefile recipe commandsBerth automatically detects default ports for the following frameworks by inspecting dependencies and config files:
Next.js, Vite, Create React App, Angular, Vue CLI, Storybook, Remix, Astro, Nuxt, Gatsby, SvelteKit, Webpack Dev Server, Parcel, Django, Flask, FastAPI, Rails
berth-tool/
src/
cli.ts # CLI entry point (commander setup)
types.ts # TypeScript type definitions
errors.ts # Custom error classes
commands/
status.ts # berth status
check.ts # berth check
kill.ts # berth kill
free.ts # berth free
register.ts # berth register
list.ts # berth list
reassign.ts # berth reassign
resolve.ts # berth resolve (auto-resolve conflicts)
start.ts # berth start
watch.ts # berth watch
detectors/
index.ts # Detector orchestrator
active/
lsof.ts # macOS/Linux port detection via lsof
netstat.ts # Windows port detection via netstat
docker.ts # Docker container port detection
configured/
dotenv.ts # .env file scanner
package-json.ts # package.json script scanner
docker-compose.ts # docker-compose.yml scanner
procfile.ts # Procfile scanner
makefile.ts # Makefile scanner
framework.ts # Framework default port detection
registry/
store.ts # Registry file I/O (~/.berth/registry.json)
project.ts # Project lookup helpers
resolver/
conflicts.ts # Conflict detection algorithm
suggestions.ts # Resolution suggestion engine
actions.ts # Kill, reassign, and free port actions
reporters/
terminal.ts # Colored terminal output (chalk + cli-table3)
json.ts # JSON output formatter
utils/
platform.ts # Platform detection, shell exec, Docker availability
ports.ts # Port validation, free port finder, framework defaults
process.ts # Process classification, graceful kill
tests/
commands/ # Command integration tests
detectors/ # Detector unit tests
registry/ # Registry store tests
resolver/ # Conflict and action tests
berth watch --notify)npm install
npm run dev -- status # Run in development
npm test # Run tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage
npm run build # Build for production
npm run typecheck # Type check
MIT
FAQs
Port & Process Conflict Resolver for Developers
The npm package @whenlabs/berth receives a total of 84 weekly downloads. As such, @whenlabs/berth popularity was classified as not popular.
We found that @whenlabs/berth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.