Skip to main content

Automated git push with smart commit messages, changelog updates, and version tagging

Project description

Goal

Automated git push with smart commit messages, changelog updates, version tagging, and interactive workflow.

Features

  • 🚀 Interactive workflow - Confirms each stage (test, commit, push, publish) with Y/n prompts
  • 🧠 Smart commit messages - Generates conventional commits based on diff analysis
  • 📦 Multi-language support - Python, Node.js, Rust, Go, Ruby, PHP, .NET, Java
  • 🏷️ Version management - Automatic version bumping and synchronization across project files
  • 📝 Changelog updates - Maintains CHANGELOG.md with version history
  • 🐳 CI/CD ready - --yes flag for automated workflows
  • 🧪 Test integration - Runs project-specific test commands before committing
  • 📦 Publish support - Publishes to package managers (PyPI, npm, crates.io, etc.)

Installation

pip install goal

Quick Start

1. Initialize your repository

goal init

Creates VERSION and CHANGELOG.md files if they don't exist.

2. Run the interactive workflow

goal

This will guide you through:

  • ✅ Run tests? [Y/n]
  • ✅ Commit changes? [Y/n]
  • ✅ Push to remote? [Y/n]
  • ✅ Publish version X.X.X? [Y/n]

Press Enter to accept the default (Yes) for any step.

Usage Examples

Basic interactive workflow

# Run full interactive workflow with default patch bump
goal

# Run with minor version bump
goal --bump minor

# Run without prompts (for CI/CD)
goal --yes

# Automate ALL stages without any prompts
goal --all

Using the push command directly

# Interactive push with prompts
goal push

# Split commits by change type (docs/code/ci/examples)
goal push --split

# Split + auto (CI style)
goal push --split --yes

# Split + add ticket prefix
goal push --split --ticket ABC-123

# Automatic push without prompts
goal push --yes

# Dry run to see what would happen
goal push --dry-run

# Custom commit message
goal push -m "feat: add new authentication system"

# Skip specific steps
goal push --no-tag --no-changelog

Version management

# Check current version
goal version

# Bump specific version type
goal version --bump minor
goal version --bump major

# Check repository status
goal status

Supported Project Types

Goal automatically detects your project type and uses appropriate commands:

