Skip to content

Yordaniss/git-navigator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧭 Git Navigator

Git Navigator is an AI-powered CLI tool that converts natural language instructions into safe, structured, and executable git commands.

You describe what you want to do.
Git Navigator figures out how to do it — safely.


✨ Features

  • 🧠 Natural language → git commands
  • 🧭 Step-by-step execution plan
  • 🔍 Dry-run mode by default (safe preview)
  • ⚠️ Risk level estimation for each operation
  • ✅ User confirmation before execution
  • 🤖 AI-powered intent interpretation (GitHub Copilot / LLM)
  • 🛡 Designed for real production repositories

📦 Installation

Local (Development)

npm install
npm run build
npm link

After linking, the CLI becomes globally available:

gitnavigator --help

🚀 Usage

Basic usage (dry-run)

gitnavigator -- "Please revert last commit"

📝 By default, Git Navigator runs in dry-run mode and does not execute any git commands.

Execute commands

gitnavigator -- "Please revert last commit from branch release/1" --apply

You will be asked to confirm before execution.

Using -m (message flag)

gitnavigator -m "Create new branch release-maintenance" --apply

🧪 Example Output

🧭 Git Navigator

Proposed plan:
1. Switch to branch release/1
   git checkout release/1
2. Revert last commit
   git revert HEAD

Risk level: high

✔ Proceed with execution? Yes
→ git checkout release/1
→ git revert HEAD
✔ Done
⚙️ Supported Actions
The AI planner currently supports the following git operations:

* create_branch

* revert_commits

* cherry_pick

* merge

* create_release_branches

The architecture is extensible, making it easy to add new actions.

🧠 How It Works

  • The CLI receives a natural language instruction

  • AI interprets the intent into structured JSON

  • buildPlan converts the intent into executable git steps

  • The user reviews and confirms the plan

  • Commands are executed sequentially

🛡 Safety Principles

  • Dry-run enabled by default

  • Explicit user confirmation required

  • Risk level displayed before execution

  • No hidden or implicit side effects

  • Git Navigator is designed to assist, not replace, your understanding of git.

🧑‍💻 Development

Run locally

npm run dev -- "Please revert last commit"

Run tests

npm test

📁 Project Structure

src/
 ├─ cli/          # CLI entry point & runner
 ├─ copilot/      # AI interpretation layer
 ├─ git/          # Git inspection, planning & execution
 └─ safety/       # some safety rools
 test/            # place for unit tests

## ⚠️ Disclaimer
This tool does not replace git knowledge.

Always review the proposed plan before execution.
You are responsible for the commands executed in your repository.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors