关于这个工具
Laravel Tackle 是一个面向 Laravel 的 AI 代理框架,提供能够阅读代码库、运行测试、审查 PR、升级依赖并修复失败任务的编码代理,通过 Composer 安装。
主要能力
- 编码代理:实现
CodingAgent的代理接收提示、调用工具并返回结果。 - 命令集:
ai:code、ai:upgrade、ai:eval、ai:explain、ai:fix、ai:onboard、ai:respond、ai:review、ai:run、ai:test。 - 依赖升级:
ai:upgrade在隔离的 worktree 中审计、规划、解决、修复并验证 Composer 依赖的主版本升级,最终以 PR 形式交付。 - 代码审查:
ai:review是一个只读代理,审查 git diff 并按严重级别呈现真实问题。 - 测试生成:
ai:test为任意类或方法生成 Pest 测试文件。 - 问题修复:
ai:fix支持粘贴异常、指向 Sentry 问题(--sentry=ID)或 GitHub 问题(--issue=N),代理诊断、修补并验证修复。 - CI 与定时任务:
ai:run在无终端环境下运行同一代理,返回 JSON 结果和退出码。 - PR 交互:
ai:respond处理 PR 上的/tackle评论,应用请求的更改、推送到 PR 分支并在线程中回复。 - 新开发者入职:
ai:onboard提供只读的代码库导览并回答问题。 - 基准测试:
ai:eval针对预置 bug 对代理进行基准测试,衡量修复率、误修复率、token 和成本。
架构与安全
- 基于
laravel/ai构建,与提供商无关:Tackle 可在任何支持工具调用的laravel/ai提供商上运行。 - 所有代理都通过相同的工具基础设施和安全层运行。
NetworkExfiltrationGuard标记出站 HTTP、curl ... | sh、外部 curl/wget 等外泄传输,模式为 block(默认)、confirm 或 off。
使用与配置
- 通过 Composer 安装。
- 发布配置:
php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"。 - 运行
php artisan ai:code并输入一个小测试任务以确认连接。 - 升级会话可能较长,建议在开始前将
AI_CODE_BUDGET提高到默认的 $1 以上。 - 要求
laravel/ai >=0.1 <0.11;laravel/ai 0.1.x本身要求 PHP ^8.4,在 PHP 8.3 上 Composer 将解析 0.2 或更新版本。
开源与商业化
- 开源,免费。
- 学习曲线:中等。
功能与使用场景
[ ] Publish the laravel/ai config: php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"[ ] Run php artisan ai:code and type a small test task to confirm everything connects.4' } - run: composer install --no-interaction --no-scripts - run: | php artisan ai:upgrade pestphp/pest \ --headless --output=json --no-worktree \ --ref-issue=${{ githuba human stays the trigger — read it and run php artisan ai:upgrade <package> to turn it into a PR, or wire up the unattended mode belowAgentsClasses implementing CodingAgent that receive a prompt, call tools, and return a resultai:evalBenchmarks the agent against seeded bugs — fix rate, false-fix rate, tokens, costai:explainExplains what a file, class, or method does in plain Englishai:fixA focused fix session: paste an exception, point it at a Sentry issue (--sentry=ID) or GitHub issue (--issue=N), and the agent diagnoses, patches, and verifies the fixai:onboardOnboards a new developer: a guided, read-only tour of the codebase — what it is, how it's put together, how to run it, where to be careful — then answers their questionsai:respondActs on a /tackle comment left on a pull request: applies the requested change, pushes it to the PR branch, and replies in the threadai:reviewA read-only agent that reviews git diffs and surfaces real issues with severity levelsai:runThe same agent with no terminal attached: one task, a JSON result, and an exit code — for CI and cron