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

Global Installation

Install refine globally as a standalone tool:

pipx

pipx install refine-vibe-code

With uv

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

uv tool install refine-vibe-code
uv tool update-shell

homebrew

brew tap CarlosMenke/homebrew-tap
brew 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

If you run refine for the first time, it will auto generate the config

# Generate global config
refine
# To use it
refine scan DIR_NAME

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 recommend google gemini-2-flash model. Get API keys here: https://aistudio.google.com/api-keys

Manual configuration

You can also adjust the behavior of refine manually. You have to run refine (once) and then you can edit the config at ~/config/refine/refine.toml For available Models look at the config.

🚀 Usage Examples

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.3.tar.gz (177.0 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.3-py3-none-any.whl (92.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: refine_vibe_code-0.1.3.tar.gz
  • Upload date:
  • Size: 177.0 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.3.tar.gz
Algorithm Hash digest
SHA256 d34dd45a77725d53d5e8753e68af4ef9fc5a42ab9dead5918c7549babe072200
MD5 ded73ff840372855f4e88fa6ab1bb572
BLAKE2b-256 00b6fa2cd8fbd77aaa8ac1118260c5c4587b3af9d587a2ce466ac34c0b39b7bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: refine_vibe_code-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 92.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d224d1f2f227e91bd68c01d1ff510ea8134b1d9b181f8fec651a3c67a545c185
MD5 b345ae814993b56c0d5dabaa1e0b8773
BLAKE2b-256 b9d07e9199284705b71a1aea33083be4904e57d1d8fb8284d9f10db70731df11

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