Skip to content
EhsanAzish80Public

About

X-ray machine for any repository

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Devscope

Review the right files first—with evidence.

A local CLI and GitHub Action that help you focus a code review, understand an unfamiliar repository, and share readable reports with your team.

CI PyPI License: MIT

pipx install devscope==0.3.0
devscope demo

The demo needs no repository or Git. Its sample paths, history and coverage are clearly labelled synthetic. Python 3.11+ is required; Git is needed for real PR reviews. Already installed? Run pipx upgrade devscope.

Terminal demo: prioritized files, evidence and next commands

Choose your starting point

I want to… Start here What you get
Understand a repository Explore a repository Modules, entry-point candidates, test locations and declared commands
Focus a code review Review a PR Changed files ranked with size, history, co-change and optional coverage evidence
Give an AI coding agent local history Connect an MCP client Six read-only tools for changes, co-change, fix facts, owners and blast radius
Share results with reviewers Add to GitHub Actions An updated PR comment and downloadable HTML/JSON/Markdown reports

Explore a repository

Run from its root:

devscope onboard .

Prefer a broader inventory? devscope scan . shows size, languages and repository health signals. Onboarding displays declared commands as data; it never runs them.

Review a PR

Fetch the target branch, then review your committed changes:

git fetch origin main
devscope review . --base origin/main

Replace origin/main with your PR's target branch. Full Git history is required; for a shallow clone, fetch it with git fetch --unshallow. Uncommitted changes are excluded from PR reviews.

Export an offline report, or try the sample first:

devscope review . --base origin/main --format html --output review.html
devscope demo --format html --output demo.html

Open the HTML file in your browser. It includes search, evidence and complete report data, with no external scripts or fonts.

Offline HTML report generated by devscope demo; all data is synthetic

Download the standalone sample HTML · View its structured data

Connect an MCP client

Install a project-local MCP entry for Claude Code, Cursor or Codex:

devscope mcp install --client claude-code --path .
# or: cursor, codex
# without a persistent install: add --command uvx

The installer preserves existing configuration and refuses to replace an existing devscope entry. The server exposes six read-only tools: review_changes, cochange, file_risk, fix_history, owners and blast_radius. It reads local Git history without running repository code or using the network. A cold history index builds in the background; retry the tool when it returns index_building. The file_risk compatibility name currently returns fix SHAs, churn and owners, not a risk score. Codex reads .codex/config.toml only after the project is trusted.

For a lightweight pre-commit or agent hook, check all working-tree files without blocking by default:

devscope check . --working-tree --format claude-stop
devscope check . --working-tree --format claude-stop --strict  # opt-in blocking mode

Add to GitHub Actions

Save this as .github/workflows/devscope.yml. This starts with advisory review; new-warning gates are opt-in.

name: Devscope review
on: pull_request
permissions:
  contents: read
  pull-requests: write
jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: EhsanAzish80/devscope-action@v1.3.0
        with:
          review: 'true'
          devscope-version: '0.3.0'

The Action updates one bot comment and uploads HTML, JSON and Markdown artifacts. Fork PRs with read-only tokens still receive the job summary and artifacts; their comment is skipped. For summary-only reporting, use the read-only CLI workflow.

Actual Devscope bot comment from the Action's integration PR

View the actual PR comment · Full Action inputs and examples

What the evidence means

  • Size, churn and co-change suggest where to look; they do not predict defects.
  • Coverage comes from supplied LCOV/Cobertura reports for the asserted PR head. Unmapped lines stay unknown. Test-file counts are not coverage.
  • New-warning gates distinguish existing, accepted and new findings. Target-branch configuration and baselines prevent a PR from weakening its own gate.
  • Local CLI reports do not upload source code or execute repository commands. The GitHub Action publishes report metadata to your GitHub job and optional comment.

Go further

Configuration and monorepos · Baselines and gates · Coverage import · All commands · Changelog

Without pipx, use a virtual environment: python3 -m venv .venv, activate it, then python -m pip install devscope==0.3.0. On macOS/Linux activation is source .venv/bin/activate; on Windows PowerShell use .venv\Scripts\Activate.ps1.

For development: uv sync --all-extras, uv run pytest, uv run ruff check src/devscope tests and uv run mypy src/devscope. See CONTRIBUTING.md.

MIT licensed. See LICENSE.

About

X-ray machine for any repository

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages