Getting Started with giv - AI-Powered Git Assistant

Getting Started with giv

Your first steps to AI-powered Git workflows

Get giv installed and configured in under 5 minutes. Transform your Git history into professional documentation with zero friction.

Quick Start Guide

From zero to AI-powered commits in 3 steps

1

Install giv

# One-line install script (recommended)
curl -fsSL https://raw.githubusercontent.com/fwdslsh/giv/main/install.sh | sh

# Or install via pip
pip install giv

# Or use Docker
docker pull fwdslsh/giv:latest

The install script automatically detects your platform and downloads the appropriate binary. No dependencies required.

2

Configure AI Provider

# Set up OpenAI (most common)
export OPENAI_API_KEY="your-api-key"
export GIV_API_MODEL="gpt-4"

# Or configure via giv
giv config set api.url "https://api.openai.com/v1/chat/completions"
giv config set api.model "gpt-4"

Support for OpenAI, Anthropic, Ollama, and custom endpoints. Environment variables are the quickest way to get started.

3

Generate Your First Commit

# Initialize giv in your project
giv init

# Make some changes and stage them
git add .

# Generate AI-powered commit message
giv message

giv analyzes your staged changes and generates a professional commit message following best practices.

AI Provider Configuration

Choose your preferred AI service

OpenAI Configuration

# Environment variables (recommended)
export OPENAI_API_KEY="sk-your-api-key-here"
export GIV_API_MODEL="gpt-4"

# Or use giv config
giv config set api.url "https://api.openai.com/v1/chat/completions"
giv config set api.model "gpt-4"
giv config set api.key "sk-your-api-key-here"

Recommended models: gpt-4, gpt-4-turbo, gpt-3.5-turbo

Get your API key from OpenAI Platform

Anthropic Claude Configuration

# Environment variables
export ANTHROPIC_API_KEY="your-anthropic-key"
export GIV_API_MODEL="claude-3-5-sonnet-20241022"

# Or use giv config
giv config set api.url "https://api.anthropic.com/v1/messages"
giv config set api.model "claude-3-5-sonnet-20241022"
giv config set api.key "your-anthropic-key"

Recommended models: claude-3-5-sonnet-20241022, claude-3-opus-20240229

Get your API key from Anthropic Console

Ollama (Local) Configuration

# Install Ollama first
curl -fsSL https://ollama.ai/install.sh | sh

# Pull a model
ollama pull llama3.2

# Configure giv
giv config set api.url "http://localhost:11434/v1/chat/completions"
giv config set api.model "llama3.2"
giv config set api.key "not-needed"

Recommended models: llama3.2, codellama, mistral

Completely private and offline after initial model download

Custom API Configuration

# Any OpenAI-compatible endpoint
giv config set api.url "https://your-custom-endpoint.com/v1/chat/completions"
giv config set api.model "your-model-name"
giv config set api.key "your-api-key"

# Optional: custom headers
giv config set api.headers.Authorization "Bearer your-token"
giv config set api.headers.Custom-Header "custom-value"

Works with any service that implements the OpenAI chat completions API

Essential Commands

Core giv commands you'll use every day

Commit Messages
$ giv message
✓ Generated commit: "feat: add user authentication with JWT tokens"
$ giv message --format conventional
✓ Generated conventional commit with proper scope
Changelogs
$ giv changelog v1.0.0..HEAD
✓ Generated changelog with 12 commits
$ giv changelog --update CHANGELOG.md
✓ Updated CHANGELOG.md with new entries
Release Notes
$ giv release-notes v1.2.0..HEAD
✓ Generated release notes for version 1.2.0
$ giv release-notes --format markdown
✓ Formatted release notes in Markdown
Project Summaries
$ giv summary --since="1 week ago"
✓ Generated weekly development summary
$ giv summary --author="jane@example.com"
✓ Generated summary for specific author

Workflow Integration

Integrate giv into your development process

🔄

Git Hooks

# Add to .git/hooks/prepare-commit-msg
#!/bin/sh
if [ -z "$2" ]; then
    giv message > "$1"
fi

Automatically generate commit messages during git commit

🤖

CI/CD Integration

# GitHub Actions example
- name: Generate Release Notes
  run: |
    giv release-notes ${{ github.event.release.tag_name }} \
      --output release-notes.md

Automate documentation generation in your CI/CD pipeline

📝

Custom Templates

# Initialize project templates
giv init

# Edit custom prompts
nano .giv/templates/commit_message_prompt.md

Customize AI prompts for your project's specific needs

⚠️ Common Issues & Solutions

GLIBC Version Error (Linux)
# Use pip installation instead
pip install giv

# Or check compatibility
ldd --version

Binary requires GLIBC 2.31+ (Ubuntu 20.04+)

API Rate Limits
# Add delays between requests
giv config set api.delay 1000

# Or use a different model
giv config set api.model "gpt-3.5-turbo"

Configure rate limiting for your API tier