{
  "format": "dockrun-bundle",
  "version": 1,
  "exportedAt": "2026-11-12T00:00:00Z",
  "workspaces": [],
  "workflows": [
    {
      "id": "228ED1CC-C96E-55F9-8781-FC68B09BE532",
      "name": "Free a port",
      "summary": "Stops whatever is listening on a TCP port, so your dev server can start.",
      "variables": [
        {
          "name": "port",
          "defaultValue": "3000",
          "summary": "The port to free"
        }
      ],
      "steps": [
        {
          "id": "6C5F3C8D-053F-543F-B857-E8C140FDA13E",
          "actionID": "script.run",
          "input": {
            "language": "zsh",
            "code": "# Stops whatever is listening on a TCP port (default 3000), so your dev server can start.\nport=\"${1:-3000}\"\n[[ \"$port\" == <1-65535> ]] || { echo \"Not a port number: $port\" >&2; exit 1 }\nlistening() { lsof -nP -tiTCP:\"$port\" -sTCP:LISTEN 2>/dev/null }\npids=($(listening))\n(( ${#pids} )) || { echo \"Nothing is listening on port $port.\"; exit 0 }\nfor pid in $pids; do\n  echo \"Stopping $(ps -p \"$pid\" -o comm= | sed 's|.*/||') (pid $pid)\"\n  kill \"$pid\" 2>/dev/null\ndone\nsleep 1\nfor pid in $(listening); do kill -9 \"$pid\" 2>/dev/null && echo \"Had to force pid $pid\"; done\n[ -z \"$(listening)\" ] && echo \"Port $port is free.\" || { echo \"Port $port is still in use (owned by another user?).\" >&2; exit 1 }\n",
            "args": "{{var.port}}"
          },
          "condition": {
            "kind": "always"
          },
          "onFailure": "stop",
          "timeout": 20,
          "isEnabled": true,
          "title": "Stop what is using the port"
        }
      ]
    }
  ]
}
