59 lines
1.9 KiB
Markdown
59 lines
1.9 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
|
|
|
|
## 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:`
|