A command-line tool for publishing Git repository changes to WordPress.
Project description
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
- Make sure you have Python 3.7+ installed
- 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
- Clone the repository
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install development dependencies:
pip install -e .[dev]
License
MIT
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
git2wp-0.1.0.tar.gz
(4.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git2wp-0.1.0.tar.gz.
File metadata
- Download URL: git2wp-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.17 Linux/6.14.9-300.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa4aa772db446ad7d6a2f92244631aced5876f5a5a06866f9a9585c9bb59d5e0
|
|
| MD5 |
ebc995d7cf83d41879dfa939fb3a9423
|
|
| BLAKE2b-256 |
eb2951d0984633fd5bd299b61fa9e89b2a0ab25c51870a6b3c2eefdc9151fbd5
|
File details
Details for the file git2wp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git2wp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.10.17 Linux/6.14.9-300.fc42.x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19b79ce3c22d8a56f0a887e7d114276a78c06eb8fcd62b4f00a2164434713f42
|
|
| MD5 |
b2df918a9d3d31ece560c57e3cb26e86
|
|
| BLAKE2b-256 |
ecd1e4ae1a55790e1c10922f35ef8ec35f58aaca822c11eb530e4785f81762d4
|