Git AI
Team Usage

Build DIY Dashboards

Track AI authorship across your repos without the Git AI platform — install over MDM, run the CI actions, and build your own dashboards from stats and raw git notes.

You don't have to run the Git AI platform to attribute AI code. Every Git AI install writes attribution to git notes locally, so with an MDM rollout and the CI actions you can account for every line of AI code in your repositories and build simple AI-usage dashboards on top of that data.

What you give up by going DIY

The platform joins your git notes to source control and adds the data that only exists server-side: agent sessions, per-PR metrics (squash- and rebase-aware), token usage and model cost, and prompt analysis. It also removes the per-repo setup below — telemetry flows through webhooks with no CI changes. Going DIY, you get accurate per-line authorship in git, but you assemble the rest yourself. See the data schema for the full picture.

1. Install Git AI over MDM (no telemetry key)

Roll the extension out across your fleet with your MDM tool, but omit the telemetry write-key. Without a key, nothing is sent to a Git AI instance — attribution stays local in each repo's git notes, which is exactly what you want for a self-managed setup.

Use the MDM configurator to generate your install scripts, and leave the telemetry key out of the config.

2. Set up the Git AI CI actions in every repo

The GitHub, GitLab, and BitBucket GUIs offer "Squash and Merge" and "Rebase and Merge". Because the SCM servers aren't running Git AI, authorship is not preserved through these operations the way it is locally. The CI actions rewrite the authorship logs after a squash or rebase merge so your notes stay accurate.

You'll need to add the action to each repository you want to track.

GitHub Actions

The GitHub Actions workflow runs when pull requests are merged, detects squash and rebase merges, and rewrites authorship accordingly.

Install it in your repository:

git ai ci github install

This creates .github/workflows/git-ai.yaml:

  • Trigger: Runs on pull request close events
  • Permissions: Requires contents: write to push authorship notes
  • Actions:
    1. Installs git-ai from the official install script
    2. Configures git user as github-actions[bot]
    3. Runs git ai ci github run to process the merge
.github/workflows/git-ai.yaml
name: Git AI

on:
  pull_request:
    types: [closed]

jobs:
  git-ai:
    if: github.event.pull_request.merged == true
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - name: Install git-ai
        run: |
          curl -fsSL https://usegitai.com/install.sh | bash
          echo "$HOME/.git-ai/bin" >> $GITHUB_PATH
      - name: Run git-ai
        id: run-git-ai
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          git config --global user.name "github-actions[bot]"
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git ai ci github run

GitLab CI

The GitLab CI job runs when commits are pushed to your default branch, detects squash and rebase merges, and rewrites authorship accordingly.

Generate the snippet to copy into your .gitlab-ci.yml:

git ai ci gitlab install

The default CI_JOB_TOKEN often lacks API query permissions. You'll need to create a dedicated access token.

Create an access token:

  1. Go to Settings → Access tokens → Add new token

    • Name: git-ai
    • Role: Maintainer
    • Scopes: api, write_repository (both required)
  2. Go to Settings → CI/CD → Variables → Add variable

    • Key: GITLAB_TOKEN
    • Value: paste your token
    • Check Masked

Configuration:

  • Trigger: Runs on push events to the default branch
  • Permissions: Requires api and write_repository scopes
  • Actions:
    1. Installs git-ai from the official install script
    2. Configures git user as gitlab-ci[bot]
    3. Runs git ai ci gitlab run to process the merge
.gitlab-ci.yml
git-ai:
  stage: build
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
      when: always
  script:
    - curl -fsSL https://usegitai.com/install.sh | bash
    - export PATH="$HOME/.git-ai/bin:$PATH"
    - git config --global user.name "gitlab-ci[bot]"
    - git config --global user.email "gitlab-ci[bot]@users.noreply.gitlab.com"
    - git ai ci gitlab run

BitBucket Pipelines & Azure Repos

Not currently supported. PRs welcome on GitHub.

3. Build your dashboards

With attribution living in git, you have two ways to get the numbers out.

git ai stats gives you AI authorship stats for a commit or a linear range, with a --json flag for machine-readable output you can pipe into whatever you're building:

git ai stats <start>..<end> --json

It returns human_additions, ai_additions, ai_accepted, a per-tool::model breakdown, and the raw git diff baseline. See Commit Stats for every field. Run it in a scheduled job across your repos and write the output to a table your BI tool reads.

Read the git notes raw when you need data stats doesn't expose. Attribution lives under refs/notes/ai (see how Git AI works), and git ai blame --json returns the per-session objects — agent, model, human author, accepted vs. overridden lines — behind each line range:

git ai blame <file> --json

The data schema describes the shape of this data. Everything keyed to commits and lines is available locally; the session-, PR-, and cost-level joins are what the platform adds on top.