npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

git-agent

v1.0.2

Published

Git workflows powered by AI - streamlined interface for git-chat-assistant

Readme

Git Agent

Git workflows powered by AI - A streamlined interface for the git-chat-assistant that makes git operations effortless.

Features

One Command, Smart Workflows - Just type commit, review, or rebase in any git repository
Auto Repository Detection - Automatically finds and analyzes your git repository
AI-Powered Git Assistant - Uses your git-chat-assistant actor for intelligent git operations
Zero Configuration - Works out of the box with sensible defaults
Rich Terminal UI - Beautiful, interactive interface built with Ink

Quick Start

Installation

# Install dependencies
cd /path/to/git-agent
bun install

# Build the project
bun run build

# Link for global usage (optional)
npm link

Basic Usage

Simply run these commands from within any git repository:

# Analyze changes and create commits
commit

# Review code changes  
review

# Interactive rebase assistance
rebase

# General git chat
git-chat

Commands

commit - Smart Commit Workflow

Analyzes your repository state and creates meaningful commits:

  • Checks git status to identify changes
  • Reviews diffs to understand modifications
  • Stages files appropriately
  • Creates conventional commit messages
  • Executes commits with explanations

Example:

cd my-project
commit

review - Code Review Assistant

Provides comprehensive code review:

  • Analyzes code changes for quality and style
  • Identifies potential bugs and security issues
  • Suggests improvements and optimizations
  • Provides constructive feedback

Example:

cd my-project  
review

rebase - Interactive Rebase Helper

Assists with git rebase operations:

  • Plans rebase strategies
  • Helps resolve merge conflicts
  • Guides through interactive rebase steps
  • Ensures clean, linear history

Example:

cd my-project
rebase

git-chat - General Git Assistant

Open-ended git assistance:

  • Repository analysis and guidance
  • Git workflow best practices
  • Branch management strategies
  • Troubleshooting git issues

Example:

cd my-project
git-chat

Advanced Usage

Explicit Commands

You can also use the explicit git-agent command:

git-agent commit --verbose
git-agent review --directory /path/to/repo
git-agent rebase --server 192.168.1.100:9000

Command Options

All commands support these options:

  • -d, --directory <path> - Specify repository path (auto-detected if not provided)
  • -s, --server <address> - Theater server address (default: 127.0.0.1:9000)
  • -v, --verbose - Enable verbose logging and diagnostics

Examples with Options

# Use specific repository
commit --directory /path/to/other/repo

# Connect to remote Theater server
review --server production-server:9000 --verbose

# Verbose mode for debugging
rebase --verbose

How It Works

Git Agent creates a streamlined interface around your existing git-chat-assistant actor:

git-agent → GitAgentClient → git-chat-assistant → chat-state + git-tools

Workflow Process

  1. Repository Detection - Automatically finds the git repository
  2. Repository Analysis - Analyzes git status, branches, and changes
  3. Actor Setup - Starts git-chat-assistant with workflow-specific configuration
  4. Workflow Automation - Triggers appropriate workflow (commit/review/rebase)
  5. Interactive Chat - Provides real-time chat interface with git context

Smart Configuration

Each workflow gets optimized settings:

  • Commit: Lower temperature (0.3) for focused, deterministic commits
  • Review: Medium temperature (0.5) for balanced analysis
  • Rebase: Low-medium temperature (0.4) for careful history editing
  • Chat: Higher temperature (0.7) for creative problem-solving

Architecture

Components

  • CLI Interface (src/index.ts) - Command parsing and workflow routing
  • Git Detection (src/git-detector.ts) - Repository discovery and analysis
  • Theater Client (src/theater-client.ts) - git-chat-assistant communication
  • UI Components (src/ui/) - Rich terminal interface with Ink
  • Type Definitions (src/types.ts) - Comprehensive TypeScript types

Dependencies

  • git-chat-assistant - Domain actor for git workflow intelligence
  • theater-client - Low-level Theater protocol client
  • Ink - React-based terminal UI framework
  • Commander - CLI argument parsing

