Skip to content
New Kodine v2 is now available

GitHub

Run Kodine from GitHub issues and pull requests.

Kodine plugs straight into your GitHub workflow. Drop /kodine or /oc into any comment, and Kodine picks the task up inside your own GitHub Actions runner.

The hosted GitHub app backend is in early access rollout. The kodine github install flow and the kodine-agent GitHub app may not be available in all regions yet — the manual workflow setup below works today with any provider API key.


Features

  • Triage issues: Have Kodine dig into an issue and break it down for you.
  • Fix and implement: Hand a bug or feature request to Kodine. It does the work on a fresh branch and opens a PR containing the changes.
  • Secure: Everything executes on your own GitHub runners.

Installation

From a project that lives in a GitHub repository, run:

Terminal window
kodine github install

The installer guides you through adding the GitHub app, generating the workflow file, and configuring secrets.


Manual Setup

Prefer to wire everything up yourself? That works too.

  1. Install the GitHub app

    Visit github.com/apps/kodine-agent and install it on the repository you want to automate.

  2. Add the workflow

    Commit the workflow below as .github/workflows/kodine.yml in your repository. Set a suitable model and supply whatever API keys your provider needs under env.

    .github/workflows/kodine.yml
    name: kodine
    on:
    issue_comment:
    types: [created]
    pull_request_review_comment:
    types: [created]
    jobs:
    kodine:
    if: |
    contains(github.event.comment.body, '/oc') ||
    contains(github.event.comment.body, '/kodine')
    runs-on: ubuntu-latest
    permissions:
    id-token: write
    steps:
    - name: Checkout repository
    uses: actions/checkout@v6
    with:
    fetch-depth: 1
    persist-credentials: false
    - name: Run Kodine
    uses: kodine-ai/kodine/github@latest
    env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    with:
    model: anthropic/claude-sonnet-4-20250514
    # share: true
  3. Store the API keys in secrets

    Open your organization or repository settings, expand Secrets and variables in the sidebar, choose Actions, and enter each required API key.


Configuration

  • model: Which model Kodine should run, written as provider/model. This setting is required.

  • agent: Which agent handles the request. Only primary agents are valid. When omitted, Kodine falls back to default_agent from your config, or "build" if that is missing.

  • share: Controls session sharing. Public repositories default to true.

  • prompt: An optional prompt that replaces the built-in behavior, letting you shape how Kodine handles incoming requests.

  • mentions: Comma-separated trigger phrases, matched case-insensitively. Defaults to /kodine,/oc.

  • variant: A model variant selecting provider-specific reasoning effort, such as high, max, or minimal.

  • oidc_base_url: Base URL of the OIDC token exchange API. Only relevant for custom GitHub App installations. Defaults to https://api.kodine.net.

  • use_github_token: When true, Kodine authenticates with a caller-supplied GITHUB_TOKEN rather than exchanging an OIDC token for a Kodine App installation token. Defaults to false.

    This mode lets you skip installing the Kodine GitHub App entirely. Supply the token via env and grant whichever permissions your workflow requires:

    permissions:
    contents: write
    pull-requests: write
    issues: write
    steps:
    - uses: kodine-ai/kodine/github@latest
    env:
    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    with:
    model: anthropic/claude-sonnet-4-20250514
    use_github_token: true

    Because no OIDC exchange happens here, id-token: write can be omitted. A personal access token or a token from another GitHub App also works — save it as a secret and forward that secret through GITHUB_TOKEN.


Supported Events

These GitHub events can kick off a Kodine run:

Event TypeTriggered ByDetails
issue_commentA comment added to an issue or PRInclude /kodine or /oc in the body. Kodine picks up the surrounding context and can branch, open PRs, or reply.
pull_request_review_commentAn inline review comment on PR codeUse /kodine or /oc while reviewing. Kodine sees the file path, the line range, and the diff around it.
issuesAn issue being opened or editedRuns Kodine automatically when issues appear or change. The prompt input is required.
pull_requestA PR being opened or updatedRuns Kodine when PRs open, sync, or reopen — handy for automated reviews.
scheduleA cron scheduleRuns Kodine periodically. The prompt input is required. Results land in logs and PRs (no issue to reply to).
workflow_dispatchManual launch from the GitHub UIStart Kodine on demand from the Actions tab. The prompt input is required. Results land in logs and PRs.

