Skip to content

AI Build Diagnosis

Native build logs are long. When an iOS (Xcode / Fastlane) or Android (Gradle / Fastlane) build fails, Capgo can run the log through an AI build engineer that pinpoints what went wrong and how to fix it — so you don’t have to scroll thousands of lines yourself.

Add --ai-analytics to your build:

Terminal window
bunx @capgo/cli@latest build request com.example.app --platform android --ai-analytics

The diagnosis only kicks in when a build fails — successful builds are untouched.

What happens on a failed build depends on where you run it and whether you passed the flag:

Environment--ai-analyticsBehavior
Interactive terminalyesDiagnoses the failure immediately
Interactive terminalnoAsks first, then offers the diagnosis
CI / non-interactiveyesRuns automatically and prints the diagnosis to stderr
CI / non-interactivenoSkipped — nothing is sent

So in CI you must opt in with --ai-analytics; in a terminal you’re always asked first unless the flag pre-opts you in.

A short, focused markdown report:

  • Likely cause — one sentence.
  • Evidence — the 1–3 most relevant lines quoted from your log.
  • Suggested fix — numbered steps to change in your project (signing config, a missing capability, a Gradle or CocoaPods issue, a plugin conflict, …).

If the logs are ambiguous it says so and lists the top hypotheses, rather than inventing an error that isn’t there.

AI diagnosis is opt-in — nothing is sent unless you pass --ai-analytics or confirm the prompt.

  • Capgo AI (default): your build log is trimmed and sent to Capgo’s analysis endpoint (which runs on Cloudflare Workers AI) just long enough to produce the diagnosis. Build logs aren’t part of normal storage — they stream to your terminal during the build.
  • Keep logs on your machine: in an interactive terminal you can instead have the CLI write a local prompt file — the same diagnosis instructions plus your log — that you paste into your own LLM. Your logs never leave your machine.