A simple tool that uses an LLM to create commit and PR messages based on git status.
Institutionalized is a Go CLI tool that analyzes your staged git changes and uses AI providers (OpenAI ChatGPT, Google Gemini, or Anthropic Claude) to generate conventional commit messages, then prompts you to confirm before committing the changes. It can also create comprehensive pull requests using GitHub CLI.
- π€ AI-powered commit messages: Uses OpenAI's ChatGPT, Google Gemini, or Anthropic Claude to generate meaningful commit messages
- π Conventional Commits: Follows the Conventional Commits specification by default
- π Smart analysis: Analyzes your staged git changes to understand the context
- π‘οΈ User confirmation: Always asks for confirmation before committing or creating PRs
- π§ Flexible configuration: Support for multiple AI providers with fallback capability
- π Pull Request creation: Creates comprehensive PRs with GitHub CLI integration
- π Draft PR support: Option to create draft pull requests
- π Dry-run mode: Preview PR content without creating actual PRs
- β‘ Provider fallback: Automatically switches to backup provider if primary fails or times out
- π Emoji support: Optional emoji prefixes for commit types (β¨ feat, π fix, etc.)
- π« Skip confirmation: Optional flag to bypass confirmation prompts for automation
The fastest way to install on macOS:
brew install ianknighton/tap/institutionalizedInstall using Go (works on all platforms):
go install github.com/IanKnighton/institutionalized@latestThis installs the binary to your $GOPATH/bin directory. Make sure $GOPATH/bin is in your $PATH to use institutionalized from anywhere.
For detailed installation instructions including manual installation, PATH setup, and troubleshooting, see our comprehensive Installation Guide.
Available methods:
- Install via Homebrew (macOS - recommended)
- Install via Go (all platforms)
- Build from source with global installation
- Download pre-built binaries from GitHub releases
- Manual binary placement and PATH configuration
- Platform-specific instructions for Linux, macOS, and Windows
You need an API key from one or more of the supported providers:
OpenAI: Get your API key from OpenAI's platform Google Gemini: Get your API key from Google AI Studio Anthropic Claude: Get your API key from Anthropic Console
Set your API key(s) as environment variables:
# For OpenAI (ChatGPT)
export OPENAI_API_KEY="your-openai-key-here"
# For Google Gemini
export GEMINI_API_KEY="your-gemini-key-here"
# For Anthropic Claude
export CLAUDE_API_KEY="your-claude-key-here"
# You can set multiple keys - the tool will use them based on your configurationThe tool will automatically detect which API keys are available and use them according to your configuration preferences.
-
Make your changes and stage them:
git add . -
Run institutionalized to generate and commit:
institutionalized commit
-
Review the proposed commit message and confirm or cancel.
Institutionalized supports extensive configuration options to customize AI provider settings, emoji preferences, timeouts, and more. Configuration is managed through a YAML file and CLI commands.
Quick configuration:
# View current settings
institutionalized config show
# Create default configuration
institutionalized config init
# Set a provider as primary
institutionalized config set providers.priority claudeFor comprehensive configuration documentation including all available options, provider management, emoji settings, and troubleshooting, see our detailed Configuration Guide.
Key features:
- Multiple AI provider support (OpenAI, Gemini, Claude)
- Configurable provider priority and fallback
- Emoji support for commit types
- Timeout and performance tuning
- Environment variable integration
Analyzes staged changes and generates a conventional commit message using available AI providers (OpenAI ChatGPT, Google Gemini, or Anthropic Claude).
Flags:
--api-key, -k: OpenAI API key (deprecated: useOPENAI_API_KEYenvironment variable)--emoji: Use emoji in commit messages (overrides config file setting)--dry-run: Show staged changes without calling API or committing (useful for testing)
Examples:
# Basic usage with environment variables
export OPENAI_API_KEY="your-openai-key"
export GEMINI_API_KEY="your-gemini-key"
export CLAUDE_API_KEY="your-claude-key"
institutionalized commit
# Using only OpenAI (if you have multiple keys but want to use only OpenAI)
institutionalized config set providers.gemini.enabled false
institutionalized commit
# Dry run to see what changes would be analyzed
institutionalized commit --dry-run
# Use emoji for this specific commit
institutionalized commit --emojiManage configuration settings for institutionalized. Supports provider management, emoji preferences, timeout settings, and more.
Subcommands:
show: Display current configuration valuesset <key> <value>: Set a configuration valueinit: Create a default configuration file
Quick Examples:
# View current configuration
institutionalized config show
# Set Claude as primary provider
institutionalized config set providers.priority claude
# Enable emoji support
institutionalized config set use_emoji trueFor complete configuration documentation including all available options and advanced settings, see the Configuration Guide.
Create a pull request using GitHub CLI that documents the scope of changes made, testing added, and features completed.
Requirements:
- GitHub CLI (
gh) installed and authenticated - Must be on a feature branch (not the default branch)
- Must be in a git repository
Flags:
--draft, -d: Create a draft pull request--dry-run: Show what would be done without creating the PR (doesn't require authentication)--yes, -y: Skip confirmation prompt and create PR immediately
Examples:
# Create a standard pull request (prompts for confirmation)
institutionalized pr
# Create a draft pull request (prompts for confirmation)
institutionalized pr --draft
# Skip confirmation and create PR immediately
institutionalized pr --yes
# Create draft PR without confirmation
institutionalized pr --draft --yes
# Preview what the PR would look like (no authentication required)
institutionalized pr --dry-run
# Preview a draft PR
institutionalized pr --draft --dry-runPull Request Templates:
The tool automatically detects and respects pull request templates in your repository. It looks for templates in the following locations (in order of priority):
.github/pull_request_template.md.github/PULL_REQUEST_TEMPLATE.md.github/PULL_REQUEST_TEMPLATE/pull_request_template.mddocs/pull_request_template.md
When a template is found, the LLM is instructed to follow the template structure while generating the PR description based on your commit history.
How it works:
- Verifies
ghCLI is installed and user is authenticated - Checks that current branch is not the default branch
- Analyzes commit history between current branch and default branch
- Detects and reads pull request template (if available)
- Generates PR title from the most recent commit message
- Creates comprehensive PR description following the template structure (if available) with commit summary and structured content
- Uses
gh pr createto create the pull request
# Create a feature branch
git checkout -b feature/new-functionality
# Make some changes
echo "console.log('Hello, World!');" > hello.js
# Stage the changes
git add hello.js
# Let AI generate and commit with a conventional message
institutionalized commit
# Make additional changes and commits as needed
# ... more development work ...
# When ready, create a pull request
institutionalized pr
# Or create a draft PR to share work-in-progress
institutionalized pr --draft
# Preview the PR without creating it
institutionalized pr --dry-runThe tool will analyze your changes and might generate a commit message like:
feat: add hello world JavaScript example
Add a simple JavaScript file that logs "Hello, World!" to the console.
When creating a PR, it will generate a comprehensive description including:
- Summary of all commits in the branch
- Structured sections for changes made and testing
- Automatic formatting for easy review
The tool follows the Conventional Commits specification, generating messages in the format:
<type>: <description>
[optional body]
Common types include:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Build process or auxiliary tool changes
- Go 1.24+ for building from source
- Git repository (the tool must be run within a git repository)
- OpenAI API key, Google Gemini API key, or Anthropic Claude API key (for commit message generation)
- GitHub CLI (
gh) installed and authenticated (for PR creation) - Staged changes (use
git addto stage files before running commit command)
MIT License - see LICENSE file for details.