scanaislop/homebrew-tap
GitHub: scanaislop/homebrew-tap
一款静态代码分析工具,专门检测并修复 AI 编程助手在代码中留下的冗余注释、吞掉异常、类型滥用等质量问题。
Stars: 1 | Forks: 0
# Homebrew 版 aislop
**揪出 AI 编程助手在你的代码中留下的瑕疵。**
[](https://github.com/scanaislop/homebrew-tap) [](https://www.npmjs.com/package/aislop) [](https://pepy.tech/project/aislop) [](https://github.com/scanaislop/aislop) [](https://github.com/scanaislop/homebrew-tap/actions/workflows/ci.yml) [](https://scanaislop.com/scanaislop/aislop) [](https://opensource.org/licenses/MIT) [](https://discord.gg/Mzz4A6mfj6)
Claude Code、Cursor、Codex 和 OpenCode 留下的这些痕迹:在自解释代码上方的叙述性注释、被吞掉的异常、`as any` 类型断言、幻觉导入、重复的辅助函数、死代码、todo 占位符、超长函数。测试通过了,Lint 也通过了。但代码依然在腐坏。
[aislop](https://github.com/scanaislop/aislop) 负责揪出它们。包含 8 种目标语言(TypeScript、JavaScript、Expo / React Native、Python、Go、Rust、Ruby、PHP)的 50 多条规则。为每次更改打 0–100 的评分。亚秒级响应。确定性运行——运行时不依赖 LLM,相同的代码输入,得到相同的评分输出。采用 MIT 许可证,提供免费的 CLI。
## 安装说明
```
brew install scanaislop/tap/aislop
```
这行单行命令通过一步操作即可添加 tap 仓库并完成安装。其完整等效写法如下:
```
brew tap scanaislop/tap
brew install aislop
```
接着扫描任意项目:
```
aislop scan
```
## 首次运行
在仓库的根目录下执行:
```
aislop scan
```
你会得到一个 0–100 的评分和一份问题列表。常见的后续操作:
```
aislop fix # auto-fix safe issues
aislop fix -f # aggressive fixes (deps, unused files)
aislop ci # CI-friendly JSON output and exit code
aislop hook install --claude # install a per-edit agent hook
aislop rules # see every rule
aislop doctor # check local tool availability
```
## 安装内容
此 tap 提供了两个命令:
- `aislop` —— CLI 工具
- `aislop-mcp` —— 用于支持 [Model Context Protocol](#mcp-server) 的工具的 MCP server
如果尚未安装 Node.js,Homebrew 会将其作为运行时依赖自动安装,因此你无需进行其他额外配置。运行 `aislop doctor` 即可确认所有引擎都能在你的机器上正常运行。
## 移交给你的 Agent
当自动修复无法解决某个问题时,请将剩余的检查结果连同完整上下文一起交由你的编程 agent 处理:
```
aislop fix --claude # Claude Code
aislop fix --codex # Codex CLI
aislop fix --cursor # Cursor (copies to clipboard)
aislop fix --gemini # Gemini CLI
aislop fix --prompt # print an agent-agnostic prompt
```
安装一个 hook,以便在每次编辑后自动获取反馈:
```
aislop hook install --claude # Claude Code
aislop hook install # pick agents interactively
```
## MCP server
为 Claude Desktop、Cursor 或 Codex 将 `aislop` 暴露为 MCP 工具(`aislop_scan`、`aislop_fix`、`aislop_why`、`aislop_baseline`):
```
{
"mcpServers": {
"aislop": {
"command": "aislop-mcp"
}
}
}
```
## CI
```
aislop scan --staged # staged files before commit
aislop ci # JSON output, exits 1 if score < threshold
aislop scan --sarif > aislop.sarif # SARIF 2.1.0 for GitHub code scanning
```
在 `.aislop/config.yml` 中设置最低分数要求:
```
ci:
failBelow: 70
```
了解更多:[CI/CD 文档](https://scanaislop.com/docs/ci)。
## 配置
在 `.aislop/config.yml` 中调整规则、严重级别和排除的路径:
```
exclude:
- "**/*.test.ts"
- src/generated
rules:
ai-slop/narrative-comment: warning # error | warning | off
```
运行 `aislop init` 生成配置文件。完整参考:[配置文档](https://scanaislop.com/docs/configuration)。
## 升级
```
brew update
brew upgrade aislop
```
检查是否有更新的版本可用:
```
aislop upgrade
```
## 示例
```
aislop scan --changes # only changed files from HEAD
aislop scan --staged # staged files before commit
aislop scan --sarif > aislop.sarif # SARIF for GitHub code scanning
aislop badge # generate a public score badge
```
## 故障排除
如果 Homebrew 提示 `/opt/homebrew/bin/aislop` 已存在,说明该命令已被其他安装方式接管。请选择单一的安装源,或者让 Homebrew 覆盖现有的链接:
```
brew link --overwrite aislop
```
查看 Homebrew 安装的内容:
```
brew info scanaislop/tap/aislop
brew list scanaislop/tap/aislop
```
如果某个版本看起来有问题,请重新安装:
```
brew reinstall aislop
```
## 其他安装方式
同样的 CLI 也可以通过 npm、Yarn、Bun 和 PyPI 安装:
```
brew install scanaislop/tap/aislop # Homebrew (this tap)
npm install -g aislop # npm
yarn dlx aislop scan # Yarn (no install)
bun add -g aislop # Bun
pipx install aislop # Python
```
Homebrew formula 会将 Ruff 和 golangci-lint 作为运行时依赖安装,从而在不使用单独工具安装命令的情况下,确保 Python 和 Go 的 lint 覆盖范围不受影响。
如需了解 npm 系列的安装选项,请参阅 [PyPI 包](https://pypi.org/project/aislop/) 和[主项目 README](https://github.com/scanaislop/aislop)。
## 团队版
[scanaislop](https://scanaislop.com) 是专为团队打造的托管平台:提供带有评分阈值的 PR 门禁、组织 → 团队 → 项目的标准层级体系、数据看板以及 agent 行为归因。使用相同的引擎和评分标准。该 CLI 遵循 MIT 许可证,且完全免费。
## 链接
- Discord 社区:https://discord.gg/Mzz4A6mfj6
- 主项目:https://github.com/scanaislop/aislop
- 文档:https://scanaislop.com/docs
- 问题反馈:https://github.com/scanaislop/aislop/issues
- Homebrew tap:https://github.com/scanaislop/homebrew-tap
- PyPI 包:https://pypi.org/project/aislop/
标签:AI辅助开发, Apache Flink, LNA, MITM代理, SOC Prime, 代码规范检查, 可视化界面, 安全专业人员, 开发工具, 日志审计, 逆向工具, 错误基检测, 静态代码分析