Gyst is a command-line tool that simplifies git commit workflows by using AI to analyze changes and generate meaningful commit messages. It helps developers maintain consistent commit history and save time while following best practices.
- AI-Powered Commit Messages: Automatically generate meaningful commit messages based on your changes
- Conventional Commit Format: All messages follow the conventional commit format
- Multiple Suggestions: Get multiple commit message options to choose from
- Quick Mode: Fast commit workflow without confirmation prompts
- Interactive Editing: Edit generated messages before committing
- Smart Diff Analysis: Analyze staged changes for better context
- Command Help: Get AI-powered suggestions for Git commands based on what you want to do
- Cloud-Powered by Default: Uses our cloud service for AI operations (no API key required)
- Flexible Configuration: Option to use direct API access if preferred
curl -fsSL https://raw.githubusercontent.com/created-by-varun/gyst/master/install.sh | bash- Download the latest release for your architecture from the releases page
- Make it executable:
chmod +x gyst-darwin-$(uname -m) - Move it to your PATH:
sudo mv gyst-darwin-$(uname -m) /usr/local/bin/gyst
To update gyst to the latest version, you can use either method:
-
Using the install script (recommended):
curl -fsSL https://raw.githubusercontent.com/created-by-varun/gyst/master/install.sh | bashThe script will automatically detect and replace any existing installation.
-
Manual update:
# Remove existing installation sudo rm -f /usr/local/bin/gyst # Download and install the latest version curl -fsSL https://raw.githubusercontent.com/created-by-varun/gyst/master/install.sh | bash
To check your current version:
gyst --versionGyst operates in two modes:
-
Server Mode (Default): Uses our cloud service at
https://gyst-cli.vercel.appto handle AI operations- No API key required
- Faster response times
- Always up-to-date with the latest models
-
Direct API Mode: Connects directly to the Anthropic API
- Requires your own API key
- Useful in environments with restricted internet access
- Gives you control over model selection
By default, Gyst uses Server Mode for the best user experience. You can switch modes using the configuration command:
# Enable server mode (default)
gyst config --use-server true
# Switch to direct API mode
gyst config --use-server falseIf you've disabled server mode, you'll need to set up your AI provider API key:
gyst config --api-key your-api-key-hereThe configuration is stored in ~/.gyst/config.toml:
[ai]
provider = "anthropic" # AI provider (currently supports Anthropic)
api_key = "your-api-key" # API key (required only in direct API mode)
model = "claude-3-5-haiku-20241022" # Model to use
[git]
max_diff_size = 1000 # Maximum diff size in lines
[commit]
max_subject_length = 72 # Maximum length of commit subject line
[server]
use_server = true # Whether to use server mode (default: true)gyst commit [options]
# or use the shorthand
gyst c [options]Analyzes staged changes and generates a commit message using AI.
Options:
-q, --quick: Skip confirmation and use the generated message directly-p, --push: Push changes to the remote repository after committing- Default behavior: Shows the message and prompts for:
Y(default): Accept and use the messagen: Reject and abort commite: Open in editor to modify message
Example:
# Interactive mode (using full command)
gyst commit
# Interactive mode (using shorthand)
gyst c
# Quick mode
gyst commit -q
# or
gyst c -q
# Commit and push
gyst commit -p
# Quick commit and push
gyst commit -q -p
# or
gyst c -qpgyst suggestGenerates three commit message suggestions for you to choose from. If there are no staged changes, it will offer to stage all changes first.
Example:
# Get 3 suggestions
gyst suggestgyst explain "your description here"Get AI-powered suggestions for Git commands based on natural language descriptions of what you want to do.
Examples:
# Find out how to undo the last commit
gyst explain "how do I undo my last commit"
# Learn how to create and switch to a new branch
gyst explain "create and switch to a new branch"
# Get help with resolving merge conflicts
gyst explain "how to resolve merge conflicts"gyst branch health [options]Analyze and report the health status of git branches in your repository. Helps identify stale branches, track activity, and manage branch maintenance.
Options:
--all: Include all branches (local and remote)--remote: Only analyze remote branches--local: Only analyze local branches (default)--days <number>: Consider activity within last N days--author <n>: Filter branches by author--format <format>: Output format (text, json, markdown)
Examples:
# View health of local branches
gyst branch health
# Include remote branches
gyst branch health --all
# Filter by age (30 days)
gyst branch health --days 30
# Filter by author
gyst branch health --author "John Doe"
# Output in markdown format
gyst branch health --format markdownThe command analyzes and reports:
- Branch age and creation date
- Last activity time
- Commit frequency and count
- Author information
- Distance from main branch (commits ahead/behind)
- Overall health status:
- 🟢 Healthy: Recent activity
- 🟡 Needs Attention: Inactive for a while
- 🔴 Stale: No activity for extended period
gyst config [options]Manage Gyst configuration settings.
Options:
--api-key <key>: Set the AI service API key (for direct API mode)--use-server <bool>: Enable or disable server mode (true/false)-s, --show: Show current configuration (both forms work)
Example:
# Set API key (for direct API mode)
gyst config --api-key your-api-key-here
# Enable server mode (default)
gyst config --use-server true
# Disable server mode and use direct API
gyst config --use-server false
# View current config
gyst config --showgyst diffShows a detailed analysis of staged changes including:
- Added files
- Modified files
- Deleted files
- Renamed files
- Change statistics
- Stage Changes: Always stage your changes using
git addbefore using Gyst commands - Review Messages: While quick mode is convenient, it's recommended to review the AI-generated messages
- Server Mode: Use the default server mode for the best experience without requiring an API key
- API Key: Only set up your API key if you've disabled server mode
- Conventional Commits: Gyst follows the conventional commit format:
- Format:
type(scope): description - Types: feat, fix, docs, style, refactor, perf, test, chore, ci, build
- Format:
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.