Valkyrie is a Rust CLI that watches GitHub repositories for pull requests and posts pull request reviews generated by Anvil.
The crate is published as brokk-valkryie; the installed binary is vk.
cargo install brokk-valkryie- GitHub authentication from
gh auth login, orGH_TOKEN/GITHUB_TOKENset to a token that can read pull requests and write pull request reviews anvilonPATHuvxonPATHfor the default Brokk MCP server command (uvx brokk mcp)
Valkyrie does not use webhooks. It polls the repositories passed at startup.
Watch one or more repositories:
vk watch BrokkAi/example BrokkAi/another-exampleEquivalent flag form:
vk watch --repo BrokkAi/example --repo BrokkAi/another-exampleUseful options:
vk watch BrokkAi/example --interval-seconds 120
vk watch BrokkAi/example --once
vk watch BrokkAi/example --dry-run
vk watch BrokkAi/example --state-dir /var/lib/valkyrie
vk watch BrokkAi/example --anvil-binary /usr/local/bin/anvil --default-model codex::gpt-5
vk watch BrokkAi/example --brokk-mcp-command /opt/homebrew/bin/uvx --brokk-mcp-arg brokk --brokk-mcp-arg mcp
vk watch BrokkAi/example --no-brokk-mcp
vk watch BrokkAi/example --auto-fix-status
vk watch BrokkAi/example --auto-fix-review-findings
vk watch BrokkAi/example --auto-fix-review-findings --max-review-fix-attempts 2
vk watch BrokkAi/example --show-anvil-logs
vk watch BrokkAi/example --verboseRun local checks:
vk doctorFor each poll, Valkyrie:
- Uses the token from
gh auth tokenwhenghis available, otherwiseGH_TOKENorGITHUB_TOKEN. - Calls the GitHub REST API directly for the configured repositories.
- Finds open pull requests.
- Skips pull requests already recorded in local state.
- Skips pull requests that already contain a Valkyrie review marker from the authenticated GitHub user.
- Sends pull request metadata and patches to Anvil over ACP with the Brokk MCP server attached by default.
- Asks Anvil to apply the Brokk
brokk-review-prworkflow using Brokk/Bifrost MCP code intelligence. - Posts a GitHub pull request review with a Brokk-style Markdown summary and inline comments.
- Records the pull request in
.valkyrie/reviews.json.
Anvil manages its canonical Bifrost MCP setup during session startup. Valkyrie adds the Brokk MCP server to review sessions by default with uvx brokk mcp; use --brokk-mcp-command and repeated --brokk-mcp-arg flags to customize that command, or --no-brokk-mcp to run without the extra Brokk MCP server.
vk watch --auto-fix-status opts in to automatic fix attempts for failing pull request status contexts. For each open pull request, Valkyrie reads the head commit's commit statuses and check runs. If any context has failed, Valkyrie asks Anvil to diagnose the failure, make the smallest correct change, and run relevant validation. Anvil is asked to leave changes uncommitted and unpushed.
Before Anvil runs, Valkyrie verifies that the current local worktree is clean, fetches the pull request head branch, and checks out the expected head SHA in a detached state. After Anvil returns, Valkyrie stages any changes, commits them with a status-fix message, pushes HEAD to the pull request head repository and branch, and restores the original local checkout. The local Git credentials must be able to fetch from and push to the pull request head repository. Pull requests whose head repository is unavailable, such as deleted forks, are skipped for automatic status fixes.
To avoid repeated attempts against the same failing commit, fix attempts are recorded by repository, pull request number, and head SHA in .valkyrie/reviews.json. A new push creates a new head SHA and can be attempted on a later poll if status still fails.
This mode is intentionally opt-in because it may modify code and push to remote pull request branches.
vk watch --auto-fix-review-findings opts in to automatic fix attempts for actionable findings generated by Valkyrie's own pull request review. If the generated review contains inline comments or a blocking/change-request verdict, Valkyrie checks out the pull request head SHA, asks Anvil to make the smallest correct fix, commits any resulting changes, and pushes them back to the pull request branch. Valkyrie skips posting the stale review after it pushes a fix; a later poll can review the new head commit.
To avoid repeated attempts against the same findings, attempts are recorded by repository, pull request number, and head SHA in .valkyrie/reviews.json. Valkyrie also caps automatic review-finding fixes by pull request number, regardless of head SHA. The default is one attempt per pull request; use --max-review-fix-attempts to raise or lower that limit.
This mode is intentionally opt-in because it may modify code and push to remote pull request branches. If --auto-fix-status is also enabled, both automatic fix modes may push commits to the same pull request branch across poll cycles.
Valkyrie is intentionally polling-based in v0.2.0. It does not run a webhook server.