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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@erwanmarega/git-agent

v1.0.0

Published

AI-powered Git assistant - Generate intelligent commit messages, detect secrets, analyze changes, and automate your Git workflow with Claude AI

Downloads

19

Readme

Git Agent

AI-powered Git assistant that transforms your commit workflow into an interactive, intelligent experience using Claude AI.

npm version License: MIT

Features

  • AI-Powered Commit Messages: Generate meaningful conventional commit messages using Claude AI
  • Secrets Detection: Automatically detect API keys, passwords, tokens, and sensitive files before committing
  • TODO/FIXME Detection: Identify incomplete code markers in your staged changes
  • Branch Suggestions: Get intelligent branch name suggestions based on your changes
  • GitHub Integration: Create pull requests directly from the CLI
  • Jira Integration: Link commits to Jira tickets automatically
  • Reviewer Suggestions: Get reviewer recommendations based on git history

Installation

npm install -g @erwanmarega/git-agent

Or use it locally in your project:

npm install @erwanmarega/git-agent

Quick Start

1. Initialize Configuration

git-agent init

This will guide you through setting up:

  • Your Anthropic API key
  • Preferred Claude model (Sonnet 4, Opus 4.5, or Haiku)
  • Optional Jira integration

2. Make a Commit

# Stage your changes
git add .

# Use Git Agent for an intelligent commit
git-agent commit

Git Agent will:

  1. Analyze your staged changes
  2. Check for secrets and sensitive files
  3. Detect TODOs and FIXMEs
  4. Generate a conventional commit message
  5. Let you review and customize before committing

CLI Commands

git-agent init

Interactive setup wizard to configure Git Agent.

git-agent commit

Interactive commit workflow with AI assistance.

Options:

  • Analyzes staged changes
  • Detects security issues
  • Suggests commit messages
  • Supports multi-commit splitting

Programmatic Usage

Git Agent can also be used as a library in your Node.js projects:

import {
  AIService,
  GitAnalyzer,
  SuggestionsEngine,
  BranchSuggester,
  ChangeAnalyzer
} from '@erwanmarega/git-agent';

// Generate commit messages
const ai = new AIService(process.env.ANTHROPIC_API_KEY);
const message = await ai.generateCommitMessage(diff, context);

// Analyze git changes
const git = new GitAnalyzer();
const { files, diff, hasChanges } = await git.getStagedChanges();

// Detect secrets and TODOs
const suggestions = new SuggestionsEngine();
const result = suggestions.analyze(files, diff);

if (result.hasHighSeverity) {
  console.log('Security issues detected!');
}

// Suggest branch names
const branchSuggester = new BranchSuggester();
const branchName = branchSuggester.suggestBranchName(files, diff);

// Analyze file changes
const changeAnalyzer = new ChangeAnalyzer();
const analysis = changeAnalyzer.analyzeFiles(files);

API Reference

AIService

class AIService {
  constructor(apiKey?: string);
  generateCommitMessage(diff: string, context?: string): Promise<string>;
}

GitAnalyzer

class GitAnalyzer {
  getStagedChanges(): Promise<{ files: string[]; diff: string; hasChanges: boolean }>;
  getStatus(): Promise<StatusResult>;
  createCommit(message: string): Promise<void>;
  getCurrentBranch(): Promise<string>;
  push(branch: string, setUpstream?: boolean): Promise<void>;
  // ... and more
}

SuggestionsEngine

class SuggestionsEngine {
  analyze(files: string[], diff: string): SuggestionResult;
  getSummary(result: SuggestionResult): string[];
}

interface SuggestionResult {
  secrets: SecretDetection[];
  todos: TodoDetection[];
  hasHighSeverity: boolean;
  hasMediumSeverity: boolean;
  totalIssues: number;
}

BranchSuggester

class BranchSuggester {
  suggestBranchName(files: string[], diff?: string): string;
  generateMultipleSuggestions(files: string[], diff?: string): string[];
}

ChangeAnalyzer

class ChangeAnalyzer {
  analyzeFiles(files: string[]): AnalysisResult;
}

interface AnalysisResult {
  groups: FileGroup[];
  hasMultipleScopes: boolean;
  totalFiles: number;
  suggestions: string[];
}

PRManager

class PRManager {
  isGitHubCLIInstalled(): Promise<boolean>;
  createPR(title: string, body: string, baseBranch?: string, reviewers?: string[]): Promise<string>;
  generatePRTitle(commits: string[]): string;
  generatePRBody(commits: string[]): string;
}

Configuration

Git Agent stores its configuration in ~/.git-agent/config.json:

{
  "anthropicApiKey": "your-api-key",
  "model": "claude-sonnet-4-20250514",
  "jira": {
    "enabled": false,
    "baseUrl": "",
    "email": "",
    "apiToken": ""
  }
}

Environment Variables

  • ANTHROPIC_API_KEY: Your Anthropic API key (alternative to config file)

Requirements

  • Node.js >= 18.0.0
  • Git
  • GitHub CLI (gh) for PR creation (optional)

Security

Git Agent helps you avoid committing sensitive data by detecting:

  • Files: .env, credentials.json, *.pem, id_rsa, etc.
  • Patterns: API keys, tokens, passwords, connection strings
  • Severity Levels: High (blocks commit), Medium (warning)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git-agent commit)
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

License

MIT License - see the LICENSE file for details.

Author

erwanmarega - GitHub


Made with Claude AI