Skip to content
GitHub stars

Event Streaming & Daemon API

The daemon exposes a REST API on the configured server_addr. With the default value of 127.0.0.1:7373, the API is reachable at http://127.0.0.1:7373. An OpenAPI 3.1.0 spec is available at /openapi.json for client generation and integration tooling. roborev also ships a generated public Go client for integrations that want a stable typed wrapper.

Terminal window
# Fetch the OpenAPI spec (TCP, default address)
curl http://127.0.0.1:7373/openapi.json
# With Unix domain socket (path depends on your configuration; see Configuration > Unix Domain Socket)
curl --unix-socket "$XDG_RUNTIME_DIR/roborev/daemon.sock" http://localhost/openapi.json
EndpointMethodDescription
/api/jobsGETList review jobs (supports cursor-based pagination via before parameter)
/api/reviewGETGet review by job ID or SHA
/api/commentsGETList comments for a job or commit
/api/reposGETList repos with job counts
/api/branchesGETList branches with job counts
/api/statusGETGet daemon status
/api/healthGETGet daemon health checks
/api/activityGETList recent daemon activity
/api/summaryGETGet review summary statistics
/api/costGETGet approximate aggregate review cost
/api/queue/pausePOSTPause queue processing
/api/queue/unpausePOSTResume queue processing
/api/job/cancelPOSTCancel a queued or running job
/api/job/rerunPOSTRe-enqueue a completed or failed job
/api/review/closePOSTClose or reopen a review
/api/commentPOSTAdd a comment to a job or commit

These endpoints have typed request/response schemas in the OpenAPI spec. The daemon also exposes endpoints used by the CLI, TUI, and subsystems for enqueueing jobs, streaming job output, reading logs and patches, sync operations, and token backfill. Most JSON endpoints are represented in the generated client; endpoints that stream or return raw bytes are exposed through raw helper methods.

External Go integrations can import the public daemon client:

import roborevclient "go.kenn.io/roborev/pkg/client"
func main() {
c, err := roborevclient.New("http://127.0.0.1:7373")
if err != nil {
panic(err)
}
_ = c
}

The client embeds typed methods generated from pkg/client/openapi.yaml. For streaming or raw-byte endpoints, use the hand-written helpers:

HelperEndpoint
GetJobLogRaw/api/job/log
GetJobOutputRaw/api/job/output
GetJobPatchRaw/api/job/patch
StreamEventsRaw/api/stream/events
SyncNowRaw/api/sync/now

The generated package is intended for integrations that run against the same installed roborev version as the daemon. The CLI and TUI still evolve in lockstep with the daemon, so pin roborev versions when building long-lived external tools.

Stream review events in real-time for integrations, notifications, or custom tooling:

Terminal window
roborev stream # Stream all events
roborev stream --repo . # Stream events for current repo only

Events are emitted as newline-delimited JSON (JSONL):

{"type":"review.started","ts":"2025-01-11T10:00:00Z","job_id":42,"repo":"/path/to/repo","repo_name":"myrepo","sha":"abc123","agent":"codex"}
{"type":"review.completed","ts":"2025-01-11T10:01:30Z","job_id":42,"repo":"/path/to/repo","repo_name":"myrepo","sha":"abc123","branch":"main","agent":"codex","verdict":"P"}
TypeDescription
review.startedReview job started processing
review.completedReview finished successfully
review.failedReview failed (includes error field)
review.canceledReview was canceled
review.closedReview was marked closed
review.reopenedReview was reopened

Common fields:

  • type: Event type
  • ts: ISO 8601 timestamp
  • job_id: Unique job identifier
  • job_uuid: Stable job UUID when available
  • repo: Repository path
  • repo_name: Repository display name
  • sha: Commit SHA (or dirty for uncommitted changes)
  • branch: Branch used for event and hook matching, when known. For CI pull-request reviews this is the PR base branch
  • agent: Agent that processed the review, when available
  • worktree_path: Worktree path used by the job, when different from the main repo path

Additional fields:

  • verdict: Pass/Fail verdict (on review.completed)
  • error: Error message (on review.failed)

Use jq to filter events:

Terminal window
# Only completed reviews
roborev stream | jq -c 'select(.type == "review.completed")'
# Only failures
roborev stream | jq -c 'select(.type == "review.failed")'
# Specific repo
roborev stream | jq -c 'select(.repo_name == "myproject")'
# Failed verdicts
roborev stream | jq -c 'select(.verdict == "F")'
Terminal window
roborev stream | while read -r event; do
type=$(echo "$event" | jq -r '.type')
repo=$(echo "$event" | jq -r '.repo_name')
if [ "$type" = "review.completed" ]; then
verdict=$(echo "$event" | jq -r '.verdict')
if [ "$verdict" = "F" ]; then
osascript -e "display notification \"Review failed\" with title \"$repo\""
fi
fi
done
Terminal window
roborev stream | while read -r event; do
curl -X POST -H "Content-Type: application/json" \
-d "$event" https://your-webhook.example.com/reviews
done