Lensora is a Rust CLI for reviewing uncommitted Git diffs with specialized LLM review agents.
Portuguese version: README.pt.md
The current flow is:
- Read uncommitted changes from the Git repository.
- Show an interactive selection of changed files.
- Allow choosing one file, multiple files, or all files.
- Load agent prompts from the
agents/directory. - Send each selected diff to an LLM provider.
- Print a clean per-agent summary in the terminal.
- Diff collection from both the working tree and staged area.
- Interactive file selection with a styled terminal menu.
- Multi-provider support:
- Anthropic
- OpenAI
- TOML-based configuration.
- Direct API key support in TOML with optional environment fallback.
- Agent loading from
.mdfiles inagents/. - Organized terminal output with spacing between agent previews.
- Review-only flow: Lensora does not generate or apply patches.
The project already includes:
- Rust CLI foundation with
clap - TOML config loading
- Diff discovery and per-file grouping
- Interactive file selection
- Review agent orchestration
- HTTP clients for Anthropic and OpenAI
- Colored terminal formatting
.
├── Cargo.toml
├── README.md
├── README.pt.md
├── lensora.toml
├── lensora.example.toml
├── agents/
└── src/
└── cli/
Create a local lensora.toml from the example:
cp lensora.example.toml lensora.tomlExample configuration:
[provider]
name = "anthropic"
model = "claude-sonnet-4-6"
api_key = "YOUR_API_KEY_HERE"
[ignore]
paths = ["target/", "Cargo.lock"]
[repo]
preconditions = ["Focus on correctness, regressions, and security."]
[output]
path = "lensora-review.md"name:anthropicoropenaimodel: LLM model IDapi_key: direct key stored in TOML
If api_key is omitted, Lensora falls back to:
ANTHROPIC_API_KEYfor AnthropicOPENAI_API_KEYfor OpenAI
Use this section to exclude files or path patterns from the review input.
Use this section for fixed repository notes, preconditions, or context that should always be included in the review prompt.
output.path is reserved for future report export support and is already part of the config model.
Each .md file in agents/ defines a specialized review agent.
Current agents:
bug.mdconsistency.mdfunctionality.mdsecurity.mdstyle.md
They are loaded at runtime and receive the selected diff plus review context.
cargo runTo inspect the loaded config only:
cargo run -- --print-configLensora prints:
- an initial header with the config path
- the list of changed files
- a colored file-selection menu
- separated per-agent review previews
Request:
Response:
Check the project with:
cargo checkRun tests with:
cargo test
