Skip to content

fermanInspect ports. Free them fast.

A cross-platform CLI for identifying and releasing busy ports with predictable output for humans and AI agents.

ferman logo

Overview

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:

  • interactive confirmation for safe termination
  • --force for direct action
  • --dry for inspection only
  • --json for scripts, CI, and agents
  • --toon for compact LLM-oriented structured output
  • multi-port support for batch inspection
  • --common for common local development ports
  • --plan for recommendations without termination
  • --doctor for environment-level diagnosis
  • --json-schema for integration-safe contracts
  • --watch for continuous re-checking
  • predictable exit codes for automation

Install

Run without installing:

bash
npx ferman 3000

Install globally:

bash
npm install -g ferman
ferman 3000

Tools

Core commands:

bash
ferman 3000
ferman 3000 --force
ferman 3000 --dry
ferman 3000 --json
ferman 3000 --toon
ferman 3000 5173 5432 --json
ferman --common --json
ferman --plan --json
ferman --doctor --json
ferman --json-schema
ferman 3000 --watch --json

Capabilities matrix:

CapabilityCommandOutputAction
Inspect a portferman 3000Human-readableFinds the process and asks before termination
Force releaseferman 3000 --forceHuman-readableFinds the process and terminates without confirmation
Dry inspectionferman 3000 --dryHuman-readableFinds the process and does not terminate anything
Multi-port supportferman 3000 5173 5432 --jsonMachine-readable JSONReturns batch results and a summary for multiple ports
Common-port scanferman --common --jsonMachine-readable JSONScans a stable set of common local development ports
Plan modeferman --plan --jsonMachine-readable JSONReturns a recommended next action without terminating processes
Doctor modeferman --doctor --jsonMachine-readable JSONReturns a local development diagnosis and summary
JSON modeferman 3000 --jsonMachine-readable JSONReturns structured output for scripts, CI, and AI agents
JSON Schemaferman --json-schemaMachine-readable JSONPrints the JSON Schema for structured output consumers
Watch modeferman 3000 --watch --jsonJSON event streamRe-checks ports continuously and emits snapshot events
TOON modeferman 3000 --toonMachine-readable TOONReturns compact structured output optimized for LLM-facing workflows
Free port no-opferman 3000Human-readableReports that the port is already free and exits successfully
Invalid input handlingferman abc, ferman abc --json, ferman abc --toonError, JSON, or TOONRejects invalid port input with a deterministic exit code

Example JSON output:

json
{
  "ok": true,
  "code": "PORT_RELEASED",
  "port": 3000,
  "busy": true,
  "processes": [
    {
      "pid": 1234,
      "name": "node"
    }
  ],
  "action": "killed",
  "message": "Port released."
}

Example TOON output:

text
ok: true
code: PORT_RELEASED
port: 3000
busy: true
processes[1]{pid,name}:
  1234,node
action: killed
message: Port released.

Exit codes:

  • 0: success
  • 1: runtime error
  • 2: invalid input

Machine error codes:

  • INVALID_ARGUMENTS
  • INVALID_PORT
  • OUTPUT_MODE_CONFLICT
  • UNSUPPORTED_PLATFORM
  • COMMAND_UNAVAILABLE
  • PERMISSION_DENIED
  • PROCESS_NOT_FOUND
  • KILL_FAILED
  • INSPECTION_FAILED
  • UNKNOWN_ERROR

Platform support:

  • macOS and Linux: lsof, ps
  • Windows: netstat, tasklist, taskkill

Development commands:

bash
npm run lint
npm test
npm run typecheck
npm run build
npm run smoke
npm run release:check

If ferman helps you keep local development moving, you can support ongoing maintenance through GitHub Sponsors:

Support

For bugs, regressions, and feature requests, use GitHub Issues:

Resources

The hands of AI.