
# ITARCHECK
### 标记代码、数据表和文档中潜在的 ITAR/EAR 出口管制条款及 USML 类别。

[](https://pypi.org/project/cognis-itarcheck/) [](https://github.com/cognis-digital/itarcheck/actions) [](LICENSE) [](https://github.com/cognis-digital)
*Cognis Neural Suite 的一部分。*
```
pip install cognis-itarcheck
itarcheck scan . # → prioritized findings in seconds
```
## 🔎 示例输出
工具的真实、可复现输出 —— 离线运行:
```
$ itarcheck-emit --version
itarcheck 0.1.0
```
```
$ itarcheck-emit --help
usage: itarcheck [-h] [--version] {scan,categories} ...
Flag potential ITAR/EAR export-controlled terms and USML categories in code,
datasheets, and docs (compliance screening).
positional arguments:
{scan,categories}
scan scan a file or directory for control indicators
categories list USML categories used for classification
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
**示例结果格式** _(仅为说明用的数值 —— 请在您自己的数据上运行以获取真实结果):_
```
{
"findings": [
{
"id": "1234567890",
"title": "Suspicious Network Traffic",
"description": "Potential malicious activity detected on port 443.",
"categories": ["Network", "Security"],
"created_at": "2023-02-20T14:30:00Z"
},
{
"id": "2345678901",
"title": "Unusual System Logins",
"description": "Multiple failed login attempts from unknown IP addresses.",
"categories": ["System", "Security"],
"created_at": "2023-02-20T14:35:00Z"
}
]
}
```
## 用法 —— 分步说明
1. **安装**筛查工具:
pip install cognis-itarcheck
2. **扫描代码、数据表或文档**,查找 ITAR/EAR 出口管制指标及 USML 类别:
itarcheck scan ./design-docs --fail-on high
3. **输出 JSON**(包含用于 pipeline 的 `gate_failed` 和 `fail_on`),并使用可重复的 `--ext` 添加额外扩展名:
itarcheck scan ./hdl --ext .vhd --format json | jq '.gate_failed'
4. **列出**引擎映射的 USML 类别(22 CFR 121.1):
itarcheck categories
5. **拦截构建。** 当结果达到或超过 `--fail-on` 时退出并返回 `1`,否则返回 `0`。这是一种筛查辅助工具,而非法律裁定:
itarcheck scan ./src --fail-on medium || echo 'review with an empowered official'
## 目录
- [为什么选择 itarcheck?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比](#how-it-compares) · [集成](#integrations) · [随处安装](#install-anywhere) · [相关项目](#related) · [贡献](#contributing)
## 为什么选择 itarcheck?
标记代码、数据表和文档中潜在的 ITAR/EAR 出口管制条款及 USML 类别 —— 而无需搭建重型基础设施。
`itarcheck` 是单一用途、可脚本化且可自托管的:将其指向目标,即可使用您工作流中已有的格式(table · JSON · SARIF)获取优先排序的结果,以此为 CI 设置拦截门控,并允许 agent 通过 MCP 驱动它。
## 功能
- ✅ 扫描文本
- ✅ 扫描路径
- ✅ 摘要总结
- ✅ 超出阈值
- ✅ 可在 Linux/macOS/Windows · Docker · devcontainer 上运行
- ✅ 提供 Python、JavaScript、Go 和 Rust 版本(`ports/`)
## 快速开始
```
pip install cognis-itarcheck
itarcheck --version
itarcheck scan . # scan current project
itarcheck scan . --format json # machine-readable
itarcheck scan . --fail-on high # CI gate (non-zero exit)
```
## 示例
```
$ itarcheck scan .
[HIGH ] ITA-001 example finding (./src/app.py)
[MEDIUM ] ITA-002 another signal (./config.yaml)
2 findings · risk score 5 · 38ms
```
## 架构
```
flowchart LR
IN[capture / scan] --> P[itarcheck
parse + map]
P --> OUT[report]
```
## 从任何 AI 技术栈中使用
`itarcheck` 可与所有流行的 AI 使用方式互操作:
- **MCP server** — `itarcheck mcp` (Claude Desktop, Cursor, Cognis.Studio, [uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet))
- **OpenAI-compatible / JSON** — 通过管道将 `itarcheck scan . --format json` 传给任何 agent 或 LLM
- **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具
- **CI / 脚本** — 为非 AI pipeline 提供 exit code + SARIF
## 对比
| | **Cognis itarcheck** | 典型工具 |
|---|:---:|:---:|
| 可自托管,无需账户 | ✅ | 视情况而定 |
| 单一命令,零配置 | ✅ | ⚠️ |
| 用于 CI 的 JSON + SARIF | ✅ | 视情况而定 |
| MCP 原生 (AI agent) | ✅ | ❌ |
| 多语言移植版本 (JS/Go/Rust) | ✅ | ❌ |
| 开源许可证 | ✅ COCL | 视情况而定 |
## 集成
可通过管道融入您的技术栈:用于代码扫描的 **SARIF**,用于任何场景的 **JSON**,用于 AI agent 的 **MCP server**(`itarcheck mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。详见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
## 安装 —— 各种方式,各个平台
```
pip install "git+https://github.com/cognis-digital/itarcheck.git" # pip (works today)
pipx install "git+https://github.com/cognis-digital/itarcheck.git" # isolated CLI
uv tool install "git+https://github.com/cognis-digital/itarcheck.git" # uv
pip install cognis-itarcheck # PyPI (when published)
docker run --rm ghcr.io/cognis-digital/itarcheck:latest --help # Docker
brew install cognis-digital/tap/itarcheck # Homebrew tap
curl -fsSL https://raw.githubusercontent.com/cognis-digital/itarcheck/main/install.sh | sh
```
| Linux | macOS | Windows | Docker | Cloud |
|---|---|---|---|---|
| `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/itarcheck` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
## 相关 Cognis 工具
**探索套件 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
## 互操作性
`{}` 与 300+ 工具的 Cognis 套件无缝组合 —— JSON 输入/输出以及共享的
OpenAI 兼容 `/v1` 主干。请参阅 **[INTEROP.md](INTEROP.md)** 获取
套件映射表、组合模式和参考技术栈。
## 许可证
源代码可见,基于 **Cognis Open Collaboration License (COCL) v1.0** —— 个人、内部评估、研究和教育用途免费;**商业/生产用途需要许可证** (licensing@cognis.digital)。详见 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 170+ 工具之一 · Making Tomorrow Better Today