
- Add comprehensive Git workflow automation tools - Include branch management utilities - Add commit helpers with conventional commit support - Implement GitHub integration for PR management - Add configuration management system - Include comprehensive test coverage - Add professional documentation and examples
159 lines
3.2 KiB
Markdown
159 lines
3.2 KiB
Markdown
# Git Automation CLI
|
|
|
|
A fast, practical Go CLI to automate frequent Git workflows. It provides utilities for branch management, commit helpers, sync operations, and integration with GitHub for pull requests and team coordination.
|
|
|
|
## Features
|
|
|
|
- Branch utilities (create, switch, list)
|
|
- Commit helpers (with conventional commit support)
|
|
- Sync with remote (fetch, rebase, push)
|
|
- Clean local feature branches
|
|
- GitHub integration (create, list, merge pull requests)
|
|
- Configuration management
|
|
- Version information
|
|
|
|
## Installation
|
|
|
|
### From Source
|
|
|
|
```bash
|
|
git clone https://github.com/iwasforcedtobehere/git-automation-cli.git
|
|
cd git-automation-cli
|
|
go build -o gitauto ./cmd/gitauto
|
|
```
|
|
|
|
### Using Go Install
|
|
|
|
```bash
|
|
go install github.com/iwasforcedtobehere/git-automation-cli/cmd/gitauto@latest
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Before using GitHub integration features, you need to configure your GitHub token:
|
|
|
|
```bash
|
|
# Set your GitHub token
|
|
gitauto config set github.token YOUR_GITHUB_TOKEN
|
|
|
|
# Set default branch (optional, defaults to 'main')
|
|
gitauto config set default.branch main
|
|
|
|
# Set default remote (optional, defaults to 'origin')
|
|
gitauto config set default.remote origin
|
|
```
|
|
|
|
## Usage
|
|
|
|
### General Commands
|
|
|
|
```bash
|
|
# Show help
|
|
gitauto help
|
|
|
|
# Show version
|
|
gitauto version
|
|
|
|
# Show configuration
|
|
gitauto config list
|
|
```
|
|
|
|
### Branch Management
|
|
|
|
```bash
|
|
# Create a new branch
|
|
gitauto branch create feature/new-feature
|
|
|
|
# Switch to an existing branch
|
|
gitauto branch switch main
|
|
|
|
# List all branches
|
|
gitauto branch list
|
|
```
|
|
|
|
### Commit Helpers
|
|
|
|
```bash
|
|
# Create a commit with a message
|
|
gitauto commit create "feat: add new feature"
|
|
|
|
# Create a commit with a body
|
|
gitauto commit create "feat: add new feature" --body "This commit adds a new feature that allows users to..."
|
|
|
|
# Create a commit with sign-off
|
|
gitauto commit create "feat: add new feature" --signoff
|
|
```
|
|
|
|
### Sync Operations
|
|
|
|
```bash
|
|
# Sync current branch with its upstream and push
|
|
gitauto sync
|
|
|
|
# Dry run to see what would be done
|
|
gitauto sync --dry-run
|
|
```
|
|
|
|
### Clean Local Branches
|
|
|
|
```bash
|
|
# Clean local feature branches
|
|
gitauto clean
|
|
|
|
# Dry run to see what would be deleted
|
|
gitauto clean --dry-run
|
|
```
|
|
|
|
### Pull Request Operations
|
|
|
|
```bash
|
|
# Create a new pull request
|
|
gitauto pr create "feat: add new feature"
|
|
|
|
# Create a draft pull request
|
|
gitauto pr create "feat: add new feature" --draft
|
|
|
|
# Create a pull request with a custom base branch
|
|
gitauto pr create "feat: add new feature" --base develop
|
|
|
|
# List open pull requests
|
|
gitauto pr list
|
|
|
|
# List closed pull requests
|
|
gitauto pr list --state closed
|
|
|
|
# Merge a pull request
|
|
gitauto pr merge 42
|
|
|
|
# Merge a pull request with squash method
|
|
gitauto pr merge 42 --method squash
|
|
```
|
|
|
|
## Global Flags
|
|
|
|
All commands support the following global flags:
|
|
|
|
```bash
|
|
--dry-run # Dry run mode (no changes made)
|
|
-v, --verbose # Verbose output
|
|
-h, --help # Help for the command
|
|
```
|
|
|
|
## Requirements
|
|
|
|
- Go 1.22+
|
|
- Git installed and available in PATH
|
|
- GitHub token for GitHub integration features
|
|
|
|
## Contributing
|
|
|
|
1. Fork the repository
|
|
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
3. Commit your changes (`git commit -m 'feat: add amazing feature'`)
|
|
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
5. Open a Pull Request
|
|
|
|
## License
|
|
|
|
MIT
|