Lens
Lens reviews a GitHub pull request, or the difference between two branches, to help you understand the change. The review opens in the UIGraph viewer.
Review a pull request
Pass the pull request in any of these forms:
uigraph lens https://github.com/owner/repo/pull/123
uigraph lens owner/repo#123
uigraph lens 123 # inside a clone whose origin is on GitHubReview two branches
uigraph lens --base main --target feature/loginLens reviews the commits on --target since it split from --base. These are the same changes a pull request would show. Uncommitted changes are not included. Branch reviews read your repository with git and do not use GitHub.
Where reviews appear
The review opens in the viewer. If no viewer is running, the command starts one in this terminal. Reviews are listed under Lens in the sidebar.
Every run is saved in ~/.uigraph/lens/runs. A completed run for the same pull request, base, and head commit is reused unless you pass --regenerate.
Choose an agent
Lens runs the review with a coding agent you pick. Pass --agent with claude, codex, opencode, pi, or cursor, or let UIGraph ask. Pass --model to choose a model in the agent's own format.
Lens uses your own login for the agent you pick:
| Agent | Sign-in |
|---|---|
| Claude Code | Your Claude login or ANTHROPIC_API_KEY. Set CLAUDE_CONFIG_DIR if your Claude settings live outside ~/.claude |
| Codex | codex login or CODEX_API_KEY |
| OpenCode | Provider keys such as ANTHROPIC_API_KEY or OPENAI_API_KEY |
| Pi | ~/.pi/agent/auth.json or provider keys such as ANTHROPIC_API_KEY |
| Cursor | CURSOR_API_KEY. Without --model, Cursor picks the model |
OpenCode logins
UIGraph runs its own OpenCode build with separate settings in ~/.uigraph/opencode. It does not reuse the logins of an OpenCode you already have installed.
GitHub access
Pull request reviews need a GitHub token. Branch reviews do not. Lens looks for one in this order:
GITHUB_TOKENGH_TOKEN- The token from
gh auth token
The viewer reads the token. It is not sent to the browser.
Customize a review
Select Customize in a review to:
- Set a focus, for example "look for double charges"
- Turn review steps on or off
- Pick how many flow diagrams Lens draws, from 1 to 4
- Choose the agent and model for reviews started from the viewer
Lens saves these settings in ~/.uigraph/lens/settings.json.
Set review options for a repository
A repository can set the same options for everyone who reviews it. Add a .uigraph.lens.yml file at its root:
focus: |
Payments code. Look for double charges and wrong refund amounts.
steps:
impact: false
diagrams: 2Lens reads this file from the base branch, so a pull request cannot change how it is reviewed. The repository focus is used together with your own focus. Steps and diagrams in the file replace your settings.