Quick start

This page takes you from nothing to a first session on one of your own repositories: kōjō on one machine, connected to GitHub, with a model you pay for. At the end you have a draft pull request that an agent wrote and that the goal critic checked.

It is the short version of the single-machine install. Install is the long one: every prerequisite, Kubernetes with Helm, GitLab, Forgejo and Slack.

To look at kōjō without an account or a model key, use the local development stack instead. It needs a checkout of the repository and runs on a throwaway forge with recorded model answers.

What you need

  • A machine with Docker and Docker Sandboxes. macOS on Apple silicon, or Linux with KVM. Docker runs Postgres. Docker Sandboxes (sbx, 0.48.0 or newer) runs every session in its own microVM; Docker’s documentation has the install steps.
  • A model provider key. The steps below use Anthropic. OpenAI, Google AI, OpenRouter, Ollama and OpenAI-compatible gateways are on the Models page.
  • A GitHub repository you administer, with a protected default branch. kōjō refuses to enable a repository whose default branch is not protected. For GitLab, Forgejo or Bitbucket, follow GitLab, Forgejo or Bitbucket at step 3.
  • An address for kōjō, such as https://kojo.example.com. GitHub delivers mentions in issues and pull requests to it as webhooks, and step 3 registers it with the GitHub App. Nothing has to answer there yet: kojo run needs no inbound connection, so everything on this page except the mention works before the address does. Single VM with Compose shows a reverse proxy for it.

1. Install the binary

curl -fsSL https://xavidop.github.io/kojo/install.sh | sh -s -- --compose-dir kojo
cd kojo

The installer downloads the kojo binary of the latest release, checks its SHA-256, and installs it into /usr/local/bin, or into ~/.local/bin when it cannot write there. With --compose-dir kojo it also puts the files of the single-machine install into the directory kojo: docker-compose.yml (Postgres), kojo.yaml and .env.example. It tells you when sbx or Docker is missing; it installs neither.

2. Configure it

Secrets go into .env, which Docker Compose and kōjō both read:

cp .env.example .env && chmod 600 .env

Set these in .env, as plain NAME=value lines without quotes:

Variable Value
POSTGRES_PASSWORD Letters and digits only. openssl rand -hex 24
KOJO_SESSION_SECRET openssl rand -hex 32
KOJO_ADMIN_TOKEN Your API token for the CLI, 16 characters or more. openssl rand -hex 24
ANTHROPIC_API_KEY The provider key.
KOJO_PUBLIC_URL The address GitHub and browsers reach kōjō at.

kojo.yaml is the deployment config. It holds no secret; it names them as ${VARIABLES}. This is the file as it comes, without its comments, and it is enough to start:

server:
  public_url: "${KOJO_PUBLIC_URL}"
  listen: "127.0.0.1:8080"
  auth:
    session_secret: "${KOJO_SESSION_SECRET}"
    tokens:
      - name: admin
        token: "${KOJO_ADMIN_TOKEN}"
        role: admin

database:
  url: "postgres://kojo:${POSTGRES_PASSWORD}@127.0.0.1:5432/kojo?sslmode=disable"

models:
  gateway: embedded
  tiers:
    fast:
      provider: anthropic
      model: claude-haiku-5-5
    strong:
      provider: anthropic
      model: claude-opus-5-5
  budgets:
    per_session_usd: 10
    per_day_usd: 200

sandbox:
  driver: sbx

defaults:
  merge_policy: draft_only

Skills name a tier, fast or strong, and this file maps each tier to a model. The budgets stop a session at 10 USD and the whole install at 200 USD a day, but only for tiers that have a price: kōjō ships no price table, so add one as Models describes. The kojo.yaml reference lists every key.

3. Create the GitHub App

kōjō acts on GitHub as a GitHub App. One command registers it with the permissions and webhook events kōjō needs:

kojo setup github --public-url https://kojo.example.com

Pass the address you set as KOJO_PUBLIC_URL: GitHub will deliver webhooks to /webhooks/github under it. Add --org acme to create the app in an organization instead of your account, and --name to call it something other than kojo: the name is what people mention, and app names are unique on GitHub.

The command prints an address on your machine. Open it in a browser on the same machine and confirm the app on GitHub. The command then writes secrets/github-app.pem and secrets/github-app.env, and prints a forges.github block and the address where the app is installed on repositories. Three things are left to you:

  1. Add the app’s ID and webhook secret to .env:

    cat secrets/github-app.env >> .env
  2. In kojo.yaml, uncomment the forges block and set private_key_file to the path the command printed:

    forges:
      github:
        app_id: "${GITHUB_APP_ID}"
        private_key_file: /home/you/kojo/secrets/github-app.pem
        webhook_secret: "${GITHUB_WEBHOOK_SECRET}"
  3. Install the app on the repository, at the address the command printed.

The command needs no kojo.yaml and no running server. When the host has no browser, run it on your workstation and copy the secrets directory over. Install lists the permissions the app asks for.

