Human and agent friendly
Use interactive prompts when you want safety, or use JSON, TOON, and stable exit codes when you need automation.
A cross-platform CLI for identifying and releasing busy ports with predictable output for humans and AI agents.
ferman is a small cross-platform DevOps CLI for identifying which process is using a port and releasing it safely when needed.
It is designed to work well for both humans and AI agents:
--force for direct action--dry for inspection only--json for scripts, CI, and agents--toon for compact LLM-oriented structured output--list for active listening port inventory--common for common local development ports--plan for recommendations without termination--doctor for environment-level diagnosis--node for active Node.js process listing--filter for focused Node.js and node-port listings--node-ports for active Node.js processes with listening ports--kill-all --name for process targeting by name or command pattern--self to include the current ferman invocation in node-oriented listings--signal for explicit termination signals on Unix-like systems--json-schema for integration-safe contracts--watch for continuous re-checking--changed-only for quieter watch outputferman-mcp for MCP-based agent integration over stdioRun without installing:
npx ferman 3000Install globally:
npm install -g ferman
ferman 3000Core commands:
ferman 3000
ferman 3000 --force
ferman 3000 --dry
ferman --list --json
ferman 3000 --json
ferman 3000 --toon
ferman 3000 5173 5432 --json
ferman --common --json
ferman --plan --json
ferman --doctor --json
ferman --node --json
ferman --node --filter mcp --json
ferman --node --self --json
ferman --node-ports --json
ferman --kill-all --name vite --json
ferman --kill-all --name vite --signal SIGKILL --json
ferman --json-schema
ferman 3000 --watch --json
ferman 3000 --watch --changed-only --json
npx -p ferman ferman-mcpCapabilities matrix:
| Capability | Command | Output | Action |
|---|---|---|---|
| Inspect a port | ferman 3000 | Human-readable | Finds the process and asks before termination |
| Force release | ferman 3000 --force | Human-readable | Finds the process and terminates without confirmation |
| Dry inspection | ferman 3000 --dry | Human-readable | Finds the process and does not terminate anything |
| Port list | ferman --list --json | Machine-readable JSON | Lists active listening ports with their bound processes |
| Multi-port support | ferman 3000 5173 5432 --json | Machine-readable JSON | Returns batch results and a summary for multiple ports |
| Common-port scan | ferman --common --json | Machine-readable JSON | Scans a stable set of common local development ports |
| Plan mode | ferman --plan --json | Machine-readable JSON | Returns a recommended next action without terminating processes |
| Doctor mode | ferman --doctor --json | Machine-readable JSON | Returns a local development diagnosis and summary |
| Node process listing | ferman --node --json | Machine-readable JSON | Lists active Node.js processes with PID and command data |
| Filtered node listing | ferman --node --filter mcp --json | Machine-readable JSON | Restricts node-oriented output to matching process names or commands |
| Node process listing with self | ferman --node --self --json | Machine-readable JSON | Includes the current ferman invocation in the process list |
| Node process port listing | ferman --node-ports --json | Machine-readable JSON | Lists active Node.js processes together with listening ports |
| Kill by process pattern | ferman --kill-all --name vite --json | Machine-readable JSON | Terminates all matching processes by name or command pattern |
| Custom kill signal | ferman --kill-all --name vite --signal SIGKILL --json | Machine-readable JSON | Uses an explicit signal for Unix-like process termination |
| JSON mode | ferman 3000 --json | Machine-readable JSON | Returns structured output for scripts, CI, and AI agents |
| JSON Schema | ferman --json-schema | Machine-readable JSON | Prints the JSON Schema for structured output consumers |
| Watch mode | ferman 3000 --watch --json | JSON event stream | Re-checks ports continuously and emits snapshot events |
| Changed-only watch mode | ferman 3000 --watch --changed-only --json | JSON event stream | Emits a new watch snapshot only when the result changes |
| MCP wrapper | npx -p ferman ferman-mcp | MCP stdio server | Exposes ferman operations as MCP tools for agent integrations |
| TOON mode | ferman 3000 --toon | Machine-readable TOON | Returns compact structured output optimized for LLM-facing workflows |
| Free port no-op | ferman 3000 | Human-readable | Reports that the port is already free and exits successfully |
| Invalid input handling | ferman abc, ferman abc --json, ferman abc --toon | Error, JSON, or TOON | Rejects invalid port input with a deterministic exit code |
Example JSON output:
{
"ok": true,
"code": "PORT_RELEASED",
"port": 3000,
"busy": true,
"processes": [
{
"pid": 1234,
"name": "node"
}
],
"action": "killed",
"message": "Port released."
}Example TOON output:
ok: true
code: PORT_RELEASED
port: 3000
busy: true
processes[1]{pid,name}:
1234,node
action: killed
message: Port released.Exit codes:
0: success1: runtime error2: invalid inputMachine error codes:
INVALID_ARGUMENTSINVALID_PORTOUTPUT_MODE_CONFLICTUNSUPPORTED_PLATFORMCOMMAND_UNAVAILABLEPERMISSION_DENIEDPROCESS_NOT_FOUNDKILL_FAILEDINSPECTION_FAILEDUNKNOWN_ERRORPlatform support:
lsof, psnetstat, tasklist, taskkillVerification status:
Development commands:
npm run lint
npm test
npm run typecheck
npm run build
npm run smoke
npm run release:checkIf ferman helps you keep local development moving, you can support ongoing maintenance through GitHub Sponsors:
For bugs, regressions, and feature requests, use GitHub Issues: