Skip to main content

CLI tool to identify AI-generated code and bad coding patterns

Project description

🔍 Refine Vibe Code

A powerful CLI tool that analyzes your codebase for AI-generated code patterns, security vulnerabilities, and code quality issues. Perfect for developers who want to maintain professional code standards.

🚀 Installation

pipx

coming, soon

homebrew (MacOS)

coming, soon

The fastest way to use refine is with uv. If you don't have it yet, install it with one command: curl -LsSf https://astral.sh/uv/install.sh | sh

Quick Install (Recommended)

Install refine globally as a standalone tool:

uv tool install refine-vibe-code

Install from Source

Use this if you want to modify the code or contribute:

git clone https://github.com/CarlosMenke/refine-vibe-code.git
cd refine-vibe-code

# Setup and run instantly
uv run refine

Traditional Install (pip)

If you prefer standard Python tools:

git clone https://github.com/CarlosMenke/refine-vibe-code.git
cd refine-vibe-code
pip install .

Configuration Examples

Config generation

Global config, for all projects:

# Generate global config
refine init --global

# Location: ~/.config/refine/refine.toml
# Generate project config in current directory. Named refine.toml
refine init

# Use custom config file path
refine scan --config my_custom_config.toml

LLM Integration (for deeper analysis)

For the best results, configure an LLM provider:

If you want to use a free LLM, with high usage limits and good results, we recomends google gemini-2-flash model. Get API keys here: https://aistudio.google.com/api-keys

Google Gemini:

# In your ~/.config/refine/refine.toml
[llm]
provider = "google" # or openai
model = "gemini-2.0-flash-exp"
api_key = "your-google-api-key"

🚀 Usage Examples

Basic Scanning

Quick Start

# Scan current directory (default behavior)
refine scan

# Scan a specific directory or file
refine scan /path/to/your/project
refine scan specific_file.py

File Selection

# Include specific file types
refine scan --include "*.py" --include "*.js" --include "*.ts"

# Exclude common build/test directories
refine scan --exclude "node_modules/" --exclude "__pycache__/" --exclude ".git/"

# Scan only Python files, exclude test files
refine scan --include "*.py" --exclude "*test*.py" --exclude "*spec*.py"

# Scan specific directories only
refine scan src/ tests/ --include "*.py"

Output Formats

# Rich terminal output (default, with colors and formatting)
refine scan

# Plain text output (for scripts or logs)
refine scan --format plain

# JSON output (for integration with other tools)
refine scan --format json

# Verbose output (detailed information)
refine scan --verbose

Scanning Modes

# Fast classical analysis only (no LLM required)
refine scan --classical-only

# Deep analysis with LLM (requires API key)
refine scan --llm-only

Auto-Fix Mode

# Automatically fix simple issues (safe line deletions for removeing commets only)
refine scan --fix

CI/CD Integration

# Exit with error code on issues (for CI/CD)
refine scan --format json | jq '.has_issues'

# Generate reports for CI/CD
refine scan --format json > scan_results.json

# Strict mode - fail on any issues
refine scan --classical-only --exclude "*test*" || exit 1

Development Workflow

# Pre-commit hook - fast classical check
refine scan --classical-only --format plain

# Code review - detailed analysis
refine scan --verbose --debug --include "*.py"

# Security audit - focus on vulnerabilities
refine scan --classical-only --include "*.py" --include "*.js"

CI/CD Integration

GitHub Actions

Add this to your .github/workflows/ci.yml:

name: Code Quality Check

on: [push, pull_request]

jobs:
  code-quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install uv
        run: curl -LsSf https://astral.sh/uv/install.sh | sh

      - name: Run Refine Vibe Code Check
        run: |
          # Fast classical check for CI
          ~/.local/bin/uvx refine-vibe-code scan --classical-only --format json --exclude "*test*" --exclude "*spec*" || exit 1

      - name: Upload scan results
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: refine-scan-results
          path: scan_results.json

Pre-commit Hook

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/CarlosMenke/refine-vibe-code
    rev: v0.1.0  # Use the latest version
    hooks:
      - id: refine-scan
        name: Refine Vibe Code Check
        entry: uvx refine-vibe-code scan --classical-only --format plain
        language: system
        files: \.(py|js|ts)$
        exclude: ^(tests/|.*test\.|.*spec\.)

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

refine_vibe_code-0.1.0.tar.gz (174.7 kB view details)

Uploaded Source

Built Distribution

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

refine_vibe_code-0.1.0-py3-none-any.whl (90.6 kB view details)

Uploaded Python 3

File details

Details for the file refine_vibe_code-0.1.0.tar.gz.

File metadata

  • Download URL: refine_vibe_code-0.1.0.tar.gz
  • Upload date:
  • Size: 174.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for refine_vibe_code-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45d43f36b6b80319b70a81d0e5ccb932f9c3c7dbfc4f5a2e6bdbb5953c2c403f
MD5 c9bb37bc6d2819cc6d9b948bc3b95e50
BLAKE2b-256 7880beddb5a9ab71bb2c023e75b90a6e93582ece2b931b5d63d6d4da614b368f

See more details on using hashes here.

File details

Details for the file refine_vibe_code-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: refine_vibe_code-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 90.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for refine_vibe_code-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3f3b22543c4f1001806cf2efe7df7b37038b02deacb122921ec414e206e77c0
MD5 ac699e0ca814513852dd6d8c4433f2e9
BLAKE2b-256 0882c874c7a7a32de98b1e97050a6ecb660e6daa5b132651a58b58687b8f926c

See more details on using hashes here.

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