A unified CLI tool for code formatting, linting, and quality assurance
Actively maintained. Last release 2 days ago, commits in 24 of the last 26 weeks. A safe choice.
pip install lintroREADME as published on PyPI with version 0.183.4.
Lintro
A comprehensive CLI tool that unifies various code formatting, linting, and quality assurance tools under a single command-line interface.
🚀 Quick Start
# Install (choose one)
uv pip install lintro # Python / PyPI (or: pip install lintro)
bun add -g @lgtm-hq/lintro # Node / npm — self-contained, no Python
# npm ships no Intel Mac binary; Intel Macs install via Homebrew or PyPI
lintro check . # Find issues (alias: chk)
lintro format . # Fix issues (alias: fmt)
lintro badge # shields.io issue-count badge
lintro check --output-format grid # Beautiful output
Adopting Lintro in a legacy project? Run lintro baseline create . --tools ruff,black,
then lintro check . --tools ruff,black --baseline .lintro-baseline.json to acknowledge
existing findings and report new ones. Certified check findings currently come from Ruff
and Black. Other producers, including ShellCheck, Hadolint, shfmt, dotenv-linter,
pydoclint, SQLFluff, mypy, pylint, and Bandit, cannot yet acknowledge failed findings.
Default or mixed selections abort baseline management if any active result is incomplete
or uncertified; check --baseline keeps those results visible and failing. See the
baseline guide for limits, updates, conservative pruning, and
configuration.
✨ Why Lintro?
- 🎯 Unified Interface - One command for all your linting and formatting tools
- 📊 Consistent Output - Beautiful, standardized output formats across all tools
- 🔧 Auto-fixing - Automatically fix issues where possible
- 🐳 Docker Ready - Run in isolated containers for consistent environments
- 📈 Rich Reporting - Multiple formats: grid, JSON, HTML, CSV, Markdown
- ⚡ Fast - Optimized parallel execution
🔌 Works With Your Existing Configs
Lintro respects your native tool configurations. If you have a .prettierrc,
pyproject.toml [tool.ruff], or .yamllint, Lintro uses them automatically - no
migration required.
- Native configs are detected - Your existing
.prettierrc,.oxlintrc.json, etc. work as-is - Enforce settings override consistently - Set
line_length: 88once, applied everywhere - Fallback defaults when needed - Tools without native configs use sensible defaults
See the Configuration Guide for details on the 5-tier config system.
🛠️ Supported Tools
| Tool | Language | Auto-fix | Install |
|---|---|---|---|
| Linters | |||
| ⚙️ GitHub Actions | - | GitHub Releases | |
| 🦀 Rust | ✅ | rustup component add clippy | |
| 🔀 Git commits | - | bun add -D @commitlint/cli @commitlint/config-conventionalnpm install -D @commitlint/cli @commitlint/config-conventional | |
| 🔧 C/C++ | - | brew install cppcheckapt-get install cppcheck | |
| 🐹 Go | ✅ | brew install golangci-lintInstall docs | |
| 🐳 Dockerfile | - | GitHub Releases | |
| 🌐 HTML | - | bun add -D html-validatenpm install -D html-validate | |
| 🐍 Python | - | 📦 | |
| 📝 Markdown | - | bun add -D markdownlint-cli2npm install -D markdownlint-cli2 | |
| 📝 Prose / Docs | - | brew install valeGitHub Releases | |
| 🟨 JS/TS | ✅ | bun add -D oxlintnpm install -D oxlint | |
| 🐍 Python | - | 📦 | |
| 🐍 Python | - | 📦 | |
| 🐚 Shell Scripts | - | brew install shellcheckGitHub Releases | |
| 📘 OpenAPI/AsyncAPI/JSON Schema | - | bun add -D @stoplight/spectral-clinpm install -D @stoplight/spectral-cli | |
| 🧾 YAML | - | 📦 | |
| Formatters | |||
| 🐍 Python | ✅ | 📦 | |
| 🟨 JS/TS | ✅ | bun add -D oxfmtnpm install -D oxfmt | |
| 🟨 JS/TS · 🧾 JSON | ✅ | bun add -D prettiernpm install -D prettier | |
| 🐚 Shell Scripts | ✅ | brew install shfmtGitHub Releases | |
| 🦀 Rust | ✅ | rustup component add rustfmt | |
| Lint + Format | |||
| 🧩 Protobuf | ✅ | brew install bufbuild/buf/bufGitHub Releases | |
| 🐍 Python | ✅ | 📦 | |
| 🗃️ SQL | ✅ | pipx install sqlfluff | |
| 🧾 TOML | ✅ | brew install taploGitHub Releases | |
| 🔑 .env Files | ✅ | brew install dotenv-linterGitHub Releases | |
| 🎨 CSS/SCSS/Sass/Less | ✅ | bun add -D stylelintnpm install -D stylelint | |
| 🔤 Spelling | ✅ | brew install typos-clicargo install typos-cli | |
| Type Checkers | |||
| 🚀 Astro | - | bun add astro + bun add -D @astrojs/checknpm install astro + npm install -D @astrojs/check | |
| 🐍 Python | - | 📦 | |
| 🔥 Svelte | - | bun add -D svelte-checknpm install -D svelte-check | |
| 🟨 JS/TS | - | bun add -D typescriptnpm install -D typescript | |
| 💚 Vue | - | bun add -D vue-tscnpm install -D vue-tsc | |
| Security | |||
| 🐍 Python | - | 📦 | |
| 🏗️ Terraform (IaC) | - | uv tool install checkov | |
| 🔐 Secret Detection | - | brew install gitleaksGitHub Releases | |
| 🦀 Rust | - | cargo install cargo-audit | |
| 🦀 Rust | - | cargo install cargo-deny | |
| 🔒 Multi-ecosystem | - | GitHub Releases | |
| 🐍 Python | - | pip install pip-audituv add pip-auditbrew install pip-audit | |
| 🔒 Multi-language | - | ./scripts/utils/install-semgrep.shuv tool install semgrepbrew install semgrep | |
| 🔐 Secret Detection | - | brew install trufflehogGitHub Releases | |
| AI Tools | |||
| 🤖 AI · Multi-language | - | uv pip install 'lintro[ai]' + API key | |
📦 = bundled with lintro — no separate install needed
⚡ Node.js tools support--auto-installto install dependencies automatically
🟨 Every Node.js tool resolves the same way: the checked project'snode_modules/.binfirst, then a binary onPATH, then a version-pinnedbunx/npxfetch. A project devDependency (-D, shown above) is therefore always the best answer — it is lockfile-pinned and needs no network. A global (-g) or Homebrew install still works and is used when no local install exists. See Node.js tool resolution.
🤖 AI-Powered Features (Optional)
Lintro includes optional AI-powered features that provide actionable summaries and interactive fix suggestions. AI features are BYO (Bring Your Own) API key — not enabled by default.
- Providers: Anthropic, Cursor, OpenAI — peers, listed alphabetically;
ai.providerhas no default and is required onceai.lintorai.reviewis enabled - AI Summary — high-level assessment with pattern analysis (1 API call per run)
- Interactive Fix Suggestions — AI-generated code diffs with risk classification
- Post-fix Summary — contextualizes what was fixed and what remains
# Install with AI support
uv pip install 'lintro[ai]'
# Set the variable your chosen provider declares:
# ANTHROPIC_API_KEY, CURSOR_API_KEY or OPENAI_API_KEY
export ANTHROPIC_API_KEY=sk-ant-...
# Enable in config
# .lintro-config.yaml
# ai:
# enabled: true
# provider: anthropic | cursor | openai # required, no default
# transport: api | cli # no default; doctor flags it unset
See the AI Features Guide for full documentation.
📦 Installation
Python 3.11+ is required. Check tool versions with lintro list-tools.
# Lightweight (CLI only — detects tools on PATH)
uv pip install lintro
brew tap lgtm-hq/tap && brew install lintro
# Homebrew ships a prebuilt binary on Apple silicon; Intel Macs install from PyPI
# Full (bundled Python tools: ruff, black, mypy, bandit, import-linter,
# pydoclint, pylint, yamllint)
uv pip install 'lintro[full]'
brew tap lgtm-hq/tap && brew install lintro-full
# Docker (all tools)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:latest check
# Docker (CLI only)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro-base:latest check
# First run after lightweight install
lintro init
lintro doctor
lintro install --profile recommended
See Getting Started for detailed installation options.
💻 Usage
# Check all files (alias: chk)
lintro check .
# Auto-fix issues (alias: fmt)
lintro format .
# Grid output with grouping
lintro check --output-format grid --group-by file
# Run specific tools
lintro check --tools ruff,prettier,mypy
# Auto-install Node.js dependencies
lintro check --tools tsc --auto-install
# Exclude directories
lintro check --exclude "node_modules,dist,venv"
# Only scan files changed vs a git base ref (fast PR-scoped checks)
lintro check --diff # vs the repo default branch (origin/HEAD)
lintro check --diff main # vs an explicit ref
lintro format --diff # format only changed files
# List available tools
lintro list-tools
🐳 Docker
# Run from GHCR (tools image - recommended)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:latest check
# With formatting
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro:latest check --output-format grid
# Base image (minimal, no external tools; separate GHCR package)
docker run --rm -v $(pwd):/code ghcr.io/lgtm-hq/py-lintro-base:latest check
📚 Documentation
| Guide | Description |
|---|---|
| Getting Started | Installation, first steps, requirements |
| Configuration | Tool configuration, options, presets |
| AI Features | AI summaries, fix suggestions, config |
| Docker Usage | Containerized development |
| GitHub Integration | CI/CD setup, workflows |
| Pre-commit Integration | Run lintro as a pre-commit hook |
| Contributing | Development guide, adding tools |
| Troubleshooting | Common issues and solutions |
Advanced: Tool Analysis · Architecture · Security
🔨 Development
# Clone and install
git clone https://github.com/lgtm-hq/py-lintro.git
cd py-lintro
uv sync --dev
# Run tests
./scripts/local/run-tests.sh
# Run lintro on itself
./scripts/local/local-lintro.sh check --output-format grid
🤝 Community
📄 License
MIT License - see LICENSE for details.