Skip to main content

Your vibe coding companion - LLM-powered code critic for AI-assisted development

Project description

Dinocheck Logo

Dinocheck

Your vibe coding companion - LLM-powered code critic

CI Coverage PyPI version Python 3.11+ License: MIT Documentation


Dinocheck is an AI-powered code critic designed to enhance your vibe coding sessions. It's not a traditional linter - those focus on syntax and style. Dinocheck uses GPT, Claude, or local models to understand your code semantically and provide intelligent feedback on the things that matter: logic bugs, security issues, and architectural problems.

$ dino check src/views.py

------------------------------------------------------------
✓ Analysis Complete - Score: 72/100
------------------------------------------------------------

Issues (2):

------------------------------------------------------------
 src/views.py
------------------------------------------------------------

  [MAJOR] N+1 query detected in order iteration
     Rule: django/n-plus-one

     Why: Iterating over `Order.objects.filter(user=user)` and accessing
     `order.items.all()` inside the loop causes one query per order.

     Actions:
        Use `prefetch_related('items')` to fetch all items in a single query.

  ----------------------------------------

  [CRITICAL] Missing permission check in delete_account view
     Rule: django/api-authorization

     Why: The `delete_account` view modifies user data but has no permission
     check. Any authenticated user could delete any account by guessing the ID.

     Actions:
        Add ownership validation: `if account.user != request.user: return 403`
        Consider using DRF's permission classes for consistent access control.

Checked 12 files (10 cached) in 1842ms for $0.003

Why Dinocheck?

Traditional linters catch syntax errors and style issues. Dinocheck catches logic bugs, security issues, and architectural problems that only an AI can understand:

  • Detects N+1 queries that would kill your database
  • Spots missing authorization checks before they become CVEs
  • Finds race conditions in your async code
  • Identifies test mocks that hide real bugs

Philosophy

Dinocheck is a linter, not a fixer. It's designed to be your coding companion:

  • Reviews your code with LLM intelligence
  • Points out issues and explains why they matter
  • Lets you decide how to fix them

This fits the vibe coding workflow: you write code with AI assistance, and Dinocheck provides a second opinion.

Features

Feature Description
LLM-First Analysis Uses GPT-4, Claude, or local models for semantic code review
Rule Packs Python, Django, React, TypeScript, CSS, Docker, Compose, Shell, Vue
Smart Caching SQLite cache avoids re-analyzing unchanged files
Cost Tracking Monitor LLM usage and costs with dino logs
Multi-Language Get feedback in English, Spanish, French, etc.
100+ Providers OpenAI, Anthropic, Ollama, and more via LiteLLM

Quick Start

Installation

pip install dinocheck
# or with uv
uv add dinocheck

Configuration

# Create dino.yaml
dino init

# Set your API key
export OPENAI_API_KEY=sk-...

Example dino.yaml:

# All packs enabled by default. Exclude what you don't need:
# exclude_packs:
#   - vue
#   - django

model: openai/gpt-4o-mini  # or anthropic/claude-3-5-sonnet, ollama/llama3
language: en

Usage

# Analyze current directory
dino check

# Analyze specific files
dino check src/views.py src/models.py

# Only analyze changed files (git diff)
dino check --diff

# Verbose output (show progress)
dino check -v

# Debug mode (detailed logs in dino.log)
dino check --debug

# Output as JSON
dino check --format json

# View LLM costs
dino logs cost

CLI Reference

Command Description
dino check [paths] Analyze code with LLM
dino check --diff Analyze only changed files
dino check -v Verbose output with progress
dino check --debug Enable debug logging to dino.log
dino check --no-cache Skip cache, re-analyze all files
dino packs list List available packs
dino packs info NAME Show pack details
dino explain RULE_ID Explain a rule
dino cache stats Show cache statistics
dino cache clear Clear the cache
dino logs list View LLM call history
dino logs show ID Show details of a specific LLM call
dino logs cost View cost summary
dino init Create dino.yaml
dino version Show version information

Rule Packs

Pack Description
python Security, correctness, testing, and reliability rules for Python
django ORM, transactions, DRF, migrations, and Celery task rules
react Hooks, performance, security, patterns, and accessibility for JSX
typescript Type safety, async patterns, and security for TS/JS
css Performance, accessibility, maintainability, and compatibility for CSS
docker Dockerfile security, build optimization, and runtime config
docker-compose Compose security, networking, and reliability
sh Shell script security, error handling, and portability
vue Vue.js reactivity, templates, and XSS prevention

Use dino packs info <pack> to see all rules in a pack.

Output Formats

Format Use Case
text Colored terminal output (default)
json Full JSON for tooling integration
jsonl JSON Lines for streaming

GitHub Actions Integration

name: Dinocheck
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: astral-sh/setup-uv@v5

      - run: uv add dinocheck
      - run: uv run dino check --diff
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Supported LLM Providers

Provider Model Examples
OpenAI gpt-4o, gpt-4o-mini, o1-preview
Anthropic claude-3-5-sonnet, claude-3-opus
Ollama ollama/llama3, ollama/codellama
Azure azure/gpt-4o
Google gemini/gemini-pro

See LiteLLM docs for 100+ supported providers.

Documentation

Full documentation available at: https://diegogm.github.io/dinocheck/

Build docs locally

fab docs

Development

# Clone and install
git clone https://github.com/diegogm/dinocheck.git
cd dinocheck
uv sync --dev

# Run tests
fab test

# Run linters
fab lint

# Pre-deployment checks
fab predeploy

License

MIT License - see LICENSE for details.


Made with care by the Dinocheck contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dinocheck-0.0.7.tar.gz (92.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dinocheck-0.0.7-py3-none-any.whl (162.7 kB view details)

Uploaded Python 3

File details

Details for the file dinocheck-0.0.7.tar.gz.

File metadata

  • Download URL: dinocheck-0.0.7.tar.gz
  • Upload date:
  • Size: 92.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dinocheck-0.0.7.tar.gz
Algorithm Hash digest
SHA256 46d60dda29cfcf22b70725223968b4970618c240626465b5511901e429c2befc
MD5 f86cbdcb7d3eb8a830ab53101a2efbaa
BLAKE2b-256 d0a47e3b4f8689d72d1158bedb52bf3fc2881dae61a24c68bde13fb1b459aefd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dinocheck-0.0.7.tar.gz:

Publisher: release.yml on diegogm/dinocheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dinocheck-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: dinocheck-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 162.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dinocheck-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1c4907c5d40e7662afafe039a531d87d75dc9785b819bec2cd4555f8d7d9026c
MD5 db3dc84b1fdd74c1a36999d4c67c6e4e
BLAKE2b-256 4977773f4d97466498256cf56d38a6cfc7a3dde008691788b487c2715babb221

See more details on using hashes here.

Provenance

The following attestation bundles were made for dinocheck-0.0.7-py3-none-any.whl:

Publisher: release.yml on diegogm/dinocheck

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page