
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. Part of the WhenLabs toolkit.
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 local development stack.
Part of the WhenLabs toolkit — install all 6 tools with one command:
npx @whenlabs/when install
| 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 |
package.json, .env, docker-compose.yml, Procfile, Makefile, .devcontainer/devcontainer.json, and framework defaultsberth.config.js with custom ports, aliases, reserved ranges, and pluginsberth status --trace shows which tmux pane / shell / VS Code window started each processberth statushealthy, unhealthy, starting)lsof on macOS/Linux and netstat on Windowsberth check exits with code 1 on conflicts; --json flag for machine-readable output--mcp flag wraps output in a {schema, data, hints} envelope for agents; full MCP tooling is provided via the @whenlabs/when umbrella serverRecommended: Install the full WhenLabs toolkit with
npx @whenlabs/when installto get berth plus 5 other tools in one step.
npm install -g @whenlabs/berth
Requires Node.js >= 18.
berth statusberth status
berth status --trace # also resolve process ancestry
berth status --mcp # emit a {schema, data, hints} envelope for LLM agents
Shows all active ports (system processes, dev servers) and Docker containers. Displays a summary with conflict count.
With --trace, berth resolves each active process's parent shell, tmux/screen pane, and start time so you know which terminal to kill. Opt-in because it fans out ps per PID.
berth check [dir]berth check ~/projects/my-app
berth check --fix # automatically resolve detected conflicts
berth check --mcp # machine-readable envelope for agents
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.
berth kill [port]berth kill 3000 # kill whatever is on port 3000
berth kill --dev # kill all dev processes (node, deno, bun, python, ruby, etc.)
berth kill 3000 --force # skip confirmation
Dev processes (node, vite, next, webpack, etc.) are distinguished from system services (postgres, redis, nginx) and handled accordingly.
berth reassign <oldPort> <newPort>berth reassign 3000 3001
berth reassign 3000 3001 --dry-run
Updates .env, docker-compose.yml, and package.json in the current directory with the new port number. Handles PORT=, --port, -p, and URL patterns contextually.
berth resolve [dir]berth resolve # resolve conflicts in cwd
berth resolve ~/projects/my-app
berth resolve --dry-run # preview changes without applying
berth resolve --kill # allow killing blocking processes
berth resolve --strategy kill # force kill
berth resolve --strategy reassign # force reassign
berth resolve --strategy auto # default: kill dev processes, reassign system services
Detects and auto-resolves port conflicts. The auto strategy kills dev processes and reassigns ports for system services.
berth initberth init # writes berth.config.js in the current dir
berth init --format mjs
berth init --format json # writes .berthrc.json instead
berth init --force # overwrite existing config
Generates a starter config pre-filled with ports berth auto-detected. Edit it to declare canonical ports, disable specific framework defaults, reserve port ranges, or load plugins. See Configuration below.
| 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):
berth.config.js / .berthrc.json (highest priority, always high confidence)package.json scripts (--port, -p, PORT=).env / .env.local / .env.development filesdocker-compose.yml / compose.yml port mappings.devcontainer/devcontainer.json (forwardPorts, appPort, portsAttributes)Procfile 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.config.jsDrop a berth.config.js (or .mjs / .cjs / .berthrc.json / package.json#berth) in your project root. Berth walks upward from cwd looking for it, stopping at .git or $HOME.
// berth.config.js
import { defineConfig } from '@whenlabs/berth';
export default defineConfig({
projectName: 'my-monorepo',
ports: {
web: 3000,
api: { port: 4000, required: true, description: 'GraphQL API' },
worker: 4100,
},
reservedRanges: [
{ from: 5000, to: 5010, reason: 'local database pool' },
],
frameworks: {
disable: ['Express'], // don't use Express's default port
override: { Vite: 5174 }, // use 5174 instead of Vite's default 5173
},
plugins: [
'./scripts/berth-k8s-plugin.js', // resolved relative to the config file
],
});
The file supports extends: "./base.config.js"; local values win over the extended base.
Plugins register detectors via the shared plugin registry:
// scripts/berth-k8s-plugin.js
export default function plugin(registry) {
registry.registerConfigured({
name: 'k8s',
kind: 'configured',
async detect({ dir }) {
// ...parse k8s/**/*.yaml for Service ports...
return [{
port: 30080,
source: 'docker-compose', // closest existing source family
sourceFile: `${dir}/k8s/web.yaml`,
context: 'Service web → nodePort',
projectDir: dir,
projectName: 'web',
confidence: 'high',
}];
},
});
}
Plugins can also replace existing builtins by re-registering the same name, or remove them via registry.unregister(name).
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.