> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-agui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Run Coda locally and point it at a GitHub repo.

This page gets Coda running locally and connected to a GitHub repo.

## Prerequisites

* Docker Desktop ([install](https://docs.docker.com/desktop/))
* OpenAI API key ([get one](https://platform.openai.com/api-keys))
* GitHub account (for the Personal Access Token in Step 2)

<Tabs>
  <Tab title="Manual">
    <Steps>
      <Step title="Clone Coda">
        Click **Use this template** on the [Coda repo](https://github.com/agno-agi/coda) to create your own, then clone it. Or clone directly:

        ```bash theme={null}
        git clone https://github.com/agno-agi/coda && cd coda
        ```
      </Step>

      <Step title="Configure API keys">
        ```bash theme={null}
        cp example.env .env
        ```

        Set `OPENAI_API_KEY` and `GITHUB_ACCESS_TOKEN` in `.env`.

        The GitHub token must be a **Fine-grained Personal Access Token** with these permissions on the repos you want Coda to work with:

        | Permission    | Access         |
        | ------------- | -------------- |
        | Contents      | Read and write |
        | Pull requests | Read and write |
        | Issues        | Read and write |
        | Metadata      | Read-only      |

        Full setup: [GITHUB\_ACCESS.md](https://github.com/agno-agi/coda/blob/main/docs/GITHUB_ACCESS.md). Use a Fine-grained token. Classic PATs lack the scoping Coda relies on.
      </Step>

      <Step title="Tell Coda which repos to learn">
        Edit `repos.yaml`:

        ```yaml theme={null}
        repos:
          - url: https://github.com/your-org/your-repo
            branch: main
        ```

        Repos in `repos.yaml` must also be granted in your GitHub token's repository selection. If you list a repo Coda can't access, the clone fails silently.

        <Tip>
          For your first run, point Coda at the [agno repo](https://github.com/agno-agi/agno). It gives you something concrete to ask questions about while you get set up.
        </Tip>
      </Step>

      <Step title="Start Coda">
        ```bash theme={null}
        docker compose up -d --build
        ```

        First run pulls the base image, builds Coda, and clones the repos in `repos.yaml` into `/repos/`. Takes a minute or two.
      </Step>

      <Step title="Verify it's running">
        ```bash theme={null}
        curl http://localhost:8000/health
        ```

        Expect `{"status":"ok"}`. Connection refused means the container is still starting. Check `docker compose logs -f coda-api` and wait for the Agno banner.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Agentic">
    If you have a coding agent like [Claude Code](https://claude.com/product/claude-code) or [Codex](https://openai.com/index/introducing-codex/), paste this prompt into a fresh session in an empty directory. The agent clones the repo, configures it, starts Coda, and verifies it's running.

    The prompt below never asks the agent to read or transmit your API keys. The agent opens `.env` and `repos.yaml` for you to edit, then waits for you to confirm before continuing.

    ```
    Set up Coda locally for me.

    Steps:
    1. Clone https://github.com/agno-agi/coda into the current directory and cd into it.
    2. Copy example.env to .env. Open .env in the user's editor (or print the path and tell them to open it). Tell the user: "Set OPENAI_API_KEY and GITHUB_ACCESS_TOKEN in .env, save the file, then tell me to continue. The GitHub token must be a Fine-grained PAT with Contents R/W, Pull requests R/W, Issues R/W, Metadata R on the repos you want Coda to know about. See docs/GITHUB_ACCESS.md for the walkthrough." Wait for confirmation before proceeding. Do not ask the user to paste either key into this chat. Do not read the values from .env or print them at any point.
    3. Open repos.yaml in the user's editor. Tell the user: "Add the GitHub repos you want Coda to learn (URL and branch). For your first run, you can leave the default agno repo. Save the file, then tell me to continue." Wait for confirmation.
    4. Check that Docker Desktop is running (`docker info`). If not, tell me to start it and stop.
    5. Run `docker compose up -d --build`. Stream the output so I can see progress.
    6. Poll `curl -s http://localhost:8000/health` every 3 seconds for up to 90 seconds. Proceed once it returns `{"status":"ok"}`.
    7. Print next steps: open os.agno.com, Add OS → Local → http://localhost:8000.

    If any step fails, stop and show me the error. Don't try to fix it on your own.
    ```
  </Tab>
</Tabs>

## Connect to AgentOS UI

<Snippet file="connect-agent-os-ui.mdx" />

Try a question:

> *"What repos are available?"*

> *"Walk me through the auth flow in agno."*

> *"Where are MCP tools registered?"*

> *"What changed in the last 5 commits on agno?"*

Coda routes through its team. The **Explorer** reads code and traces call chains. The **Coder** writes in isolated worktrees. The **Planner** breaks features into issues. The **Researcher** searches the web. The **Triager** labels and closes issues.

## What you have now

| Component           | Detail                                                                                                     |
| ------------------- | ---------------------------------------------------------------------------------------------------------- |
| **Coda team**       | Explorer, Coder, Planner, Researcher, Triager. The Leader coordinates.                                     |
| **Repos**           | Cloned to `/repos/<name>/` inside the container. Synced every 5 minutes.                                   |
| **Knowledge**       | Conventions and patterns Coda discovers, stored via [Agno's Learning Machine](/learning/overview).         |
| **Memory**          | User context held by the Leader (who you are, what you're working on).                                     |
| **Scheduled tasks** | Repo sync runs every 5 minutes. Daily digest and issue triage activate when their channels are configured. |

## Next

[Connect to Slack →](/tutorials/coda/connect-slack)
