跳到正文
原文
Hacker News· yazeedaloyoun·· 5 小时前精选AI 评分63

Proc-CLI 发布面向智能体的跨平台进程与端口管理工具

Show HN: Proc-CLI – An agent-friendly CLI tool for process and port management

AI 导读

Proc-CLI 发布进程与端口管理 CLI,支持 macOS、Linux 和 Windows,可按端口、PID、名称或路径定位进程。工具提供 19 个命令,覆盖占用查询、终止、等待退出、暂停和查找残留进程,几乎所有命令支持 --in、--json 与 --dry-run。

推荐理由

Proc-CLI 统一按端口、PID、名称或路径定位进程,并以 JSON 输出和固定退出码支持脚本及编码智能体调用。

正文 · 原文

Target processes by port, PID, name or path.

proc is a semantic CLI tool for process management on macOS, Linux and Windows. Find what's on a port, why it's there, and stop it, in one command you'd guess on the first try.

~proc kill :3000

Ends whatever is listening on port 3000 immediately (SIGKILL). Asks first, and --dry-run previews.

A leading colon means a port: proc acts on whatever is listening on it.

Command

Target

A dev server won't start because port 3000 is taken. proc finds the old tmux session holding it, frees the port, then cleans up what else was left running.

One command instead of a pipeline

The same jobs, without remembering which flags lsof needs or piping PIDs into kill.

What's on port 3000?lsof -i :3000 -P -nproc on :3000

Why is it there?lsof -i :3000, then ps -o ppid= up the chainproc why :3000

Free the portlsof -t -i:3000 | xargs kill && sleep 1 && lsof -i:3000proc free :3000

Wait for it to exitwhile ps aux | grep node | grep -v grep; do sleep 5; doneproc wait node

Pause a processkill -STOP $(pgrep node)proc freeze node

Find leftoversNo standard toolproc orphans --in .

Nineteen commands, three jobs

Every command takes the same targets, and almost all take --in to stay inside one project, --json for scripts, and --dry-run before anything changes.

All commands and options

Made for scripts and coding agents

Every command prints one JSON document with --json, and exit codes always mean the same thing. An agent can read proc the way you do, without parsing tables.

  • 0 success, 1 error, 2 not found, 3 permission denied, 4 invalid input
  • --dry-run shows what would be touched, and nothing else
  • The agent skill teaches Claude Code, Codex, Cursor, Gemini CLI and others when to reach for proc
❯ proc on :8080 --json | jq '.process | {pid, cwd, uptime_secs}'
{
  "pid": 177,
  "cwd": "/home/dev/code/shop",
  "uptime_secs": 35
}

Posts

All posts

来源:Hacker News · proc-cli.com