This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
GGPR (pr-commit-ai-agent) is an AI-powered CLI tool that enhances Git workflows by generating commit messages, branch names, and pull requests using various LLM providers (OpenAI, Anthropic, Ollama, DeepSeek, Gemini).
bun run build # Build the project using Bun
bun run build:watch # Build with watch mode
bun run compile # Type-check using TypeScript compiler
bun run clean # Clean dist directorybun test # Run tests with Bun's built-in test runner
bun test --watch # Run tests in watch modebun run lint # Run Biome linting
bun run lint:fix # Fix Biome linting issues
bun run format # Check Biome formatting
bun run format:fix # Fix formatting issues
bun run check # Run all Biome checks (lint + format)
bun run check:fix # Fix all Biome issuesbun start # Run using Bun (development)
bun run start:node # Run using node (production)
./bin/run # Direct execution
ggpr # Global command (after installation)bin/run- Main CLI entry point that loads commandssrc/index.ts- Exports all commands
create.ts- Main command for creating commits and PRs with AI assistanceinfo.ts- Display repository informationconfig.ts- Manage configuration settingslogs.ts- View LLM request logs
llm.ts- Multi-provider LLM integration (OpenAI, Anthropic, Ollama, DeepSeek, Gemini)prompts.ts- System prompts for AI interactions
src/config.ts- Configuration management usingconfpackagesrc/logger.ts- Logging utilities usingconsola
- CLI Framework:
yargsfor command parsing - Git Operations:
simple-gitfor Git interactions - LLM Providers: Multiple SDKs (
openai,@anthropic-ai/sdk,@ai-sdk/google,ollama-ai-provider) - Process Management:
execafor subprocess execution - Configuration:
conffor persistent settings
- Runtime: Bun - all-in-one JavaScript runtime and toolkit
- TypeScript: Node 20 target with strict type checking
- Bundler: Bun's built-in bundler (configured in
build.ts) - Testing: Bun's built-in test runner (migrated from Jest)
- Linting/Formatting: Biome - all-in-one linter and formatter (replaces ESLint + Prettier)
- Package Manager: Bun (v1.1.42)
The create command implements a sophisticated workflow:
- Determine target branch (tracking or user-selected)
- Handle uncommitted changes with AI-generated commit messages
- Optimize existing commit messages using AI
- Create/update branches with AI-generated names
- Generate and create PRs via GitHub CLI integration
User configuration is stored via the conf package in platform-specific locations:
- macOS:
~/Library/Preferences/pr-commit-ai-agent-nodejs/ - Linux:
~/.config/pr-commit-ai-agent-nodejs/ - Windows:
%APPDATA%/pr-commit-ai-agent-nodejs/
The llm.ts service provides a unified interface for multiple providers:
- Supports streaming and non-streaming responses
- Includes cost estimation via
llm-costpackage - Logs all requests to
~/.pr-commit-ai-agent/logs/for debugging - Handles provider-specific configurations (API keys, base URLs, models)