關於這個工具
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