{"id":29168327,"url":"https://github.com/shekohex/lgtm","last_synced_at":"2026-05-09T03:34:37.807Z","repository":{"id":298763767,"uuid":"1000989545","full_name":"shekohex/lgtm","owner":"shekohex","description":"LGTM: A universal Bash script that analyzes Git changes and generates conventional commit messages using AI. Built following the UNIX philosophy for seamless integration with existing workflows.","archived":false,"fork":false,"pushed_at":"2025-06-13T14:06:05.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T14:12:50.730Z","etag":null,"topics":["bash-script","git","llm"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shekohex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-12T16:25:17.000Z","updated_at":"2025-06-13T14:06:08.000Z","dependencies_parsed_at":"2025-06-12T20:57:04.536Z","dependency_job_id":"33f62cd9-4086-4cf7-9737-9f4ff68e5e24","html_url":"https://github.com/shekohex/lgtm","commit_stats":null,"previous_names":["shekohex/lgtm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shekohex/lgtm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekohex%2Flgtm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekohex%2Flgtm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekohex%2Flgtm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekohex%2Flgtm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shekohex","download_url":"https://codeload.github.com/shekohex/lgtm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shekohex%2Flgtm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32806030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","git","llm"],"created_at":"2025-07-01T10:06:50.183Z","updated_at":"2026-05-09T03:34:37.791Z","avatar_url":"https://github.com/shekohex.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LGTM - AI-Powered Git Commit Message Generator\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Shell Script](https://img.shields.io/badge/Shell-Bash-green.svg)](https://www.gnu.org/software/bash/)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\nA universal Bash script that analyzes Git changes and generates conventional commit messages using AI. Built following the UNIX philosophy for seamless integration with existing workflows.\n\n## Overview\n\n**LGTM** (Looks Good To Me) is a command-line tool that automates the generation of meaningful commit messages by:\n\n1. **Processing Git diff output** from staged/unstaged changes or piped input\n2. **Filtering relevant code changes** using configurable patterns and file extensions\n3. **Sending to AI models** via REST API with structured prompts\n4. **Generating conventional commit messages** following industry standards\n5. **Auto-committing** with user confirmation or outputting for pipeline integration\n\nThe tool adheres to the **UNIX philosophy** by accepting input from STDIN, producing clean output for piping, and doing one thing well - generating commit messages.\n\n## Features\n\n### Core Functionality\n\n- ✅ **Universal Compatibility**: Works on Linux and macOS\n- ✅ **AI-Powered Analysis**: Uses configurable AI models (OpenAI, Anthropic, local APIs)\n- ✅ **Smart Filtering**: Ignores irrelevant files, focuses on code changes\n- ✅ **Conventional Commits**: Generates standardized commit message format\n- ✅ **Multiple Input Sources**: Auto-detects changes or reads from STDIN\n\n### Operation Modes\n\n- 🔍 **Dry-run Mode**: Preview generated messages without committing\n- 🤖 **Auto-commit Mode**: Generate and commit with user confirmation\n- 🔇 **Silent Mode**: Output only commit message for automation\n- 📝 **Verbose Mode**: Detailed processing information for debugging\n\n### File Filtering\n\n- 🚫 **.lgtmignore Support**: Advanced ignore pattern configuration with priority-based aggregation\n\n### UNIX Philosophy Compliance\n\n- 📥 **STDIN Support**: Accepts `git diff` output from pipes\n- 📤 **Clean Output**: Produces commit messages suitable for other tools\n- ⚙️ **Environment-based Configuration**: No config files needed\n- 🔗 **Pipeline-friendly**: Integrates seamlessly with Git workflows\n\n## Installation\n\n### Quick Install (Automatic Configuration)\n\nTo install LGTM with automatic shell configuration:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s --\n```\n\nThis will:\n\n1. Install LGTM to ~/.local/bin\n2. Install LGTM as a Git subcommand (accessible via `git lgtm`)\n3. Add required environment variables to your shell profile (~/.bashrc, ~/.zshrc, or equivalent)\n4. Make the script executable\n\nYou can disable the Git subcommand installation using the `--without-git-subcommand` flag:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s -- --without-git-subcommand\n```\n\n### Manual Configuration Install\n\nIf you prefer to manage your shell configuration manually:\n\n```bash\n# Using CLI flags\ncurl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s -- --no-auto-config\n\n# Using environment variables\nLGTM_NO_AUTO_CONFIG=true curl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s --\n\n# Without Git subcommand installation\ncurl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s -- --without-git-subcommand\n\n# Using multiple CLI flags\ncurl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s -- --no-auto-config --without-git-subcommand\n\n# Alternative: using environment variables\nLGTM_NO_AUTO_CONFIG=true LGTM_NO_GIT_SUBCOMMAND=true curl -fsSL https://raw.githubusercontent.com/shekohex/lgtm/main/install.sh | sh -s --\n```\n\nThis will:\n\n1. Install LGTM to ~/.local/bin (and as a Git subcommand by default)\n2. Output the required environment variables to stdout without modifying any files\n3. Let you manually add them to your preferred shell configuration\n\nNote: By default, LGTM is installed both as a standalone command (`lgtm`) and as a Git subcommand (`git lgtm`). You can use either method to run the tool.\n\n### Manual Installation\n\nFor completely manual installation:\n\n```bash\n# Make executable\nchmod +x lgtm.sh\n\n# Optional: Add to PATH\nsudo cp lgtm.sh /usr/local/bin/lgtm\n```\n\n## Quick Start\n\n1. **Configure API access**:\n\n   ```bash\n   export LGTM_API_URL=\"https://api.openai.com/v1/chat/completions\"\n   export LGTM_API_KEY=\"your-api-key-here\"\n   ```\n\n2. **Basic usage**:\n\n   ```bash\n   # Preview commit message\n   ./lgtm.sh --dry-run\n\n   # Generate and output message (for automation)\n   ./lgtm.sh --silent\n\n   # Auto-commit with confirmation\n   ./lgtm.sh --auto-commit\n   ```\n\n## Usage Instructions\n\n### Command Line Options\n\n```\nUsage: lgtm.sh [OPTIONS]\n\nGenerate conventional commit messages using AI analysis of Git diff output.\n\nOPTIONS:\n    -d, --dry-run       Preview mode - show what would be done without making changes\n    -a, --auto-commit   Automatically commit with generated message (requires confirmation)\n    -P, --push          Automatically push to current branch after successful commit\n    -v, --verbose       Enable verbose output for debugging\n    -q, --silent        Suppress all output except the final commit message\n    -s, --stdin         Read git diff output from STDIN\n    -t, --max-tokens N        Maximum tokens for AI response (overrides environment)\n    --max-input-tokens N      Maximum tokens for AI input (overrides environment)\n    -i, --ignore PATTERN      Add ignore pattern (can be used multiple times)\n    -h, --help          Show help message\n```\n\n### Usage Examples\n\n#### Basic Operations\n\n```bash\n# Preview what would be committed\n./lgtm.sh --dry-run\n\n# Generate commit message silently (automation-friendly)\n./lgtm.sh --silent\n\n# Auto-commit with confirmation prompt\n./lgtm.sh --auto-commit\n\n# Auto-commit and push to current branch\n./lgtm.sh --auto-commit --push\n\n# Verbose output for debugging\n./lgtm.sh --verbose --dry-run\n\n# Custom token limits for AI model constraints\n./lgtm.sh --max-tokens 150 --max-input-tokens 4000 --silent\n\n# Override ignore patterns with CLI flags\n./lgtm.sh --ignore \"*.test.js\" --ignore \"coverage/*\" --dry-run\n```\n\n#### UNIX Pipeline Integration\n\n```bash\n# Generate and use commit message\nCOMMIT_MSG=$(./lgtm.sh --silent)\ngit commit -m \"$COMMIT_MSG\"\n\n# Analyze specific staged changes\ngit diff --cached | ./lgtm.sh --stdin --silent\n\n# Analyze last commit\ngit diff HEAD~1 | ./lgtm.sh -s -q\n\n# One-liner automated workflow\ngit add . \u0026\u0026 git commit -m \"$(./lgtm.sh -q)\"\n\n# Integration with Git hooks\necho \"$(git diff --cached | ./lgtm.sh -s -q)\" \u003e .git/PREPARE_COMMIT_MSG\n```\n\n#### Advanced Workflows\n\n```bash\n# Process specific file types only\nexport LGTM_INCLUDE_EXTENSIONS=\".py,.js\"\n./lgtm.sh --dry-run\n\n# Use custom ignore patterns via CLI\n./lgtm.sh --ignore \"*.test.js\" --ignore \"coverage/*\" --dry-run\n\n# Analyze large changes with bigger chunks\nexport LGTM_MAX_CHUNK_SIZE=8000\ngit diff HEAD~5 | ./lgtm.sh --stdin --verbose\n\n# Use with different Git commands\ngit stash show -p | ./lgtm.sh --stdin --silent\ngit show \u003ccommit-hash\u003e | ./lgtm.sh --stdin --silent\n```\n\n## Configuration\n\nAll configuration is handled through environment variables, following the UNIX philosophy of external configuration.\n\n### Required Variables\n\n| Variable       | Description            | Example                                      |\n| -------------- | ---------------------- | -------------------------------------------- |\n| `LGTM_API_URL` | AI API endpoint URL    | `https://api.openai.com/v1/chat/completions` |\n| `LGTM_API_KEY` | API authentication key | `sk-...`                                     |\n\n### Optional Configuration\n\n| Variable                  | Description                       | Default   |\n| ------------------------- | --------------------------------- | --------- |\n| `LGTM_MAX_CHUNK_SIZE`     | Maximum characters per diff chunk | `4000`    |\n| `LGTM_MAX_INPUT_TOKENS`   | Maximum tokens for AI input       | `8000`    |\n| `LGTM_MAX_TOKENS`         | Maximum tokens for AI response    | `100`     |\n| `LGTM_MODEL`              | AI model to use                   | `gpt-4`   |\n| `LGTM_TEMPERATURE`        | Model creativity (0.0-2.0)        | `0.1`     |\n| `LGTM_TOP_P`              | Top-p sampling value (0.0-1.0)    | `0.25`    |\n| `LGTM_AUTO_PUSH`          | Auto-push after commit            | `false`   |\n| `LGTM_IGNORE_PATTERNS`    | Comma-separated ignore patterns   | See below |\n| `LGTM_INCLUDE_EXTENSIONS` | File extensions to analyze        | See below |\n\n### Ignore Pattern Configuration\n\nLGTM supports multiple sources for ignore patterns with the following priority order (highest to lowest):\n\n1. **Environment Variable** (`LGTM_IGNORE_PATTERNS`)\n2. **CLI Flags** (`--ignore` or `-i`)\n3. **.lgtmignore file** (repository-specific patterns)\n4. **.gitignore file** (Git ignore patterns)\n5. **Default patterns** (built-in common patterns)\n\n#### Default Ignore Patterns\n\n```bash\nLGTM_IGNORE_PATTERNS=\"*.log,*.tmp,node_modules/*,*.min.js,*.map,*.lock,*.md,*.txt,*.json,*.yaml,*.yml,*.xml,*.csv\"\n```\n\n#### .lgtmignore File Format\n\nCreate a `.lgtmignore` file in your repository root to specify custom ignore patterns:\n\n```bash\n# LGTM ignore patterns\n*.log\n*.tmp\nbuild/\ndist/\n*.min.js\n*.map\nnode_modules/\n__pycache__/\n*.pyc\ncoverage/\n.env*\n```\n\nThe file follows the same format as `.gitignore` with one pattern per line. Comments (lines starting with `#`) are supported.\n\n#### Pattern Priority Examples\n\n```bash\n# Environment variable takes highest priority\nexport LGTM_IGNORE_PATTERNS=\"*.log,*.tmp\"\n\n# CLI flags override .lgtmignore and .gitignore\n./lgtm.sh --ignore \"*.test.js\" --ignore \"coverage/*\"\n\n# .lgtmignore overrides .gitignore\necho \"*.spec.js\" \u003e\u003e .lgtmignore\n\n# .gitignore patterns are used as fallback\n# Default patterns are used if no other sources exist\n```\n\n#### How Pattern Aggregation Works\n\nLGTM intelligently combines ignore patterns from all available sources:\n\n1. **Starts with default patterns** for common files (logs, temp files, etc.)\n2. **Adds .gitignore patterns** if the file exists\n3. **Adds .lgtmignore patterns** if the file exists (higher priority than .gitignore)\n4. **Adds CLI flag patterns** specified with `--ignore` (higher priority than files)\n5. **Uses environment variable** `LGTM_IGNORE_PATTERNS` as highest priority if set\n\nThis approach ensures maximum flexibility while maintaining sensible defaults.\n\n### Default Include Extensions\n\n```bash\nLGTM_INCLUDE_EXTENSIONS=\".js,.ts,.py,.go,.rs,.java,.cpp,.c,.h,.php,.rb,.sh,.bash,.zsh\"\n```\n\n### Configuration Examples\n\n```bash\n# OpenAI Configuration\nexport LGTM_API_URL=\"https://api.openai.com/v1/chat/completions\"\nexport LGTM_API_KEY=\"sk-your-key-here\"\nexport LGTM_MODEL=\"gpt-4\"\nexport LGTM_TOP_P=\"0.25\"\n\n# Anthropic Claude Configuration\nexport LGTM_API_URL=\"https://api.anthropic.com/v1/messages\"\nexport LGTM_API_KEY=\"your-anthropic-key\"\nexport LGTM_MODEL=\"claude-3-sonnet-20240229\"\n\n# Local/Self-hosted API (Ollama, etc.)\nexport LGTM_API_URL=\"http://localhost:11434/v1/chat/completions\"\nexport LGTM_MODEL=\"llama2\"\n\n# Custom filtering - Python projects only\nexport LGTM_INCLUDE_EXTENSIONS=\".py\"\nexport LGTM_IGNORE_PATTERNS=\"*.pyc,__pycache__/*,*.log\"\n\n# Override ignore patterns with CLI flags\n./lgtm.sh --ignore \"*.test.py\" --ignore \"migrations/*\" --dry-run\n\n# Large diff handling with optimized chunking\nexport LGTM_MAX_CHUNK_SIZE=8000\nexport LGTM_MAX_INPUT_TOKENS=6000\nexport LGTM_MAX_TOKENS=200\n\n# Auto-push configuration\nexport LGTM_AUTO_PUSH=true\n./lgtm.sh --auto-commit  # Will commit and push automatically\n```\n\n### .lgtmignore Configuration Examples\n\nCreate a `.lgtmignore` file for repository-specific ignore patterns:\n\n```bash\n# JavaScript/Node.js project\nnode_modules/\ndist/\nbuild/\n*.min.js\n*.bundle.js\ncoverage/\n.env*\n*.log\n\n# Python project\n__pycache__/\n*.pyc\n*.pyo\ndist/\nbuild/\n*.egg-info/\n.coverage\n.pytest_cache/\n\n# General development files\n.DS_Store\n*.swp\n*.swo\n*~\n.vscode/\n.idea/\n```\n\n### Environment File Usage\n\n```bash\n# Copy example configuration\ncp .env.example .env\n\n# Edit configuration\nvim .env\n\n# Load configuration\nsource .env\n\n# Run with loaded config\n./lgtm.sh --dry-run\n```\n\n## Integration\n\n### Git Workflow Integration\n\nThe tool integrates seamlessly with standard Git workflows:\n\n```bash\n# Stage changes\ngit add .\n\n# Generate and preview commit message\n./lgtm.sh --dry-run\n\n# Commit with generated message\ngit commit -m \"$(./lgtm.sh --silent)\"\n\n# Or use auto-commit mode\n./lgtm.sh --auto-commit\n\n# Auto-commit and push in one step\n./lgtm.sh --auto-commit --push\n\n# Environment-based auto-push\nexport LGTM_AUTO_PUSH=true\n./lgtm.sh --auto-commit\n```\n\n### Pipeline Integration\n\nLGTM accepts input from STDIN and produces clean output, making it perfect for automation:\n\n```bash\n# CI/CD Pipeline example\ngit diff --cached | ./lgtm.sh --stdin --silent \u003e commit-message.txt\ngit commit -F commit-message.txt\n\n# Git hook integration (pre-commit)\n#!/bin/bash\nif [ -n \"$(git diff --cached)\" ]; then\n    COMMIT_MSG=$(git diff --cached | ./lgtm.sh --stdin --silent)\n    echo \"Suggested commit message: $COMMIT_MSG\"\nfi\n```\n\n### Integration with Other Tools\n\n```bash\n# With GitHub CLI\ngh pr create --title \"$(./lgtm.sh --silent)\" --body \"Auto-generated PR\"\n\n# With conventional changelog tools\n./lgtm.sh --silent | tee -a CHANGELOG.md\n\n# With commit message linters\n./lgtm.sh --silent | commitlint --stdin\n```\n\n## How It Works\n\n### 1. Git Diff Processing\n\nThe script intelligently determines what changes to analyze:\n\n- **Staged changes**: `git diff --cached` (highest priority)\n- **Unstaged changes**: `git diff` (fallback)\n- **Last commit**: `git diff HEAD~1` (when no current changes)\n- **STDIN input**: Custom diff from pipes\n\n### 2. Smart Content Filtering\n\nApplies sophisticated filtering to focus on relevant changes:\n\n- **Priority-based ignore patterns**: Aggregates patterns from multiple sources with defined precedence\n- **Multiple ignore sources**: Environment variables, CLI flags, .lgtmignore, .gitignore, and defaults\n- **Include extensions**: Focuses on specified programming languages\n- **File-level filtering**: Preserves diff structure while filtering content\n- **Size management**: Splits large diffs into manageable chunks\n\n### 3. AI API Communication\n\nSends processed content to AI models with structured prompts:\n\n- **System message**: Sets context for conventional commit generation\n- **User message**: Contains filtered git diff output\n- **Request format**: OpenAI-compatible JSON with configurable parameters\n- **Error handling**: Graceful fallback and informative error messages\n\n### 4. Output Generation\n\nProduces clean, actionable results:\n\n- **Conventional format**: `type(scope): description`\n- **UNIX-friendly**: Clean output suitable for piping\n- **Multiple modes**: Preview, auto-commit, or silent operation\n- **Error reporting**: Clear feedback on issues\n\n### Diff Analysis Intelligence\n\nThe tool processes various types of Git changes:\n\n- **File additions**: New files and their content\n- **File deletions**: Removed files (summarized)\n- **File modifications**: Context lines and actual changes\n- **File renames**: Rename operations with content changes\n- **Binary files**: Handled appropriately without content analysis\n\n## Conventional Commit Format\n\nGenerated messages follow the [Conventional Commits](https://conventionalcommits.org/) specification:\n\n```\ntype(scope): description\n\nTypes:\n- feat: A new feature\n- fix: A bug fix\n- docs: Documentation only changes\n- style: Changes that do not affect code meaning\n- refactor: Code change that neither fixes a bug nor adds a feature\n- test: Adding missing tests or correcting existing tests\n- chore: Changes to build process or auxiliary tools\n- perf: Code change that improves performance\n- ci: Changes to CI configuration files and scripts\n- build: Changes that affect the build system or dependencies\n\nExamples:\nfeat(auth): add OAuth2 integration with Google\nfix(api): resolve null pointer exception in user service\ndocs(readme): update installation instructions\nrefactor(utils): simplify string manipulation functions\ntest(auth): add unit tests for login validation\nchore(deps): update dependencies to latest versions\n```\n\n## Requirements\n\n### System Requirements\n\n- **Operating System**: Linux or macOS\n- **Shell**: Bash 4.0+\n- **Git**: Any recent version\n- **Network**: Internet access for API calls\n\n### Required Tools\n\n- `curl` - For API communication\n- `jq` - For JSON processing\n- `git` - For repository operations\n\n### API Requirements\n\n- Valid API key for chosen AI service\n- Sufficient API quota/credits\n- Network access to API endpoint\n\n### Installation Check\n\n```bash\n# Verify all requirements\ncommand -v bash \u0026\u0026 echo \"✓ Bash available\"\ncommand -v git \u0026\u0026 echo \"✓ Git available\"\ncommand -v curl \u0026\u0026 echo \"✓ curl available\"\ncommand -v jq \u0026\u0026 echo \"✓ jq available\"\n\n# Check Git repository\ngit rev-parse --is-inside-work-tree \u0026\u0026 echo \"✓ In Git repository\"\n\n# Check API configuration\n[[ -n \"$LGTM_API_URL\" ]] \u0026\u0026 echo \"✓ API URL configured\"\n[[ -n \"$LGTM_API_KEY\" ]] \u0026\u0026 echo \"✓ API key configured\"\n```\n\n## Troubleshooting\n\n### Common Issues\n\n**\"Not in a Git repository\"**\n\n```bash\n# Ensure you're in a Git repository\ngit init  # or cd to existing repository\n```\n\n**\"Required tool not found\"**\n\n```bash\n# Install missing tools (Ubuntu/Debian)\nsudo apt-get install curl jq\n\n# Install missing tools (macOS)\nbrew install curl jq\n```\n\n**\"API call failed\"**\n\n```bash\n# Check API configuration\necho $LGTM_API_URL\necho $LGTM_API_KEY\n\n# Test API connectivity\ncurl -H \"Authorization: Bearer $LGTM_API_KEY\" $LGTM_API_URL\n```\n\n**\"No git diff output found\"**\n\n```bash\n# Check for changes\ngit status\ngit diff --cached  # staged changes\ngit diff           # unstaged changes\n\n# Or provide input via STDIN\ngit diff HEAD~1 | ./lgtm.sh --stdin\n```\n\n### Debug Mode\n\n```bash\n# Enable verbose output for troubleshooting\n./lgtm.sh --verbose --dry-run\n\n# Check what files are being processed\nexport LGTM_INCLUDE_EXTENSIONS=\".js,.py\"\n./lgtm.sh --verbose --dry-run 2\u003e\u00261 | grep \"Including\\|Ignoring\"\n```\n\n## API Compatibility\n\nThe script uses OpenAI-compatible API format. Supported services:\n\n- **OpenAI**: GPT-3.5, GPT-4, GPT-4 Turbo\n- **Anthropic**: Claude 3 models (requires endpoint adjustment)\n- **Local APIs**: Ollama, LocalAI, FastChat\n- **Cloud APIs**: Azure OpenAI, AWS Bedrock (with compatible endpoints)\n\nFor non-OpenAI APIs, you may need to modify the JSON payload in the `call_ai_api()` function.\n\n## Contributing\n\nContributions are welcome! Please ensure:\n\n- Bash compatibility (Linux/macOS)\n- UNIX philosophy compliance\n- Comprehensive error handling\n- Documentation updates\n\n## License\n\nMIT License - see LICENSE file for details.\n\n---\n\n**LGTM** - Because good commit messages shouldn't require manual effort.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekohex%2Flgtm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshekohex%2Flgtm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshekohex%2Flgtm/lists"}