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


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

src/views.py:42 [major] django/n-plus-one
  N+1 query detected: iterating over `Order.objects.filter(user=user)` and
  accessing `order.items.all()` inside the loop causes one query per order.

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

src/views.py:87 [critical] django/missing-permission-check
  The `delete_account` view modifies user data but has no permission check.
  Any authenticated user could delete any account by guessing the ID.

   Add ownership validation: `if account.user != request.user: return 403` 2 issues found (1 critical, 1 major)

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 and Django packs with 40+ rules
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

Initialize your project and configure your LLM provider:

# Create dino.yaml with interactive setup
dino init

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

The dino init command creates a dino.yaml file where you can customize your LLM provider and packs:

dinocheck:
  packs:
    - python
    - django

  provider:
    model: gpt-4o-mini          # or claude-3-5-sonnet, ollama/llama3
    api_key_env: OPENAI_API_KEY

  output:
    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

# 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 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

Python Pack

Category Rules
Security SQL injection, insecure deserialization, mass assignment, timing attacks
Logic Inverted conditions, unreachable code, copy-paste bugs, missing edge cases
Code Quality Naming mismatches, misleading comments, stale TODOs
Concurrency Race conditions, deadlocks, resource lifecycle
Testing Wrong assertions, flaky patterns, missing negative tests, mocks hiding bugs

Django Pack

Category Rules
ORM N+1 queries, missing select_related, queryset performance, template queries, signal hidden logic, cache stale data
Transactions Atomic scope, select_for_update, F-expressions, on_commit side effects
DRF Permission classes, throttling, async blocking calls, serializer mismatches
Migrations Data loss, large indexes, NOT NULL two-phase
Tasks Non-idempotent Celery tasks
Testing Missing auth tests, business logic coverage

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.

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.2.tar.gz (58.3 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.2-py3-none-any.whl (94.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dinocheck-0.0.2.tar.gz
  • Upload date:
  • Size: 58.3 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.2.tar.gz
Algorithm Hash digest
SHA256 a28167d3c589fecbf8603e436538180b23355b6f5bfb6d73b7ee23f4dd1d5ada
MD5 7ab3a26084745bc4c8a39d4a06c1408f
BLAKE2b-256 0ea31de04f34db04e0d0b5dc38087ad9e0ef5415dd580a1311a2438def62fadb

See more details on using hashes here.

Provenance

The following attestation bundles were made for dinocheck-0.0.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: dinocheck-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 94.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c3ef315faad1d5682d7413df5a988afefab294b403aab297a72b711fd19b488a
MD5 65f794004e6feaf9b5d1d9ef8c7e7191
BLAKE2b-256 e2f1c84b51fdbc681d836dbb2e9cdf7cccd6be7d2498c883759cd647f7659b5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dinocheck-0.0.2-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