Development

Setup

# Install dependencies
bun install

# Development mode with auto-restart
bun run dev

# Build for production  
bun run build

# Type checking
bun run type-check

Project Structure

git-agent/
├── src/
│   ├── index.ts              # Main CLI entry point
│   ├── types.ts              # Type definitions
│   ├── git-detector.ts       # Repository detection & analysis
│   ├── theater-client.ts     # git-chat-assistant client wrapper
│   └── ui/
│       ├── GitChatUI.tsx     # Main chat interface
│       └── MultiLineInput.tsx # Input component
├── package.json
├── tsconfig.json  
└── README.md

Key Design Principles

  1. Zero Configuration - Works immediately without setup
  2. Smart Defaults - Optimal settings for each workflow
  3. Repository Context - Always aware of current git state
  4. Workflow Focus - Purpose-built for specific git tasks
  5. Clean UX - Simple commands, rich interface

Configuration

Git Chat Assistant Path

Update the manifest path in src/git-detector.ts:

// Update this path to match your git-chat-assistant location
manifest_path: "/path/to/your/git-chat-assistant/manifest.toml"

Theater Server

Default server is 127.0.0.1:9000. Override with:

commit --server your-server:9000

Or set environment variable:

export THEATER_SERVER=your-server:9000
commit

Troubleshooting

"Not in a git repository"

  • Ensure you're in a git repository: git status
  • Or specify path: commit --directory /path/to/repo

"Failed to connect to Theater server"

  • Check Theater server is running: theater-server --port 9000
  • Verify server address: commit --server 127.0.0.1:9000 --verbose

"git-chat-assistant not found"

  • Update manifest path in src/git-detector.ts
  • Ensure git-chat-assistant is built: cd /path/to/git-chat-assistant && cargo component build --release

Verbose Debugging

Add --verbose to any command for detailed diagnostics:

commit --verbose
# Shows:
# Detected repository: /path/to/repo
# Branch: main  
# Status: Has changes
#    Modified: 3, Untracked: 1, Staged: 0
# Starting commit workflow...
# Using git-chat-assistant actor
# Connecting to 127.0.0.1:9000
# Session started - Domain: actor-123, Chat: actor-456

Examples

Typical Commit Workflow

cd my-project

# Make some changes
echo "new feature" >> src/app.ts
echo "# Updated docs" >> README.md

# Start commit workflow
commit

Output:

Commit Workflow
Analyze changes and create meaningful commits  
Repository: my-project (main)
2 files with changes

Git Commit Assistant
my-project • main • Changes pending

Assistant: I'll analyze your repository changes and help create commits.

[tool] git status

I can see you have 2 modified files. Let me examine the changes:

[tool] git diff src/app.ts
[tool] git diff README.md

I can see two distinct changes:
1. A new feature addition in src/app.ts
2. Documentation update in README.md

I'll create two separate commits:

[tool] git add src/app.ts
[tool] git commit -m "feat: add new feature functionality"

[tool] git add README.md  
[tool] git commit -m "docs: update README with recent changes"

Created 2 commits with clear, conventional messages!

Message: _

Code Review Session

cd my-project
review

Output:

Code Review
Review changes and provide feedback
Repository: my-project (feature-branch)  
5 files with changes

Assistant: I'll review your code changes for quality, security, and best practices.

[tool] git diff --staged

Reviewing your changes:

**Positive aspects:**
- Good separation of concerns in auth.ts
- Comprehensive error handling  
- Clear variable naming

**Suggestions:**
- Consider adding input validation in user.service.ts:42
- The password hashing could be more secure (use argon2 instead of bcrypt)
- Missing unit tests for the new authentication flow

[tool] git diff src/auth.ts

**Security note:** Line 15 has a potential timing attack vulnerability. Consider using constant-time comparison.

Would you like me to show you how to fix these issues?

Message: _

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Related Projects


Git Agent - Making git workflows intelligent and effortless!