Control Git with natural language! NLGit is a cross-platform CLI tool that interprets your natural language instructions and executes Git operations locally using AI.
- Natural Language Interface: Just describe what you want to do
- Safe by Design: Asks for confirmation on destructive operations
- Fast & Offline: Runs locally with downloaded LLM models
- Agentic: Makes intelligent decisions based on context
- Operation History: Track and potentially revert operations
- Beautiful CLI: Interactive menus and clear feedback
npm install -g natural-language-gitOr with yarn:
yarn global add natural-language-gitSimply run nlgit followed by your natural language instruction in quotes:
nlgit "show me the status"
nlgit "create a new branch called feature-auth"
nlgit "commit all changes with message 'add login feature'"
nlgit "show me the last 5 commits"
nlgit "rebase with main and keep my changes"On first run, NLGit will automatically guide you through:
- Selecting an AI model (LLaMA or Mistral)
- Downloading the model (only happens once, can be several GB)
- Initializing the model in memory
After onboarding, NLGit is ready to use!
If you want to change your model or reset the configuration:
- Remove the config directory:
rm -rf ~/.nlgit- Run nlgit again to restart onboarding:
nlgit "any command"The onboarding will detect the missing configuration and guide you through setup again.
All NLGit data is stored in ~/.nlgit/:
config.json- Selected model and preferencesmodels/- Downloaded LLM models (large files)history.json- Operation historylogs/- Temporary logs (auto-cleaned after 24h)
- Parse: NLGit uses a local LLM to understand your natural language request
- Analyze: It determines what Git commands are needed and their safety level
- Confirm: For destructive or cloud operations, it asks for your confirmation
- Execute: It runs the Git commands and shows you the results
- Track: All operations are logged for your reference
NLGit classifies operations into three safety levels:
- Safe: Auto-executed (status, log, diff, fetch, etc.)
- Destructive: Requires confirmation (reset, rebase, force operations)
- Cloud: Requires confirmation (push, pull, clone)
nlgit "what's the current status?"nlgit "create a branch named feature-x and switch to it"nlgit "stage all files and commit with message 'initial commit'"nlgit "show me the last 10 commits"nlgit "merge develop into my current branch"NLGit comes with two pre-configured models:
- Meta-LLaMA-3-8B Instruct (Q5_K_M): Higher quality, larger size
- Mistral 7B Instruct v0.2 (Q2_K): Faster, smaller size
You can switch models by running the onboarding again.
- Repository inspection (status, log, diff, show)
- Branch management (create, delete, switch, list)
- Commits (create, amend, revert)
- Staging (add, reset)
- Merging and rebasing
- Remote operations (push, pull, fetch)
- Stash operations
- Tag management
- And more!
NLGit is focused exclusively on Git operations. If you ask about non-Git topics, it will politely redirect you back to Git-related tasks.
- Node.js >= 20.0.0
- Git installed and configured
- macOS, Linux, or Windows
- At least 2-8 GB free disk space (for model storage)
Contributions are welcome! Please see CONTRIBUTING.md for detailed guidelines on:
- Development setup
- Code conventions
- Commit message format
- Pull request process
Note: This project is in active development. Unit tests are not yet implemented, and the tool has not been fully tested in production environments. Use with caution and always review suggested commands before confirming destructive operations.
MIT License - see LICENSE file for details.
Copyright (c) 2025 Daniel Oquelis
- Built with node-llama-cpp
- UI powered by @inquirer/prompts, chalk, and ora
- Models from Hugging Face (Meta LLaMA and Mistral)
Note: NLGit is an AI-powered tool. While it strives for accuracy, always review suggested commands before confirming destructive operations.

