More from Chirai · Chapter 24

Chirai Cody

Chirai Cody reviews a code repository the way Chirai reviews every app it builds. Each problem comes with the file and line, why it matters and the fix, and it skips style nits. It works with JavaScript and TypeScript: Next.js, React, Expo / React Native, Node and Supabase.

On chirai.dev

  1. Sign in and open Cody in the sidebar (chirai.dev/cody).
  2. Paste a GitHub repository address (and a branch if you like). For a private repository, add a GitHub token: it's used once for the copy and never stored.
  3. Press Review. A typical app takes 1–3 minutes, including the AI review.
  4. Read the findings, filter by errors, warnings or notes, and copy each fix.

What it finds

  • Secrets: live Stripe, AWS, OpenAI, Anthropic or GitHub keys, private keys, a committed .env, a Supabase service_role key, and server secrets used in client or app code.
  • Database: tables with no row-level security, and policies that let anyone, or any signed-in user, change rows.
  • Build-breakers: useSearchParams without Suspense, metadata in client components, hooks in server pages, imports of files that don't exist, syntax errors.
  • Dead links: links and redirects to pages or screens that don't exist (Next.js and expo-router).
  • Phone crashes: text outside <Text> in React Native.
  • Unsafe code: shell or SQL built from variables, unsanitised HTML, eval, calls to localhost.
  • Accessibility: images without alt text, icon-only buttons without a label.
  • AI review: real bugs only (wrong results, missing ownership checks, race conditions, data loss), each checked to be on a real line.

From a terminal

npx chirai-cody .                     # review this folder
npx chirai-cody . --ai                # + AI review (ANTHROPIC_API_KEY, or CODY_AI_BASE_URL + CODY_AI_KEY)
npx chirai-cody . --diff origin/main  # only what this branch changed
npx chirai-cody . --format html --out cody.html

On every pull request

Add .github/workflows/cody.yml:

name: Chirai Cody
on: pull_request
permissions: { contents: read, pull-requests: write }
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with: { fetch-depth: 0 }
      - run: npx --yes chirai-cody@1 . --diff origin/${{ github.base_ref }} --github
        env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }

Cody comments on the changed lines and posts a summary with the score. A change with errors fails the check (--fail-on warn or never to change that).