Files
gp/README.md
j d3c867c556
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 6s
Build-Test-Publish / build (linux/arm64) (push) Successful in 12s
Add git config defaults for auto-yes and wait options
2026-03-09 07:17:37 +13:00

69 lines
2.2 KiB
Markdown

# gp - Git Push
Add, commit, and push in one command. Generates commit messages using Claude AI with a heuristic fallback.
## Install
```bash
getpkg install gp
```
## Usage
```bash
gp # Add all, auto-generate commit message, push
gp "Fix the parser" # Custom commit message
gp --dry-run # Preview without executing
gp --staged-only # Only commit staged changes
gp -y # Skip confirmations
gp -b develop # Push to a specific branch
gp --no-wait # Don't wait for CI after push
```
## Options
| Option | Description |
|--------|-------------|
| `-n, --dry-run` | Preview changes without executing |
| `-f, --force` | Skip all confirmations |
| `-y, --yes` | Auto-answer yes to prompts |
| `-a, --add-all` | Add all files including untracked (default) |
| `--staged-only` | Only commit staged changes |
| `-b, --branch` | Push to specified branch |
| `--no-wait` | Skip waiting for CI workflow |
## CI Workflow Monitoring
After pushing to a Gitea remote, `gp` automatically monitors the CI workflow progress, showing per-job status:
```
[INFO] Waiting for CI workflow... (press ESC to stop waiting)
✓ build (linux/amd64)
⠹ build (linux/arm64) running
· test-install (linux/amd64) queued
· test-install (linux/arm64) queued
```
- Press **ESC** at any time to stop waiting (CI continues in background)
- Requires a Gitea API token (extracted from the remote URL or `GITEA_TOKEN` env var)
- Automatically skipped for GitHub/GitLab remotes or when no token is available
- Use `--no-wait` to disable
## Config Defaults
Set per-repo or global defaults via git config:
```bash
git config gp.auto-yes true # Skip confirmations (like -y)
git config gp.wait false # Don't wait for CI (like --no-wait)
git config --global gp.auto-yes true # Apply globally
```
## Commit Message Generation
Uses Claude AI (`claude --print`) if available, otherwise falls back to heuristic analysis:
- Single file: `Add src/auth.py`, `Update README.md`, `Remove old_config.json`
- Multiple files: `feat: Add 2 and update 3 files`, `docs: Update 2 files`
- File type prefixes: `feat:`, `docs:`, `test:`, `config:`