Metadata-Version: 2.4
Name: agentcrops
Version: 0.2.1
Summary: CLI tool for automatic code bug fixing powered by LLMs
Author: se-agent-builder team
License-Expression: MIT
License-File: LICENSE
Keywords: agent,bug-fix,cli,code-analysis,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Requires-Dist: anthropic>=0.40
Requires-Dist: anyio>=4.0
Requires-Dist: claude-agent-sdk>=0.1.0
Requires-Dist: fastapi>=0.115
Requires-Dist: gitpython>=3.1
Requires-Dist: httpx>=0.27
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.0
Requires-Dist: langgraph>=0.2.60
Requires-Dist: pluggy>=1.5
Requires-Dist: pydantic>=2.0
Requires-Dist: rich>=13.0
Requires-Dist: tomli-w>=1.0
Requires-Dist: typer>=0.12
Requires-Dist: uvicorn>=0.30
Provides-Extra: analysis
Requires-Dist: tree-sitter-python>=0.22; extra == 'analysis'
Requires-Dist: tree-sitter>=0.22; extra == 'analysis'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# AgentCrops

基于 LLM 的 AI 软件工程工具，支持自动代码修复、扫描、设计、开发、测试全流程。提供 CLI 命令行和 TUI 终端界面两种使用方式。

## 安装

```bash
pip install agentcrops
```

或从源码安装：

```bash
git clone <repo-url> AgentCrops
cd AgentCrops
pip install -e ".[dev]"
```

需要 Python >= 3.11。

## 快速开始

```bash
# 设置 API Key
export ANTHROPIC_API_KEY="sk-ant-..."

# 修复单个文件中的 bug
agentcrops fix src/app.py

# 扫描目录中的潜在问题
agentcrops scan src/
```

## CLI 命令

| 命令 | 说明 |
|------|------|
| `agentcrops fix <文件>` | 分析并修复文件中的 bug（多 Agent 协作） |
| `agentcrops scan [目录]` | 扫描目录中的潜在 bug |
| `agentcrops design <需求.md>` | 根据需求生成架构设计文档 |
| `agentcrops develop <需求.md>` | 根据需求生成可运行代码 |
| `agentcrops test <目标>` | 为指定代码编写并运行测试 |
| `agentcrops build <需求.md>` | 运行完整构建流水线（设计→开发→测试） |
| `agentcrops serve` | 启动 HTTP API 服务（供 TUI 使用） |
| `agentcrops config show` | 查看当前配置 |
| `agentcrops config get <键>` | 获取指定配置项 |
| `agentcrops config set <键> <值>` | 设置配置项（仅运行时） |
| `agentcrops skill list` | 列出已注册技能 |
| `agentcrops kb list` | 列出知识库适配器 |

## TUI 终端界面（actui）

除了 CLI 命令行，AgentCrops 还提供了一个 Ink/React 构建的终端 UI，支持多 Agent 协作的可视化操作。

### 启动

```bash
# 方式 1：一键启动脚本（推荐）
./actui.sh

# 方式 2：手动分别启动
# 终端 1 — 启动后端服务
agentcrops serve

# 终端 2 — 启动 TUI
cd src/actui && npm run dev
```

### 功能

- **多 Tab 切换** — 同时与多个 Agent（Leader / Architect / Coder / Tester / Reviewer）对话
- **实时 SSE 流** — Agent 回复逐字显示，支持 tool call 可视化
- **命令面板** — 输入 `/fix`、`/scan`、`/build` 等命令直接触发工作流
- **团队面板** — 侧边栏实时显示各 Agent 状态和任务进度
- **键盘快捷键** — `Ctrl+C` 退出，`Alt+1~9` 切换 Tab，`Ctrl+B` 切换侧边栏

### 连接自定义服务端

默认连接 `http://localhost:8730`，可通过环境变量修改：

```bash
ACTUI_SERVER_URL=http://192.168.1.100:8730 npm run dev
```

## 核心特性

- **多 Agent 组队** — Leader 协调 + Architect / Coder / Tester / Reviewer 分工协作
- **多后端支持** — Claude Agent SDK、Cursor SDK 或任意 OpenAI 兼容 API
- **工具调用** — Agent 可读写文件、执行 shell、操作 git、运行测试
- **技能系统** — 可插拔分析模块（静态分析、测试生成等）
- **知识库** — 绑定团队文档、编码规范和 bug 历史以提升修复质量
- **安全保护** — Shell 沙箱、文件访问边界控制、API Key 脱敏、自动备份

## 配置

AgentCrops 使用 `.agentcrops.toml` 配置文件，优先级从高到低：

```
环境变量                  （最高）
    ↓
项目 .agentcrops.toml
    ↓
用户 ~/.agentcrops/config.toml
    ↓
内置默认值               （最低）
```

详细配置参考见 `docs/usage-guide.md`。

## 文档

- [需求说明](docs/requirements.md)
- [架构设计](docs/architecture.md)
- [使用指南](docs/usage-guide.md)

## License

MIT — 详见 [LICENSE](LICENSE)。