Language Test Command Publish Command Version Files
Python pytest python -m build && twine upload dist/* pyproject.toml, setup.py
Node.js npm test npm publish package.json
Rust cargo test cargo publish Cargo.toml
Go go test ./... git push origin --tags go.mod (uses git tags)
Ruby bundle exec rspec gem build *.gemspec && gem push *.gem *.gemspec
PHP composer test composer publish composer.json
.NET dotnet test dotnet pack && dotnet nuget push *.nupkg *.csproj
Java mvn test mvn deploy pom.xml, build.gradle

Markdown Output

Goal outputs structured markdown by default (perfect for LLM consumption and CI/CD logs). Use --ascii to get the legacy console output.

# Default: markdown output
goal push
goal status

# Force legacy output
goal push --ascii
goal status --ascii

# Use with automation
goal --all > release.log

The markdown output includes:

  • Front matter with metadata (command, version, file count)
  • Structured sections for overview, files, and test results
  • Code blocks for command outputs
  • Summary with actions taken and next steps

Example output:

---
command: goal push
project_types: ["python"]
version_bump: "1.0.1 -> 1.0.2"
file_count: 7
---

# Goal Push Result

## Overview
**Project Type:** python
**Files Changed:** 7 (+1140/-99 lines)
**Version:** 1.0.1 → 1.0.2
...

See docs/markdown-output.md for detailed examples.

Command Reference

goal or goal push

Main command for the complete workflow.

Options:

  • --bump, -b: Version bump type [patch|minor|major] (default: patch)
  • --yes, -y: Skip all prompts (run automatically)
  • --all, -a: Automate all stages including tests, commit, push, and publish
  • --markdown/--ascii: Output format (default: markdown)
  • --split: Create separate commits per change type (docs/code/ci/examples)
  • --ticket: Ticket prefix to include in commit titles (overrides TICKERT)
  • --no-tag: Skip creating git tag
  • --no-changelog: Skip updating changelog
  • --no-version-sync: Skip syncing version to project files
  • --message, -m: Custom commit message
  • --dry-run: Show what would be done without doing it

Split commits (per type)

When --split is enabled, Goal will create multiple commits:

  • code: changes in goal/, src/, lib/, *.py
  • docs: docs/*, README.md, *.md
  • ci: .github/*, .gitlab/*, *.yml/*.yaml
  • examples: examples/*
  • other: everything else

Then it will create a final release metadata commit with version bump + changelog (unless disabled).

Ticket prefixing (TICKET)

Create a TICKET file in repository root:

prefix=ABC-123
format=[{ticket}] {title}

You can override it per run:

goal push --ticket ABC-123
goal push --split --ticket ABC-123
goal commit --ticket ABC-123

goal init

Initialize goal in current repository.

Creates:

  • VERSION file with initial version 1.0.0
  • CHANGELOG.md with standard template

goal status

Show current git status and version info.

Displays:

  • Current version
  • Current branch
  • Staged files
  • Unstaged/untracked files

goal version

Show or bump version.

Options:

  • --type, -t: Version bump type [patch|minor|major] (default: patch)

Examples by Use Case

Development Workflow

# Make your changes...
git add some/files

# Run goal with interactive prompts
goal

# Prompts will appear:
# Run tests? [Y/n] - Runs pytest for Python projects
# Commit changes? [Y/n] - Creates smart commit message
# Push to remote? [Y/n] - Pushes to origin with tags
# Publish version 1.2.3? [Y/n] - Publishes to PyPI/npm/etc

Full Automation

# Automate everything - tests, commit, push, publish
goal --all

# Short form
goal -a

# With specific version bump
goal --all --bump minor

CI/CD Pipeline

# GitHub Actions example
- name: Deploy with Goal
  run: |
    goal push --yes --bump minor
    
# Or with --all flag
- name: Full release
  run: |
    goal --all --bump patch

Skip Testing in Quick Fixes

# Skip tests for documentation changes
goal push --yes -m "docs: update README"

Pre-release Workflow

# Check what will be done
goal push --dry-run --bump minor

# Run with specific version bump
goal push --bump minor

# Or skip publishing for internal releases
goal push --yes --no-tag

Configuration

Goal requires no configuration files. It works based on conventions:

  1. Version detection: Looks for VERSION file first, then project-specific files
  2. Project detection: Automatically detects project type from files
  3. Commit messages: Uses conventional commit format based on diff analysis
  4. Changelog: Updates CHANGELOG.md in Keep a Changelog format

Integration Examples

Makefile

.PHONY: release patch minor major

# Interactive release
release:
	goal

# Automatic patch release
patch:
	goal push --yes

# Full automation release
all:
	goal --all

# Automatic minor release
minor:
	goal push --yes --bump minor

# Automatic major release
major:
	goal push --yes --bump major

# Dry run
dry-run:
	goal push --dry-run

package.json scripts

{
  "scripts": {
    "release": "goal",
    "release:patch": "goal push --yes",
    "release:all": "goal --all",
    "release:minor": "goal push --yes --bump minor",
    "release:major": "goal push --yes --bump major"
  }
}

pre-commit hook

#!/bin/sh
# .git/hooks/pre-commit
goal push --dry-run

Smart Commit Messages

Goal analyzes your changes to generate appropriate commit messages:

  • feat: New features, additions
  • fix: Bug fixes, patches
  • docs: Documentation changes
  • style: Formatting, linting
  • refactor: Code restructuring
  • perf: Performance improvements
  • test: Test additions/changes
  • build: Build system, CI/CD
  • chore: Dependencies, maintenance

Examples:

  • feat: add user authentication
  • fix: resolve memory leak in parser
  • docs: update API documentation
  • test: add coverage for payment module

Troubleshooting

Tests fail but I want to continue

The interactive workflow will ask if you want to continue when tests fail:

Tests failed. Continue anyway? [y/N]

Custom test/publish commands

If Goal doesn't detect your test command correctly, you can run them manually before using goal push --yes.

Publishing fails

Ensure you're authenticated with the appropriate package manager:

  • PyPI: twine configure or use __token__
  • npm: npm login
  • crates.io: cargo login

License

Apache License 2.0

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

goal-1.0.2.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

goal-1.0.2-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file goal-1.0.2.tar.gz.

File metadata

  • Download URL: goal-1.0.2.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for goal-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9d8853fbaaa49e5befd3b77f95cbfbc0eaccb9262812ba5bf19f01aadb96e1fc
MD5 6826f0bb8e129b491d6af9d808f35e70
BLAKE2b-256 b197f0373cc7915f2a5ff6fe5b047fe67a8bc8fe246ef522aaebaa62794d8ee5

See more details on using hashes here.

File details

Details for the file goal-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: goal-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for goal-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0eb1a5695834d1d9c82e32a1d8850cb440a260bac0b8169709ede6f7cc0cb98f
MD5 baff20129f79259e7fe3f91f16d7d579
BLAKE2b-256 23d5d181f981d3ba11fcf9312ef075445e2446854e85d242cebd8994e3d86fbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page