---
url: /examples/publish-to-ghcr.md
---
# Publish an agent to ghcr.io

Push the `my-agent` project of the [quickstart](/quickstart.md), with its `description` set to `Writes code test first`, to the GitHub Container Registry as a versioned package, then run one version of it. `you` stands for your GitHub account. Your digests, session IDs, answers, and loaded skills differ.

## 1. Sign in

Pandra uses the login of `docker login` when you have one. Otherwise sign in with a GitHub token that can write packages, here in `GHCR_TOKEN`, which Pandra reads from standard input:

```sh
echo "$GHCR_TOKEN" | pandra auth login ghcr.io -u you --password-stdin
```

## 2. Push a version

`pandra push` builds and publishes the agent project in the current directory, the one with its `pandra.toml`, so change to the project's directory first. The `version` in `pandra.toml` becomes the tag:

```sh
cd my-agent
pandra push ghcr.io/you/my-agent
```

```text
Pushed my-agent 0.1.0
  From:    /home/you/my-agent
  To:      ghcr.io/you/my-agent:0.1.0
  Digest:  sha256:08578faa113f7debe10cd50576b4863c89a3e5819fb028462454007d5707a720
```

For the next release, change `version` to `0.2.0` in `pandra.toml` and push again, which pushes `ghcr.io/you/my-agent:0.2.0`. GitHub makes a new package private; to let anyone run it, make it public in the package's settings on GitHub.

## 3. Run a version

Run a version by its tag. The first run of a package from a registry asks you to approve it, even your own, and shows what the package contains (shortened here):

```sh
pandra run ghcr.io/you/my-agent:0.1.0 --headless \
    --prompt "Write a failing test for an add function."
```

```text
  Source:                ghcr.io/you/my-agent
  Digest:                sha256:08578faa113f7debe10cd50576b4863c89a3e5819fb028462454007d5707a720
  Description:           Writes code test first
  Skills:                test-driven-development
  ...
✓ Approve this agent? Yes
...
  Session:  81d6c0e9dc16 (my-agent)
...
Wrote tests/add_test.py with one failing test for add().
  Skills loaded:      test-driven-development
  Skills not loaded:  pandra
```

The approval also covers later versions that add no MCP server, change none, and pre-approve no new tool, so `pandra run ghcr.io/you/my-agent:0.2.0` starts without asking.

[Learn more about OCI registries →](/share/publishing.md#share-through-an-oci-registry)
