# Rio (getrio.dev): Complete Documentation Reference Canonical index: https://getrio.dev/llms.txt Version: v0.3.0 | License: Apache-2.0 | Maintainer: Pixel Infinito (https://pixel.ao) Repository: https://github.com/pixelinfinito/rio --- # Rio (v0.3.0) > Own your AI code review pipeline. Open-source, Apache-2.0, terminal-first. Review changes before you push. Deterministic checks run locally with no setup. AI reviewers, GitHub PR comments, and Browser QA are opt-in and run on your own Cloudflare account. - Website: https://getrio.dev - Source: https://github.com/pixelinfinito/rio - Wiki: https://github.com/pixelinfinito/rio/wiki - License: Apache-2.0 (made by [Pixel Infinito](https://pixel.ao)) ## Quick install ```sh curl -fsSL https://getrio.dev/install.sh | sh ``` Supports Linux, macOS, and Windows (x64 and arm64) with SHA-256 verification. Full instructions: https://getrio.dev/install.md ## Three opt-in layers 1. **Local review (default, zero cloud)**: Type checks, lint, changed-line coverage, secret scanning, dependency audit, and an impact graph using the tools already in your repo. Run `rio review`. 2. **Hosted AI & PR review (optional, your Cloudflare)**: AI reviewers, blind multi-voter verification, security catalogs, automated GitHub PR comments, and finding memory across rounds. Needs a Cloudflare endpoint and model provider keys. Run `rio init`. 3. **Browser QA (optional, Docker runner)**: Scripted journeys in an isolated browser across mobile and desktop viewports in light and dark themes. Produces masked screenshots, DOM snapshots, traces, accessibility checks, and UX findings. Run `rio qa --full`. ## Seven-step pipeline The first three steps and the final report step run on your machine: 1. **01 Prepare (local)**: Diff working tree, staged index, branch, or PR. 2. **02 Checks (local)**: Run repo-local typecheck, lint, tests, coverage, secrets. 3. **03 Graph (local)**: Map bounded callers, imports, and affected tests around every changed symbol. 4. **04 Triage (cloud)**: Route high-risk hunks to specialist AI agents under your token budget. 5. **05 Agents (cloud)**: Specialist reviewers for correctness, security, performance, tests, and contracts. 6. **06 Verify (cloud)**: Independent blind quorum votes before surfacing. 7. **07 Report (local)**: Interactive ratatui TUI, SARIF, JSON, Markdown, or PR comment. ## Built-in language and repository adapters Rio uses the tools already installed in your repository. Run `rio doctor` to verify. - **TypeScript**: tsc, ESLint, Vitest / Jest (changed-line coverage) - **Python**: Pyright / mypy, Ruff, pytest + coverage.py - **Rust**: cargo, Clippy, rustfmt, cargo-llvm-cov - **All repos**: Secret scanning, dependency audit, bounded impact graph ## Evidence tiers and blind verification Zero findings combined with skipped checks means the review is incomplete, not clean. Every finding carries an evidence tier: - `reproduced`: Execution proof backed by a failing test, reproduction trace, or runtime check. - `static_proven`: Compiler or static proof from tsc, Clippy, Pyright, Ruff, or AST analysis. - `plausible`: Verified hypothesis cross-checked by blind AI verifiers; requires human judgment. - `refuted`: Disproved by independent voters and filtered out of your PR. Blind verifiers vote independently on each AI finding without seeing each other's answers. Unsupported findings are dropped. `--since-last` tracks findings across rounds, and `rio feedback` turns repeated dismissals into team suppression proposals. ## Impact graph Before any token goes to a model, Rio maps callers, imports, and affected tests locally in milliseconds for TypeScript, Python, and Rust. Press `g` in the TUI to inspect the impact graph. ## Self-hosting on Cloudflare `rio init` provisions the Worker, Workflows, D1, R2, Queue, AI Gateway, and a Cloudflare Sandbox or Docker runner. No Wrangler and no source checkout are required. Works with OpenRouter, Anthropic, or any OpenAI- or Anthropic-compatible endpoint. - Connect a team endpoint: `rio init --endpoint URL --token-stdin` - Install GitHub App: `rio init --github-app` - Trigger from PR comments: `/rio review` or `/rio dismiss ` ## CI and SARIF Define repository policy in `.rio/profiles/default.yaml` extending `rio/base`, `rio/openrouter`, `rio/security`, or `rio/critical`. In CI, the TUI disables automatically and exports SARIF, JSON, or Markdown: ```sh status=0 rio review --base origin/main --format sarif > rio.sarif || status=$? # Upload rio.sarif to GitHub Code Scanning, then fail on policy: exit "$status" ``` ## Offline docs for coding agents ```sh rio docs rio docs search "profiles" rio docs profiles --section inheritance rio docs review --format json ``` --- # Rio Workflows > Three ways to run Rio. Start with local checks in your terminal. Add AI review, GitHub PR comments, and finding history when the team needs them. Canonical HTML: https://getrio.dev/workflows ## 01. Local review (default) Run `rio doctor` to verify your repository's installed tools, then `rio review` to inspect uncommitted edits, staged changes, or an entire branch offline. | Command | Scope | | --- | --- | | `rio review` | Working tree, staged, and untracked files | | `rio review --staged` | Only staged index vs. HEAD | | `rio review --base origin/main` | Full branch since merge-base | | `rio review --offline` | Disable Rio's own network requests | ## 02. Hosted AI & blind council Pick a depth preset (`--preset quick`, `--preset standard`, or `--preset deep`). Specialist agents check correctness, security, performance, tests, and contracts. Blind voters confirm or reject each finding independently before surfacing it. - `--preset quick`: Fast, critical-only - `--preset standard`: Balanced everyday - `--preset deep`: Thorough council Example security council command: `rio review --profile rio/security` (3-voter blind quorum). ## 03. Team PR automation & memory - **Publish preview & PR policy (`publish: ask | auto | never`)**: Review inline comments locally before posting, or automate on PR open and push with `/rio review` and `/rio dismiss`. - **Finding history across rounds (`rio review --since-last`)**: Track new, worsened, resolved, and dismissed findings across commits so recurring noise stays suppressed. --- # How Rio Works > What runs where, and what the exit code means. Canonical HTML: https://getrio.dev/how-it-works ## Execution boundary: where every stage runs When no Cloudflare endpoint is configured, steps 1 through 3 and step 7 run offline on your machine; steps 4 through 6 report as deferred. ### On your machine (steps 01, 02, 03, 07) - **01 Prepare**: Computes diff against working tree, staged index, or merge-base. - **02 Checks**: Runs tsc, ESLint, Pyright, Ruff, Clippy, tests, coverage, secrets, and audit. - **03 Graph**: Builds bounded caller, import, and test graph around every changed symbol. - **07 Report**: Renders interactive ratatui TUI or exports SARIF, JSON, and Markdown. ### In your Cloudflare account (steps 04, 05, 06) - **04 Triage**: Selects risk-weighted hunks and bounded graph slices under your token budget. - **05 Agents**: Runs specialist reviewers (correctness, security, performance, tests, contracts). - **06 Verify**: Blind multi-voter quorum checks every proposed issue independently before surfacing. - **Memory & PRs**: D1 and R2 store finding lineage, dismissals, and suppression proposals for your team. ## CI exit codes Read check outcomes before reading findings. Zero findings combined with skipped or failed checks means the review is incomplete. | Exit code | Meaning | | --- | --- | | `0` | No policy failure (optional checks may still be skipped) | | `1` | One or more findings matched the repository failure policy | | `2` | Usage, configuration, or profile validation error | | `3` | Repository, internal, or persistence failure | | `4` | Incomplete or cancelled analysis, or a required check was skipped | | `5` | PR publication failed after an otherwise passing review | | `130` | Interrupted twice (second Ctrl-C / SIGTERM) | ## Version-controlled review policy in YAML Commit `.rio/profiles/default.yaml` to extend a built-in profile (`rio/base`, `rio/openrouter`, `rio/security`, `rio/critical`, `rio/qa`). Maps merge, lists replace. ```yaml version: 1 name: strict extends: rio/openrouter publish: ask fail_on: required_checks: [typecheck, lint] min_evidence: static_proven ``` Inspect and validate profiles before running: ```sh rio profile show rio/base rio profile init rio profile validate ``` --- # Rio Browser QA (New in v0.3) > Test real user journeys across viewports and themes in isolated containers. Canonical HTML: https://getrio.dev/browser-qa Run isolated browser journeys across mobile and desktop viewports in light and dark color schemes. Rio produces PII-masked screenshots, DOM snapshots, traces, accessibility checks, and UX recommendations. ## Four workflow commands 1. **Validate spec**: `rio qa validate` Check `.rio/qa.yaml`, fixtures, seed definitions, and journey contracts. 2. **Build synthetic seeds**: `rio qa seed build` Generate deterministic test data with no production PII. 3. **Author journeys**: `rio qa init` Propose or scaffold initial user journeys from `REVIEW.md`. 4. **Run full matrix**: `rio qa --full` Execute mobile + desktop and light + dark combinations in isolated containers. ## Terminal views 1. **Journey authoring & plan (`rio qa init`)**: Define user flows, assertions, and viewports in `.rio/qa.yaml`. 2. **Live viewport x theme matrix (`rio qa --full`)**: Watch every journey run live across mobile/desktop and light/dark. 3. **Failing cell & trace detail**: Drill into console errors, network traces, and PII-masked screenshots. 4. **Accessibility & UX findings**: Actionable accessibility and UX recommendations tied to exact UI states. ## Prerequisites Requires a Linux Docker host with firewall control, the paired QA container image, model authentication, and `.rio/qa.yaml` plus `REVIEW.md` in your repository. Build the paired Browser QA image: ```sh docker build -f worker/Dockerfile.qa -t rio-qa:0.1.0 . ``` --- # Install & Documentation: Rio v0.3.0 > Install Rio in one line. Verify every binary. Canonical HTML: https://getrio.dev/install Pre-built binaries are published for Linux, macOS, and Windows (x64 and arm64) with SHA-256 checksum and GitHub attestation provenance verification. ## Install methods ### Linux & macOS Installs to `~/.local/bin` with SHA-256 verification. ```sh curl -fsSL https://getrio.dev/install.sh | sh ``` Uninstall: `sh install.sh --uninstall --purge` ### Windows (PowerShell 5.1 / 7) Adds `%LOCALAPPDATA%\Programs\rio\bin` to user `PATH`. ```powershell Invoke-RestMethod -UseBasicParsing -ErrorAction Stop https://raw.githubusercontent.com/pixelinfinito/rio/main/scripts/install.ps1 | ForEach-Object { & ([scriptblock]::Create($_)) } ``` Uninstall: `.\install.ps1 -Uninstall -Purge` ### Build from source (Rust) Uses the pinned toolchain from `rust-toolchain.toml`. ```sh cargo install --git https://github.com/pixelinfinito/rio rio-cli --locked ``` Verify release provenance: ```sh gh attestation verify --repo pixelinfinito/rio ``` ## Embedded agent docs (offline CLI reference) Coding agents such as Claude Code, Codex, and Cursor can read concise, version-matched documentation straight from the `rio` binary offline with bounded token output: ```sh rio docs # list all embedded topics rio docs search "profiles" # search topics & sections rio docs profiles --section inheritance # read one focused section rio docs review --format json # machine-readable JSON ``` ## GitHub Wiki directory - Wiki Home (EN): https://github.com/pixelinfinito/rio/wiki - Wiki (PT-BR): https://github.com/pixelinfinito/rio/wiki/PT-BR-Start - Getting started: Quick start, Installation, First review, Doctor diagnostics, Results & exit codes, Terminal UI controls - Configure & CI: Profiles & inheritance, Machine config, Modules & schemas, CI & SARIF scanning, Cache & offline mode, Evaluation guide - AI & Team PRs: Hosting & runners, Providers & routes, Budgets & limits, GitHub PR App, Security & Council, Feedback & suppressions - Browser QA & Ref: Browser QA setup, Journeys & seeds, Evidence & UX, Commands reference, Troubleshooting, Report an issue (https://github.com/pixelinfinito/rio/issues) --- # Self-Hosted AI Code Review & Cost Breakdown Canonical HTML: https://getrio.dev/self-hosted - **Local deterministic CLI (`rio review`)**: $0 forever, Apache-2.0 open source, zero cloud account or API key. - **Self-hosted Cloudflare stack (`rio init`)**: Cloudflare Workers Paid plan ($5/month base per account, unlimited seats). Includes Workers + Workflows (10M req / 30M CPU ms), D1 (25B reads / 50M writes / 5 GB), R2 ($0.015/GB-mo, $0 egress), Queues, AI Gateway, and Cloudflare Sandbox Containers (or self-hosted Linux Docker runner via `--runner self-hosted`). - **Model tokens (BYOK)**: Direct provider pricing with 0% markup (OpenRouter, Anthropic, OpenAI, or compatible endpoints). Typical illustrative spend: ~$0.04/PR (`quick`), ~$0.12/PR (`standard`), ~$0.35/PR (`deep`), bounded by YAML `budget.fast.tokens`, `verify_tokens`, and `wall_time`. --- # Rio Code Review Comparisons Canonical HTML: https://getrio.dev/compare - **Rio vs CodeRabbit** (https://getrio.dev/compare/coderabbit): Apache-2.0 open source with $5/mo Cloudflare BYOK self-hosting vs proprietary SaaS ($24-$72+/dev/mo) where self-hosting is restricted to Enterprise contracts. CodeRabbit fits best for zero-setup managed SaaS, GitLab/Bitbucket/Azure DevOps webhooks, IDE extensions, or free hosted public OSS reviews. - **Rio vs PR-Agent / Qodo Merge** (https://getrio.dev/compare/pr-agent): Terminal-first Rust CLI with zero-cloud local deterministic checks, bounded blast-radius impact graph, 4 evidence tiers, blind multi-voter quorum, and isolated Docker Browser QA vs PR-first Python bot (`/describe`, `/review`, `/improve`, `/ask`) and Qodo commercial tiers. PR-Agent fits best for multi-forge support beyond GitHub and automated PR descriptions/Q&A. - **Rio vs Kodus** (https://getrio.dev/compare/kodus): Apache-2.0 permissive license, zero-cloud local compilers/coverage/impact graph, and $5/mo serverless Cloudflare Workers stack vs AGPLv3 license, Docker Compose/Kubernetes VPS or $10/dev/mo Kodus Cloud, and multi-forge Git + engineering metrics dashboards. --- # On-Domain Documentation (getrio.dev/docs) All 37 English documentation pages and 37 Portuguese (Brazil) documentation pages are hosted directly on getrio.dev: - English docs home: https://getrio.dev/docs - Portuguese (BR) docs home: https://getrio.dev/docs/pt-br