Schedule Example

Set up a recurring Kodine run for automated maintenance tasks:

.github/workflows/kodine-scheduled.yml
name: Scheduled Kodine Task
on:
schedule:
- cron: "0 9 * * 1" # Every Monday at 9am UTC
jobs:
kodine:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Run Kodine
uses: kodine-ai/kodine/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
prompt: |
Review the codebase for any TODO comments and create a summary.
If you find issues worth addressing, open an issue to track them.

Scheduled runs have no comment to draw instructions from, so the prompt input is required. They also execute without a user context to authorize, which means the workflow itself must allow contents: write and pull-requests: write whenever Kodine should push branches or open PRs.


Pull Request Example

Let Kodine review every PR as it opens or receives updates:

.github/workflows/kodine-review.yml
name: kodine-review
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
review:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
issues: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: kodine-ai/kodine/github@latest
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
model: anthropic/claude-sonnet-4-20250514
use_github_token: true
prompt: |
Review this pull request:
- Check for code quality issues
- Look for potential bugs
- Suggest improvements

On pull_request events, Kodine falls back to a standard pull request review when no prompt is given.


Issues Triage Example

Triage incoming issues automatically. The example below skips accounts younger than 30 days as a spam guard:

.github/workflows/kodine-triage.yml
name: Issue Triage
on:
issues:
types: [opened]
jobs:
triage:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
steps:
- name: Check account age
id: check
uses: actions/github-script@v7
with:
script: |
const user = await github.rest.users.getByUsername({
username: context.payload.issue.user.login
});
const created = new Date(user.data.created_at);
const days = (Date.now() - created) / (1000 * 60 * 60 * 24);
return days >= 30;
result-encoding: string
- uses: actions/checkout@v6
if: steps.check.outputs.result == 'true'
with:
persist-credentials: false
- uses: kodine-ai/kodine/github@latest
if: steps.check.outputs.result == 'true'
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
with:
model: anthropic/claude-sonnet-4-20250514
prompt: |
Review this issue. If there's a clear fix or relevant docs:
- Provide documentation links
- Add error handling guidance for code examples
Otherwise, do not comment.

On issues events there is no comment to mine for instructions, so the prompt input is required.


Custom prompts

Supply your own prompt to shape how Kodine behaves inside a given workflow.

.github/workflows/kodine.yml
- uses: kodine-ai/kodine/github@latest
with:
model: anthropic/claude-sonnet-4-5
prompt: |
Review this pull request:
- Check for code quality issues
- Look for potential bugs
- Suggest improvements

This comes in handy when you want consistent review criteria, house style rules, or a particular area of focus for your project.


Examples

A few ways to put Kodine to work on GitHub.

  • Explain an issue

    Post this comment on a GitHub issue.

    /kodine explain this issue

    Kodine goes through the full discussion, comments included, and answers with a clear explanation.

  • Fix an issue

    Write the following on a GitHub issue:

    /kodine fix this

    Kodine then branches off, implements the fix, and opens a PR containing the work.

  • Review PRs and make changes

    Drop a comment like this onto a GitHub PR.

    Delete the attachment from S3 when the note is removed /oc

    Kodine applies the change and pushes the commit straight onto that same PR.

  • Review specific code lines

    Comment inline on specific lines from the PR’s “Files” tab. Kodine picks up the file, the line numbers, and the surrounding diff on its own, so answers stay precise.

    [Comment on specific lines in Files tab]
    /oc add error handling here

    Inline comments hand Kodine:

    • The precise file under review
    • The highlighted lines of code
    • The diff around those lines
    • Line-number details

    That means far more targeted requests, without typing out file paths or line numbers yourself.