CLI 目录 横向对比 FCRS-1.0 标准 关于我们 /llms.txt

witr

$ witr 社区开源 低风险
pranshuparmar (OSS) · 文件检索与编辑 · Apache-2.0 · macos / linux / windows · 评测日期:

witr(pranshuparmar/witr)通过回溯系统调用链(systemd/launchd 服务、Docker/Podman/Kubernetes 容器、定时任务与父级 Shell),精确回答某个进程、端口或容器为何在运行。支持面向 Agent 的 --json 结构化报告、进程树(--tree)及交互式 TUI(--interactive)。

FCRS-1.0 综合评分
90 /100
极佳 (Excellent)
中置信度 (源码/文档)
零摩擦安装命令
brew install witr
CLI vs MCP 选型建议 仅 CLI 可用

一条只读诊断命令(witr --port 8080 --json)即可直接返回完整进程因果 JSON,完全不需要常驻 MCP 服务。

核心事实概览

命令名
$ witr
FCRS-1.0 总分
90/100 (极佳 (Excellent))
证据置信度
中置信度 (源码/文档)
CLI vs MCP 建议
仅 CLI 可用
评测日期

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 23 / 25

支持纯净的 --json 因果报告输出,并提供 -p/--pid、-o/--port、-c/--container 等精准过滤参数。

  • Supports --json, --port, --pid, --container, and --tree
安全与权限边界 24 / 25

纯只读本地诊断工具,无任何破坏性操作、无凭证需求且无外网请求。

  • Read-only local OS process and socket inspection
安装与运行摩擦 14 / 15

原生 Go 二进制,可通过 brew install witr、go install、winget/scoop 及安装脚本跨平台获取。

  • Homebrew, Go, winget/scoop, and shell installer
能力覆盖与边际价值 13 / 15

用一条因果 JSON 追踪取代繁琐的多步 lsof + ps + docker inspect 排查。

  • Single-command process, port, and container ancestry resolution
维护与来源背书 8 / 10

高星 Apache-2.0 开源项目(pranshuparmar/witr,23.6k+ stars)。

  • pranshuparmar/witr repository
文档与可验证性 8 / 10

GitHub README 与 Go 包文档详细记录了所有参数与 JSON 输出。

  • GitHub README and pkg.go.dev docs

安全边界、鉴权与放权指南

鉴权方式
无需鉴权
凭证存储位置

无需任何凭证;仅以只读方式检查本地系统进程表、套接字与容器元数据。

潜在副作用
只读查询
费用与配额提示

Apache-2.0 开源免费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# witr Agent Rules
- Always pass `--json` (and never `-i` / `--interactive`) in agent shells.
- Run `witr --port <port> --json` before killing an unexpected listener so you do not terminate a supervisor or container daemon blindly.

Agent 高频安全命令配方

只读查询(安全推荐)

追溯占用指定端口的进程起源
witr --port 8080 --json

以 JSON 格式输出 8080 端口对应进程的完整祖先链、宿主服务与容器上下文。

以 JSON 查看指定 PID 的启动源头
witr --pid 1234 --json

以机器可读 JSON 解析 PID 1234 的父进程链与启动来源。

核心优势

  • + 单次 --json 调用即可理清进程、端口与容器的完整来龙去脉。
  • + 100% 只读本地排查,可放心交给 Agent 自主排障。
  • + 跨平台原生二进制,零运行时依赖。

注意事项与踩坑点

  • ! 受操作系统权限隔离影响,查看 root 或高权限系统进程时可能需要提权。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI

同分类相关 CLI: 文件检索与编辑

进入分类页 →
$ zstd

高速无损压缩 CLI,支持 `-l` 只读元信息查看、`-t` 完整性校验与标准输出流式解压。

bat 89/100
$ bat

支持 `--line-range` 切片与 `--paging=never` 非交互输出的语法高亮 `cat` 替代品。

$ hyperfine

统计学命令行基准测试工具,支持 `--warmup`、`--runs` 与 `--export-json` 报告导出。

cloc 89/100
$ cloc

跨语言统计空白行、注释行与源代码行数(`cloc --json`、`--git --diff`)

ripgrep 98/100
$ rg

极速本地只读代码检索触手,原生支持 `--json` NDJSON 流式输出并自动遵守 `.gitignore`。

fd 94/100
$ fd

高速易用的 `find` 替代工具,默认遵守 `.gitignore` 并支持 `--color never` 输出。