@codexjatin/gai
v1.0.2
Published
Minimal Git + AI CLI tool
Maintainers
Readme
GAI — Git + AI CLI Tool
A minimal, terminal-native CLI tool that supercharges your Git workflow with AI. Use it to automatically generate conventional commit messages, explain terminal errors, and initialize smart repositories.
Installation
Install gai globally via npm:
npm install -g @codexjatin/gaiDevelopment Setup
To contribute or run from source:
- Clone the repository
- Install dependencies:
npm install - Link the package:
npm link
Prerequisites
- Git: Download Git (Required)
- GitHub CLI (
gh): Install gh (Optional, required forgai initremote creation) - Ollama: Download Ollama (Optional, for local AI)
Setup
First, initialize your AI provider (supports Google Gemini and local Ollama):
gai startThis will walk you through an interactive setup to choose your provider, enter your API key, and select a model.
Commands
gai commit
Generates a concise, 1-line conventional commit message. If you have unstaged changes, gai will interactively ask you to select files to stage first.
gai commitWorkflow:
- Run
gai commit. - Use Space to select/unselect files and Enter to confirm staging.
- Review the AI-generated commit message.
- Confirm to commit!
Options:
-y, --yes: Skip the confirmation prompt and auto-commit immediately.
gai init
A smarter git init. This command will:
- Initialize a new local Git repository (or run in the current folder)
- Scan your project structure using AI to automatically generate a tailored
.gitignore - Optionally create and push to a remote GitHub repository (requires the
ghCLI)
gai initgai explain
Pass an error message or log directly to the AI to get a simple, plain-text explanation and suggested fix.
gai explain "TypeError: undefined is not a function"You can also pipe terminal output directly into it:
npm run build 2>&1 | gai explaingai config
Manage your AI settings directly from the terminal without having to run through the interactive setup again. Configurations are namespaced per provider, so switching providers won't overwrite your settings.
# View all config
gai config get
# Switch active provider
gai config switch ollama
gai config switch gemini
# Set specific provider options
gai config set model gemini-2.0-flash
gai config set apiKey <your-new-key>
gai config set endpoint http://localhost:11434Providers Supported
- Gemini (Uses the official
@google/genaiSDK) - Ollama (Runs completely locally, no internet connection required)
Configuration
Settings are stored locally in ~/.gai/config.json.
Fun Fact
Every single commit in this project is generated usinggai commit.
