How saransh-kaushik/nopush works
NoPush is a local CLI application that turns Git changes into structured AI review feedback. Its architecture is centered on a single pipeline: collect changes from Git, build a prompt, send it to an LLM provider, normalize the response into review findings, and render those findings in the terminal or optionally post them to GitHub.
1. Entry points and CLI boundary
The executable starts in src/nopush/__main__.py and flows into the CLI package. src/nopush/cli/app.py likely wires the command set, while src/nopush/cli/commands/ contains the user-facing actions: init for project setup and review for running the review pipeline.
2. Configuration subsystem
src/nopush/config/ is the local project configuration boundary. The README indicates a nopush.yaml file in the repo root, and the config manager/schema/constants files suggest the app loads, validates, and applies settings such as provider, model, review depth, and ignore paths before review starts.
3. Git change ingestion
src/nopush/git/ is responsible for turning repository state into reviewable input. The diff parser and Git models indicate support for staged changes, uncommitted diffs, or file-based selection. This is the first major data transformation step: raw Git diff data becomes structured internal diff objects.
4. Prompt construction
src/nopush/prompts/ converts parsed diffs into LLM-ready prompts. The builder and templates modules suggest a templated prompt strategy, likely chunking and formatting code changes with context-aware instructions so the provider receives a bounded, structured input.
5. Provider abstraction layer
src/nopush/providers/ isolates model/vendor specifics behind a common interface. base.py defines the contract, while openai.py, anthropic.py, and gemini.py implement provider-specific API calls. registry.py is the selection boundary that maps config values like provider: openai to the correct implementation.
6. Review orchestration
src/nopush/review/engine.py is the core coordinator. It likely receives Git diffs, invokes prompt building, calls the selected provider, and converts the returned text into structured review results defined in review/models.py. This is the main internal control flow of the application.
7. Structured review output
The README describes findings with severity, file paths, line numbers, explanations, and suggestions. That indicates the engine does not expose raw model output directly; it normalizes responses into a typed review model before presentation. This is important for diagramming because it separates model inference from user-visible review data.
8. Terminal rendering
src/nopush/cli/renderer.py is the presentation boundary for the console. It formats the structured review output into readable, colorized terminal text. This layer depends on the review model but should not know about Git parsing or provider APIs.
9. GitHub integration
src/nopush/github/commenter.py is a secondary output channel. It likely posts review findings back to GitHub, which means the architecture supports two sinks: local terminal output and remote GitHub commenting. This is separate from the core review pipeline and should be shown as an optional post-processing path.
10. End-to-end data flow
The main runtime flow is: CLI command -> load config -> read Git diff -> build prompt -> call provider -> parse/normalize findings -> render in terminal. If GitHub posting is enabled, the structured findings also flow into the commenter after review generation.
11. Cross-cutting concerns
Ignore rules from config affect which files reach the Git parser and prompt builder. Provider choice and model selection affect the network boundary. Review depth likely changes prompt verbosity or chunking strategy. These are configuration-driven controls that influence multiple subsystems without creating separate services.
12. Tooling and validation
The repository is Python-based and packaged via pyproject.toml. The .github/workflows files and tests under tests/ show CI and unit coverage around CLI, config, Git parsing, prompt building, providers, and review orchestration. That mirrors the architecture and is a good hint for diagram boundaries: each subsystem is tested in isolation.
13. Architectural summary
NoPush is a modular, local-first command-line pipeline with clear separation between input collection, prompt generation, model invocation, result normalization, and presentation. The main diagram should show the review engine as the hub, with Git, config, prompts, providers, and rendering as distinct layers, plus an optional GitHub integration path at the output edge.
Main entry points: engine.py Review engine · registry.py Provider select · review_cmd.py Review · app.py CLI app
Components 16
Entry & CLI
Executable entrypoint and user-facing commands
Core Pipeline
Configuration, diff ingestion, prompt building, review orchestration, and result modeling
- Config · Loads and validates local review settings
src/nopush/config/manager.py - Git diff · Converts repository changes into structured diff objects
src/nopush/git/diff_parser.py - Prompt builder · Formats diffs and instructions into LLM-ready prompts
src/nopush/prompts/builder.py - Review engine · Coordinates config, prompt generation, provider calls, and normalization
src/nopush/review/engine.py - Review model · Typed findings and review result structures
src/nopush/review/models.py
LLM Providers
Vendor abstraction and concrete API integrations
- Provider select · Maps configuration to the active LLM implementation
src/nopush/providers/registry.py - Provider API · Common interface for model vendors
src/nopush/providers/base.py - OpenAI · OpenAI provider implementation
src/nopush/providers/openai.py - Anthropic · Anthropic provider implementation
src/nopush/providers/anthropic.py - Gemini · Gemini provider implementation
src/nopush/providers/gemini.py
Outputs
Terminal rendering and optional GitHub posting
- Terminal · Formats structured findings for console output
src/nopush/cli/renderer.py - GitHub post · Posts structured review feedback back to GitHub
src/nopush/github/commenter.py
Connections 20
- nopush → CLI app: start · Executable hands off to the CLI application
- CLI app → Init: init · Dispatches project setup commands
- CLI app → Review: review · Dispatches the review workflow
- Review → Config: load config · Reads local repository settings before review
- Review → Git diff: collect changes · Turns Git state into structured review input
- Review → Review engine: run · Invokes the review pipeline
- Config → Provider select: provider choice · Selects the active vendor from config
- Config → Prompt builder: rules · Supplies review depth and ignore settings
- Git diff → Prompt builder: diffs · Provides structured change data for prompt construction
- Prompt builder → Review engine: prompt · Feeds LLM-ready prompt content into orchestration
- Review engine → Provider select: select · Resolves the configured provider implementation
- Provider select → Provider API: implements · Registry targets the shared provider contract
- Provider select → OpenAI: openai · Chooses the OpenAI adapter when configured
- Provider select → Anthropic: anthropic · Chooses the Anthropic adapter when configured
- Provider select → Gemini: gemini · Chooses the Gemini adapter when configured
- Review engine → Review model: normalize · Converts raw model output into structured findings
- Review engine → Terminal: render · Sends findings to terminal presentation
- Review engine → GitHub post: optional post · Posts findings to GitHub when enabled
- Review model → Terminal: format · Renderer consumes typed review results
- Review model → GitHub post: comment data · GitHub integration uses the same structured findings