Install
AbstractStart the three containers with Docker Compose, attach to the installer, and finish setup in the browser. The same image runs with plain Docker or with the included Kubernetes manifests. The command line alone needs only Python.
What you need
- A host that can run a linux/amd64 image. The build refuses any other architecture, so use an amd64 Linux host or Docker's amd64 emulation.
- Docker with Compose, or a Kubernetes cluster. The included manifests expect Flux.
- A GitHub account that can register an App under the person or organization that owns your repositories, or a GitLab instance where you can create a project or group access token.
- A Cursor, Claude or ChatGPT account to sign in with, or an API key from one of them.
With Docker Compose
Start the containers from a checkout of the repository, then attach to the installer:
docker compose up -d --build
docker compose attach setup
- Press Enter in the attached terminal. It prints a random setup key and the local URL.
- Open
http://127.0.0.1:8765/and enter the key. The page keeps it in a session cookie. - Set the repository, the accounts allowed to request reviews and the review provider in the browser. Follow the provider's sign-in prompts in the same terminal.
- Leave the checkout paths blank for automatic sync.
The sync and review services wait for the first save, and reload each later save between cycles. Setup describes what the wizard asks for.
Leaving setup, and coming back
To return to your shell, type q and press Enter at the manager menu, or while the browser wizard is waiting for an answer. You can also click Quit setup in the browser, or enter /quit at a terminal wizard prompt. Quitting closes the installer and discards unfinished edits. The reviewer and sync services keep running with the last saved configuration.
To reopen setup, run docker compose start setup && docker compose attach setup. Press r there for a fresh provider login.
The setup service disables Docker log retention while it handles an interactive sign-in. Use docker compose logs sync reviewer for the worker logs. The optional ./install.sh builds or pulls the image and attaches to the same manager; with REVIEW_IMAGE set, it pulls instead of building.
The three services
| Service | Runs | Mounts | Job |
|---|---|---|---|
setup | manage | state, repos (read-only), provider-login | The installer, its browser wizard and provider sign-in. Publishes 127.0.0.1:8765. |
sync | sync | state, repos (writable) | Keeps managed checkouts current with git-sync. |
reviewer | the poller | state, repos (read-only), provider-login | Waits for /review, reviews each request, posts the result. |
All three use the same image. Compose starts each with a read-only root filesystem, every Linux capability dropped, no privilege escalation, and a 1 GiB in-memory /tmp. The named volumes are state, repos and provider-login.
With plain Docker
Build the image, then run only the manager from it:
docker build --platform linux/amd64 -t assay-pr-agent .
docker run -dit --name review-setup --platform linux/amd64 --log-driver none \
-p 127.0.0.1:8765:8765 -e REVIEW_SETUP_BIND=0.0.0.0 \
-v review-state:/state -v review-repos:/repos:ro assay-pr-agent manage
docker attach review-setup
Use the same state and checkout volumes for the sync and reviewer containers. Compose manages all three services for you.
To run the wizard once in the terminal instead, with a writable state volume and your checkouts mounted where the reviewer will look for them:
docker run --rm -it --platform linux/amd64 \
-v review-state:/state -v /path/to/checkouts:/repos:ro assay-pr-agent setup
To have a local image report its commit, add --build-arg REVIEW_BUILD_SHA=$(git rev-parse HEAD) to the build. Without it the startup banner shows commit unknown and the build time.
Repository sync
Compose runs Kubernetes git-sync in a separate container with write access to the checkout volume. For each managed project it refreshes the remote default branch with full history, using the existing reviewer credential, and atomically switches the current symlink. The reviewer mounts the volume read-only.
Allow repository contents read access for the GitHub App, or GitLab repository read access for its token. The sync interval defaults to 120 seconds (REVIEW_SYNC_SECONDS on the sync service).
Polling uses the forge's diff directly. When a requested review needs a local static scan and its commit is not in the checkout, the reviewer uses git-sync to fetch just that change's ref into a temporary checkout, verifies its SHA, and discards it after scanning. A moved or unavailable ref is reported as incomplete coverage.
In REVIEW_PROJECTS, use "managed": true in place of a checkout path for a managed clone, or keep your existing absolute checkout and bind mount it. With Compose, mount custom checkout paths in both the sync and reviewer services. The sync service leaves operator-managed checkouts alone.
On Kubernetes
The k8s/ directory mirrors compose.yaml: one pod with the setup, sync and reviewer containers sharing the state, repos and model-auth volumes. Instead of Compose's attachable manager, the setup container runs the browser wizard directly as a sidecar.
Copy the k8s/ directory into the root of your GitOps repository and point Flux at it. Change sourceRef.name in k8s/flux.yaml if your GitRepository is not named flux-system:
kubectl apply -f k8s/flux.yaml
kubectl -n pr-agent get pods
The wizard exits after each session and the sidecar restarts it, so the setup port is always available. Each session prints a random setup key to the log:
kubectl -n pr-agent logs deploy/pr-agent -c setup | grep 'Setup key'
kubectl port-forward -n pr-agent svc/pr-agent 8765:8765
Open http://127.0.0.1:8765/ in your browser and enter the key. Keep the local port at 8765, because the wizard checks the Host header. If you choose provider login, the browser asks you to continue in the installer terminal when the provider CLI signs in:
kubectl attach -it -n pr-agent deploy/pr-agent -c setup
Finish the sign-in there and detach with Ctrl-P, Ctrl-Q. To change projects or credentials later, fetch the key from the log again. To switch the provider account, request a fresh sign-in and end the session with Quit setup; the next one runs with --reauth.
The manifests use the main tag. Pin a digest or a sha-<commit> tag for reproducible deployments. The three volumes are ReadWriteOnce, so the Deployment runs one replica with the Recreate strategy. An egress-only NetworkPolicy allows DNS and the public internet and blocks private ranges; if your forge or proxy lives in one of them, remove it from the policy's except list.
Without Docker
The command line runs on macOS or Linux with Python 3.12 or later. Install uv, Git and the provider CLI, then run these commands in a checkout of the repository:
uv sync --frozen
.venv/bin/cursor-review --help
cursor-agent status should show the account you expect to be billed. A headless CI runner can use a scoped CURSOR_API_KEY. Run the installed executable from any checkout, or use --repo to point it at the project under review.
ShellCheck and actionlint are optional. A missing applicable scanner appears in the report as could-not-check.
Next
- Setup: the wizard, GitHub and GitLab credentials, and private TLS.
- Review providers: sign in with a subscription, or use an API key.
- Request a review: post
/review, or call the command line yourself.