4. Start it

Sign in to Docker Sandboxes and make deny-all its network policy. Both are needed once, as the user that runs kōjō:

sbx login
sbx policy init deny-all

Start Postgres, load .env into the shell, check the config and start kōjō:

docker compose up -d
set -a; . ./.env; set +a
kojo config validate -f kojo.yaml
kojo serve -f kojo.yaml

kojo serve applies the database migrations and stays in the foreground. Open a second terminal in the same directory for the rest of this page:

set -a; . ./.env; set +a
export KOJO_TOKEN="$KOJO_ADMIN_TOKEN"
curl -fsS http://127.0.0.1:8080/readyz

The CLI talks to http://localhost:8080 unless KOJO_SERVER says otherwise, and sends KOJO_TOKEN as its API token.

5. Enable a repository

kōjō only works on repositories that are enabled. The list is empty on a new install. Write it to a file, repos.yaml, with your repository as github/owner/name:

version: 1
objects:
  - scope: org
    object: repos
    content:
      repos:
        github/acme/api:
          enabled: true
kojo config apply -i repos.yaml

Its last line is 1 of 1 object(s) applied. When the default branch is not protected, it refuses and names the branch: protect it on GitHub and apply again.

The file replaces the whole list, which is what a new install needs. Install shows how to change a list that already has entries, and the other keys of an entry.

6. Run kojo doctor

kojo doctor --remote

kojo doctor asks the running server to check itself: the database, the sandbox driver and its isolation, the GitHub App’s permissions, branch protection, the model tiers and the budgets. It also starts a sandbox with an empty allowlist and has it try to reach the internet, which must fail.

Each line is ok, warn, FAIL or skip. A FAIL makes the command exit 1: fix it before you go on. A new install has warnings, for example for a tier without a price and for sign-in without OIDC. Install lists every check.

7. Ask for a first piece of work

Pick something small in your repository: a missing flag, a small bug, an open pull request to review.

From the CLI

Say what you want in plain words. The orchestrator chooses the skills:

kojo run --repo github/acme/api "add a --json flag to the export command, with a test"

kojo run prints the steps as they happen, then the summary, the goal critic’s report and the pull request. Add --dry-run to see the diff without a branch or a pull request on GitHub.

The same command starts other kinds of work. --issue and --pr say what the request is about, and --skill runs exactly one skill:

kojo run --repo github/acme/api --issue 412 "fix this"
kojo run --repo github/acme/api --pr 418 --skill review-pr
kojo run --repo github/acme/api --skill security-audit --dry-run "audit the auth package"

From a mention

Comment on an issue or a pull request and mention the app:

@kojo build this

kojo is the name of your GitHub App. The rest of the comment is the request: @kojo fix this on a bug report, @kojo review this on a pull request. The author of the comment needs write access to the repository, and GitHub must be able to reach kōjō’s address. Who may trigger what has the rules.

8. Follow the session

Every request becomes a session. List them, then read one by its ID, the ses_... value that list and kojo run print:

kojo sessions list
SESSION=ses_...
kojo sessions logs "$SESSION" --follow
kojo sessions show "$SESSION"
  • list shows each session’s status, repository, trigger, cost and title.
  • logs prints the steps: each skill, the files it read and edited, the commands that ran in the sandbox and the goal critic’s verdict. --follow keeps printing until the session ends.
  • show prints the result: the summary, the goal critic’s report with the outcome of each check, the risk, and the address of the pull request.

Then open the pull request on GitHub. It is a draft from a kojo/ branch onto the default branch, with one commit. Its description carries the summary, the goal critic’s report and the risk. When the work fell short of its acceptance criteria, the pull request is still opened as a draft, and the description says what was not met. Nothing is merged: draft_only is the default merge policy.

A session that changes no code opens no pull request. A review, for example, is one comment on the pull request it is about.

Local stacks has the output of these commands, captured from a session on the development stack.

The dashboard shows the same sessions, with a replay of every step. It is served at kōjō’s address, and signing in to it needs OIDC (server.auth.oidc in kojo.yaml), which this page does not set up. API tokens work for the CLI, the API and MCP, not in a browser.

To stop, press Ctrl-C in the terminal of kojo serve, then run docker compose down. The database stays in its volume.

Next steps

  • Single VM with Compose: run kōjō as a systemd service, put TLS in front of it and back up Postgres.
  • Install: sign-in for the dashboard with OIDC, the Slack app, and Kubernetes with Helm.
  • Built-in skills: the fourteen skills in the binary and what each one is held to.
  • Skills: define what “done” means for your repository in .factory/.
  • Automatic triggers: run a skill on every new issue or pull request, without a mention.
  • Merge policy: ask a human in Slack, or merge low-risk changes.
  • Concepts: what happens between a request and a pull request.
Scroll to move. + - zoom, 0 fit, Esc close.100%