Skip to content

ibrunner/llm-code-helpers

Repository files navigation

llm-code-helpers

CLI tools for gathering and analyzing code for LLM processing, with a focus on merge request reviews. Disclaimer: This code was mostly written using LLMs as an exercise in learning best practices with AI coding.

Features

  • Analyzes local git branches/commits
  • TODO: Extracts TypeScript declarations and modified functions
  • Generates a markdown report with:
    • TODO: File overview with declarations
    • TODO: Modified function details
    • Git diffs in collapsible sections
    • Review prompt
  • Supports output to file or clipboard

Installation

# Clone the repository
git clone https://github.com/yourusername/llm-code-helpers.git
cd llm-code-helpers

# Install dependencies
yarn install

# Build the project
yarn build

# For development (recommended):
# This will run the CLI directly without installing globally
yarn dev analyze ./path/to/repo [options]

# For global installation (optional):
# This makes the 'mr-context' command available system-wide
npm install -g .
# Or using yarn:
yarn global add file:$PWD

Usage

# Using yarn (recommended for development)
yarn dev analyze ./path/to/repo
yarn dev analyze ./path/to/repo -b feature/branch
yarn dev analyze ./path/to/repo --base main
yarn dev analyze ./path/to/repo -o output.md
yarn dev analyze ./path/to/repo -c

# Or if you've installed globally:
mr-context analyze ./path/to/repo
mr-context analyze ./path/to/repo -b feature/branch
mr-context analyze ./path/to/repo --base main
mr-context analyze ./path/to/repo -o output.md
mr-context analyze ./path/to/repo -c

Known Limitations

  • TypeScript parsing may show warnings for complex arrow functions
  • Some TypeScript features may not be fully supported in the analysis
  • The tool will still generate a report with the changes it can successfully parse

Project Structure

src/
├── index.ts                 # Main CLI entry point
├── commands/
│   └── analyze.ts          # Main analyze command implementation
└── services/
    ├── git/                # Git operations and diff analysis
    ├── parser/             # TypeScript AST parsing
    ├── report/             # Markdown report generation
    └── output/             # Output handling (file/clipboard)

Development

# Build the project
yarn build

# Run in development mode with hot reload
yarn dev

# Run tests
yarn test

# Check for linting issues
yarn lint

# Type check
yarn typecheck

About

scripts for reviewing and analyzing code for llms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published