Git workflow manager for feature branches using worktrees, shows you cli equivalent commands
Project description
worktreeflow
Git workflow manager for feature branches using worktrees.
Quick Start
Using Dev Container (Recommended)
The fastest way to get started is using the dev container, which provides a pre-configured environment with Python, uv, and git.
Option 1: VS Code Dev Containers
-
Prerequisites:
- Install Docker Desktop
- Install VS Code
- Install the Dev Containers extension
-
Open in Container:
# Clone the repository git clone https://github.com/smorinlabs/worktreeflow.git cd worktreeflow # Open in VS Code code .
-
Reopen in Container:
- VS Code will detect the
.devcontainerconfiguration - Click "Reopen in Container" when prompted (or use Command Palette:
Dev Containers: Reopen in Container) - Wait ~30 seconds for the container to build and start
- VS Code will detect the
-
Start Using:
./wtf --help ./wtf doctor
Option 2: GitHub Codespaces
- Go to the repository on GitHub
- Click the Code button → Codespaces tab → Create codespace on main
- Your browser opens with a fully configured VS Code environment
- Run
./wtf --helpto get started
Benefits: Zero local setup, works from any device with a browser.
Local Installation (Without Dev Container)
If you prefer to run locally without Docker:
-
Prerequisites:
- Python 3.9+
- uv package manager
-
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
-
Run the tool:
./wtf --helpThe script automatically installs its dependencies via uv on first run.
Usage
# Check your environment
./wtf doctor
# Sync your fork's main branch
./wtf sync-main
# Create a new feature worktree
./wtf wt-new my-feature
# Publish your branch
./wtf wt-publish my-feature
# Create a pull request
./wtf wt-pr my-feature
# Update worktree with upstream changes
./wtf wt-update my-feature
# Clean up worktree after merge
./wtf wt-clean my-feature --confirm
For detailed documentation, run:
./wtf --help
./wtf tutorial
./wtf quickstart
Installation from PyPI
Once published, you can install worktreeflow via pip or pipx:
# Using pipx (recommended for CLI tools)
pipx install worktreeflow
# Or using pip
pip install worktreeflow
# Or using uv
uv tool install worktreeflow
Then use either the wtf or worktreeflow command:
# Short form
wtf --help
wtf doctor
# Full name (same functionality)
worktreeflow --help
worktreeflow doctor
Development
Setting Up Development Environment
The dev container includes:
- Python 3.12
- uv package manager
- git (latest)
- VS Code extensions: Ruff, Python, Pylance
- Auto-formatting on save
All dependencies are automatically installed via the wtf script's inline metadata.
Git Hooks with Lefthook
This project uses Lefthook for pre-commit hooks (ruff check, ruff format, ty).
# Install lefthook (https://github.com/evilmartians/lefthook/blob/master/docs/install.md)
# macOS
brew install lefthook
# npm
npm install -g @evilmartians/lefthook
# Then activate hooks in your local clone
lefthook install
Common Dev Tasks (Makefile)
make help # Show all available targets
make test # Run tests
make lint # Run linting checks
make format # Auto-format code
make typecheck # Run ty type checking
make coverage # Run tests with coverage (35% threshold)
make build # Build the package
make clean # Remove build artifacts
make version # Show current version
make bump-patch # Bump patch version (0.3.0 → 0.3.1)
make bump-minor # Bump minor version (0.3.0 → 0.4.0)
make bump-major # Bump major version (0.3.0 → 1.0.0)
make release # Sync, commit, tag (run make bump-* first)
Shell Completions
The CLI supports auto-generated shell completions via Click:
# Bash - add to ~/.bashrc
eval "$(_WTF_COMPLETE=bash_source wtf)"
# Zsh - add to ~/.zshrc
eval "$(_WTF_COMPLETE=zsh_source wtf)"
# Fish - add to ~/.config/fish/completions/wtf.fish
_WTF_COMPLETE=fish_source wtf | source
Or generate completion scripts via make completions-bash, make completions-zsh, or make completions-fish.
Versioning and Releasing
Version bumping, tagging, and publishing are documented in RELEASE.md.
Quick reference:
make version # Show current version
make bump-patch # Bump patch version
make release # Commit and tag (run bump-* first, then push)
Dual Functionality
This package supports two usage patterns:
-
Standalone script (via uv shebang):
./wtf --helpDependencies are automatically installed from inline metadata.
-
Installed package (via PyPI):
pip install worktreeflow wtf --help # or worktreeflow --help
Dependencies are installed from
pyproject.toml. Bothwtfandworktreeflowcommands are available after installation.
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
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 worktreeflow-0.3.3.tar.gz.
File metadata
- Download URL: worktreeflow-0.3.3.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ea4e19119c183956f09e8cf5b3ee19aded48ecb5e20805de672f087ac173483
|
|
| MD5 |
80d1334bb3c33b403e1bd0969c83ba10
|
|
| BLAKE2b-256 |
70a05e8bea83b9a02b37fa6636a66c6a756ff0ad8cd3a2552fd0077ef79e6bb1
|
Provenance
The following attestation bundles were made for worktreeflow-0.3.3.tar.gz:
Publisher:
publish.yml on smorinlabs/worktreeflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
worktreeflow-0.3.3.tar.gz -
Subject digest:
3ea4e19119c183956f09e8cf5b3ee19aded48ecb5e20805de672f087ac173483 - Sigstore transparency entry: 1126161124
- Sigstore integration time:
-
Permalink:
smorinlabs/worktreeflow@b9d0169fbfd51337fa8dd407eb346820b78fa82e -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/smorinlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b9d0169fbfd51337fa8dd407eb346820b78fa82e -
Trigger Event:
push
-
Statement type:
File details
Details for the file worktreeflow-0.3.3-py3-none-any.whl.
File metadata
- Download URL: worktreeflow-0.3.3-py3-none-any.whl
- Upload date:
- Size: 30.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dde7bd32c928509dc2fb18894ad1c3fddc9cb2fa3098188c085075d99416f28
|
|
| MD5 |
8ca6043f524960fd25f57b0087854255
|
|
| BLAKE2b-256 |
5b1ab9fdfd243a3f36b9101093ed4d80b5cb2226ea8f0eefb309387660e9ded3
|
Provenance
The following attestation bundles were made for worktreeflow-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on smorinlabs/worktreeflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
worktreeflow-0.3.3-py3-none-any.whl -
Subject digest:
5dde7bd32c928509dc2fb18894ad1c3fddc9cb2fa3098188c085075d99416f28 - Sigstore transparency entry: 1126161179
- Sigstore integration time:
-
Permalink:
smorinlabs/worktreeflow@b9d0169fbfd51337fa8dd407eb346820b78fa82e -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/smorinlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b9d0169fbfd51337fa8dd407eb346820b78fa82e -
Trigger Event:
push
-
Statement type: