ai-ship-cli
v0.2.0-beta.2
Published
AI-powered Git workflow CLI (commit, branch, PR generation)
Maintainers
Readme
✨ Features
- 🧠 Deep Code Analysis: AI-Ship doesn't just read filenames. It reads your raw
git diffoutputs, intelligently filters out noise (like lockfiles), and evaluates the actual intent of your code changes. - 📝 Automated Intelligent Commits: Say goodbye to "fixed bug" or "updated code". AI-Ship drafts rich, standard-compliant commit messages highlighting semantic changes.
- 🌿 Smart Branch Name Generation: Need a new feature branch? Throw in
--new-branchto let AI-Ship read your commit's context, draft a descriptive semantic branch name (e.g.feature/implement-user-auth), automatically apply branch collision defenses, and check it out for you. - 🚀 One-command PR Pipelines: Complete your entire development phase in one go. Using
ai-ship commit --push --prtakes your staged changes, commits them intelligibly, pushes them directly toorigin, and opens a full contextual Pull Request over the GitHub CLI. - 🤖 Provider Agnostic: Works beautifully with Google Gemini (Cloud) out-of-the-box or Ollama for entirely private, local execution.
- 🛡️ Dry Runs & Pre-flights: Want to see what the AI cooks up without mutating your local Git repository? Use
--dry-run. - ✍️ Interactive Refinements: Don't like the drafted message? Instantly edit it, request a retry, or skip.
- 🎨 Beautiful, Professional CLI: Enjoy a sleek, modern terminal interface with custom animated spinners, colored outputs, and structured logging that elevates your entire experience.
📦 Prerequisites
Before deploying AI-Ship, ensure your machine meets the following structural requirements:
- Node.js (v18 or higher recommended)
- Git installed and initialized in your working repository.
- GitHub CLI (
gh) installed and authenticated (required exclusively if you use--prflows). - An API Access key for Google Gemini, OR a local instance of Ollama running locally.
🛠️ Installation & Setup
For now, AI-Ship can be run directly from source.
Clone the repository:
git clone https://github.com/developer-diganta/ai-ship.git cd ai-shipInstall dependencies:
npm installBuild the CLI executable:
npm run buildLink globally (Optional but recommended):
npm linkThis globally registers the
ai-shipcommand in your terminal so it can be initiated in any Git repository on your system.
⚙️ Configuration
Control how AI-Ship operates directly from the CLI via the config command.
🔑 Set up your API Key (Cloud/Gemini)
To utilize the Gemini API connection:
ai-ship config --add-keyIt will securely prompt for your API key and store it locally.
To remove your key:
ai-ship config --delete-key🧠 Change AI Provider (Local vs Cloud)
If you prefer running a local execution without making network API calls to Cloud AI models, you can switch providers. (Requires a local Ollama server):
ai-ship config set provider localTo switch back to the cloud via Google Gemini:
ai-ship config set provider cloud🧾 View Current Config
ai-ship config show --verbose🚢 Usage
At its core, ai-ship hooks into your uncommitted, staged files.
Basic Usage
Stage your files as usual (git add .), then draft an AI commit:
ai-ship commitNote: If you run
ai-ship commitwithout staging, AI-Ship will automatically rungit add -Afor you!
You can also pass specific files to be explicitly staged:
ai-ship commit src/index.ts src/utils/helper.tsAdvanced Pipeline Workflows
AI-Ship can condense the 5 basic Git commands down into one single instruction.
🔥 The Ultimate CLI Combo (Commit, Branch, Push, PR):
ai-ship commit --new-branch --push --pr --yesWhat this single command achieved:
- Auto-staged all tracked changes.
- Read the unified diff and generated a beautiful Commit Message.
- Examined that context and automatically made a new branch (e.g.,
feature/add-payment-gate). - Directly pushed the new upstream branch to origin.
- Invoked the
ghCLI to summarize the commit history into a Pull Request Description. - Auto-published the PR on GitHub without asking for manual confirmation (
--yes).
🎌 Command Flags
Append these arguments upon the commit hook to modify AI-Ship's behavior:
| Flag | Action |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| --new-branch | Analyzes commit context, drafts a semantic branch name, & securely checks it out. |
| --push | Triggers a git push. If there isn't an upstream anchor configured, securely configures tracking mappings for you. |
| --pr | Utilizes the GitHub CLI to publish an intelligent PR onto default target branches. Prompts interactions manually if omitted. |
| --target-branch <branch> | Manually overrides the base branch point targeting your --pr. |
| --yes | Headless execution. Skips interactive "Edit/Continue/Cancel" refinements and accepts the AI's first guess automatically. |
| --dry-run | Reads files, interfaces with the AI layer, and outputs responses without actually performing Git mutations. Great for observing syntax. |
| --model <provider> | Inline injection overriding the globally chosen logic model (e.g --model local or --model cloud). |
🤝 Contributing
Contributions are heavily welcomed!
- Fork the repository
- Implement your magic fix or feature branch (
git checkout -b feature/magic-fix) - Pass through Prettier & Typescript integrations by running
npm run build && npm run format - Use AI-Ship to push your PR logic gracefully.
- Submit your Pull Request.
If you locate any discrepancies or issues, please file a new GitHub Issue.
