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-ai-tool

v1.0.9

Published

A CLI tool to automate git commit and push using React Terminal

Readme

git-ai-tool

A CLI tool to automate git commit and push using a React Terminal interface.

Features

  • 🤖 AI-Powered Commit Messages: Generates semantic commit messages using OpenAI or Ollama
  • 🖥️ Interactive UI: Beautiful terminal interface built with React Ink
  • 🔍 Smart Change Detection: Automatically detects staged and unstaged changes
  • 🔄 Streamlined Workflow: Guides you through the commit and push process
  • 🔗 PR Integration: Provides pull request URLs after pushing
  • 📊 Operation Summary: Shows a summary of all actions taken

Installation

# Install globally
npm install -g git-ai-tool

# Set required environment variables for OpenAI
export OPENAI_API_KEY="your-openai-api-key"
export GITHUB_TOKEN="your-github-token" # Optional, for PR detection

Usage

Navigate to any Git repository and run:

git-ai-tool commit

By default, the tool uses OpenAI. To use Ollama instead:

git-ai-tool commit --provider ollama

The interactive terminal UI will guide you through:

  1. Reviewing staged and unstaged changes
  2. Staging changes if needed
  3. Generating and confirming a commit message
  4. Pushing changes to remote
  5. Providing a PR URL if applicable

Command Line Options

Options:
  -V, --version                 output the version number
  -p, --provider <provider>     AI provider to use (openai or ollama) (default: "openai")
  --openai-api-key <key>        OpenAI API key
  --openai-model <model>        OpenAI model to use (default: "gpt-3.5-turbo")
  --ollama-host <host>          Ollama host URL (default: "http://127.0.0.1:11434")
  --ollama-model <model>        Ollama model to use (default: "llama3.1")
  -h, --help                    display help for command

Requirements

  • Node.js 16.0.0 or higher
  • Git installed and configured
  • OpenAI API key (if using OpenAI provider)
  • Ollama running locally or remotely (if using Ollama provider)
  • GitHub token (optional) for PR detection

Environment Variables

| Variable | Required | Description | | ---------------- | ---------- | -------------------------------------------------- | | OPENAI_API_KEY | For OpenAI | Your OpenAI API key for generating commit messages | | GITHUB_TOKEN | No | GitHub token for detecting existing PRs |

You can set these in your shell profile or use a tool like direnv to manage them per project.

Using Ollama

To use Ollama instead of OpenAI:

  1. Make sure you have Ollama installed and running
  2. Run the tool with the --provider ollama flag
  3. Optionally specify a different model with --ollama-model <model> (default is llama3.1)
  4. Optionally specify a different host with --ollama-host <host> (default is http://127.0.0.1:11434)

Example:

git-ai-tool commit --provider ollama --ollama-model codellama

Development

Clone the repository and install dependencies:

git clone https://github.com/yourusername/git-ai-tool.git
cd git-ai-tool
npm install

Run in development mode:

npm run dev

Build the project:

npm run build

How It Works

  1. Repository Check: Verifies you're in a valid Git repository
  2. Change Detection: Identifies staged and unstaged changes
  3. AI Generation: Uses OpenAI or Ollama to create a semantic commit message
  4. Commit Process: Commits changes with the generated message
  5. Push Handling: Pushes to remote and checks for PR opportunities
  6. Summary: Provides a summary of all actions taken

Contributing

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

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

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments


Made with ❤️ by [Your Name]


This README provides:

1. A clear description of what the tool does
2. Installation and usage instructions
3. Required environment variables
4. Development setup
5. How the tool works
6. Contributing guidelines
7. License information
8. Acknowledgments

You should replace the placeholder image URL with an actual screenshot or GIF of your tool in action once you have one, and update the GitHub repository URL and your name in the appropriate places.