Skip to main content

Git2WP CLI

A command-line tool for publishing Git repository changes to WordPress.

Features

  • Publish Git commits to WordPress as posts
  • Test WordPress connection
  • Dry-run mode to preview changes
  • Support for different post statuses (draft, publish, pending, private)
  • Colorful terminal output with rich formatting
  • Environment-based configuration
  • Git repository validation
  • Detailed commit information display
  • Changed files tracking

Installation

  1. Make sure you have Python 3.7+ installed
  2. Install the package in development mode:
pip install -e .

Or install it globally:

pip install git+https://github.com/yourusername/git2wp.git

Configuration

Create a .env file in your home directory under ~/.config/git2wp/ with the following variables:

WORDPRESS_URL=https://your-wordpress-site.com
WORDPRESS_USERNAME=your-username
WORDPRESS_PASSWORD=your-password
# OR use an application password
# WORDPRESS_TOKEN=your-application-password

# Optional: Default path to look for Git repositories
GIT_PATH=~/repos

Usage

# Publish the latest commit from a repository
git2wp publish /path/to/your/repo

# Publish a specific commit
git2wp publish /path/to/your/repo --commit abc1234

# Publish as a published post (default is draft)
git2wp publish /path/to/your/repo --status publish

# Dry run (show what would be published)
git2wp publish /path/to/your/repo --dry-run

# Test WordPress connection
git2wp test-connection

# Show help
git2wp --help

Development

  1. Clone the repository
  2. Create a virtual environment:
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install development dependencies:
    pip install -e .[dev]
    

License

MIT

Metadata

Release files for git2wp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git2wp 0.1.0
File Size Uploaded
git2wp-0.1.0.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git2wp 0.1.0
File Interpreter ABI Platform
git2wp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / git2wp-0.1.0.tar.gz

Download URL git2wp-0.1.0.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fa4aa772db446ad7d6a2f92244631aced5876f5a5a06866f9a9585c9bb59d5e0
BLAKE2b-256 checksum
How to use checksums
eb2951d0984633fd5bd299b61fa9e89b2a0ab25c51870a6b3c2eefdc9151fbd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.10.17 Linux/6.14.9-300.fc42.x86_64

Release files / git2wp-0.1.0-py3-none-any.whl

Download URL git2wp-0.1.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19b79ce3c22d8a56f0a887e7d114276a78c06eb8fcd62b4f00a2164434713f42
BLAKE2b-256 checksum
How to use checksums
ecd1e4ae1a55790e1c10922f35ef8ec35f58aaca822c11eb530e4785f81762d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.10.17 Linux/6.14.9-300.fc42.x86_64

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page