---
name: onboarding-repository
description: "Choose where a new project's agent code lives (GitHub, or a repository hosted by Introspection), and connect GitHub if chosen. The first step of onboarding; onboarding-collaboration follows."
metadata:
  min-cli-version: "0.73.0"
---

# Onboarding: source

## Check

- **GitHub:** `introspection integrations repositories --type github --query "length(records)"` succeeds when the organization's GitHub App is installed, counting the repositories it reaches; it fails with "no active GitHub integration" when it isn't.
- **Registered repositories:** `introspection repositories list -o table`.

If a repository is already registered, say which in one line and go to onboarding-collaboration.

## Ask

One question with the question tool, header "Code", whatever the check found: GitHub not being connected yet is not a choice, so never pick Introspection for the owner. Two options, in this order, labelled exactly "GitHub" and "Introspection":

- **GitHub:** "Your agent's code lives in a GitHub repository you own; changes come as pull requests."
- **Introspection:** "Introspection hosts the repository for you; nothing to connect."

Don't ask whether to start from a template here: that is build's question.

## Connect

- **GitHub, not installed:** `introspection_open` with `{kind: "integration", provider: "github"}`, `wait: true`, reason "So your agent's code can live in your GitHub" (on a host without it, the dashboard, as onboarding says). Call it right after the answer, with nothing said in between. After `connected`, check the install with the command above, without saying so unless it fails.
- **GitHub, installed:** nothing more to do.
- **Introspection:** nothing to connect.
- **Later:** record nothing.

Don't pick, register or create a repository here, and don't ask about one: deploy does that when it creates the first runtime.

## Done when

The owner has a repository choice, or said later. Keep the choice for the rest of the conversation: deploy creates the agent's repository there (GitHub or Introspection) when it creates the first runtime, and until then the code lives only in the session, so never tell the owner it will live anywhere else. Go to `onboarding-collaboration`.
