Skip to content

Repository files navigation

pushit

AI-powered git commits with a beautiful terminal UI

Bun TypeScript OpenRouter Conventional Commits License: MIT

Generate conventional commit messages from your changes and optionally push to remote.


Features

Feature Description
Interactive CLI Spinners and styled prompts powered by @clack/prompts
File Status Preview Shows files with status and colored diff stats (+insertions / -deletions)
Auto-staging Automatically stages all changes before analysis
Rich Context Git diff, file contents (up to 500 lines), branch parsing
Smart Branch Parsing Extracts issue numbers from branch names
Style Matching Uses recent commit history to match your style
Conventional Commits Generates standardized commit messages via OpenRouter API
Smart Push Shows "Commit and push" only when a remote exists
Safe Git Handling Blocks conflicted Git states and restores your original staging on cancel or pre-commit failure

Installation

curl -fsSL https://raw.githubusercontent.com/maty-millien/pushit/main/install.sh | bash

This installs Bun (if needed), prompts for your OpenRouter API key, builds the binary, and installs it to ~/.local/bin.

Manual installation

Prerequisites: Bun runtime

git clone https://github.com/maty-millien/pushit
cd pushit
bun install
bun run setup

Copy .env.example to ~/.config/pushit/.env and add your API key.

Usage

pushit            # Normal mode
pushit --dry-run  # Test without committing

Git Safety

pushit checks the repository before staging or calling the AI provider. It stops with recovery commands if a merge, rebase, cherry-pick, revert, or unmerged conflict is in progress.

When pushit auto-stages changes, it snapshots the index first. If you cancel, message generation fails, analysis fails, or the commit fails, your original staged selection is restored. If a commit succeeds but push fails, the local commit is kept, the push error is explained, and the command exits with a failure status.

Example Output

│
◇  Changes staged
│
◇  Analysis complete
│
│  Changes
│    M  src/index.ts           +45 -12
│    A  src/utils/helper.ts    +128
│    D  src/old-file.ts             -89
│
◇  Message generated
│
✦  feat(utils): add helper module and refactor index
│
◇  What would you like to do?
│  Commit and push to main
│
◇  Commit created
│
◇  Changes pushed successfully!

Development

Command Description
bun run dev Run in development mode
bun run lint Lint with ESLint
bun run typecheck Type check with TypeScript
bun run format Format with Prettier
bun run build Build native executable
bun run setup Build and install to ~/.local/bin

Requirements

About

AI-powered git commits with a beautiful terminal UI

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Contributors

Languages