Skip to main content

Git worktree workflow manager for feature development

Project description

fwts

PyPI version License: MIT

Git worktree workflow manager for feature development. Automates creating worktrees, tmux sessions, docker services, and more.

Why fwts? When working on multiple features simultaneously, git worktrees let you have separate working directories for each branch. fwts automates the tedious parts: creating worktrees, spinning up tmux sessions, managing docker services, and switching shared resources between features.

Features

  • Worktree Management - Create and manage git worktrees for parallel feature development
  • Focus Switching - Claim shared resources (DB ports, etc.) for one worktree at a time
  • Multi-Project Support - Manage multiple repos with named projects in global config
  • Tmux Integration - Automatic session creation with editor and side command (e.g., Claude)
  • Docker Compose - Start/stop isolated docker services per feature
  • Linear Integration - Resolve ticket IDs to branch names
  • GitHub Integration - Resolve PR numbers to branches
  • Graphite Support - Optional stacking workflow integration
  • Interactive TUI - Rich terminal UI for viewing and managing worktrees
  • Programmable Columns - Custom hooks for CI status, review status, etc.
  • Shell Completions - bash, zsh, and fish support

Installation

From Homebrew (macOS)

brew install laudiacay/tap/fwts

From PyPI

pip install fwts
# or with uv
uv tool install fwts

Quick Start

  1. Initialize global configuration:
fwts init --global
# Edit ~/.config/fwts/config.toml to add your projects
  1. Or initialize per-repo configuration:
cd ~/code/myproject
fwts init
# Edit .fwts.toml to configure
  1. Start working on a feature:
# From a Linear ticket
fwts start SUP-123

# From a GitHub PR
fwts start #456

# From a branch name
fwts start feature/my-feature

# Interactive mode - pick from existing worktrees
fwts start
  1. View all worktrees:
# Interactive TUI
fwts status

# Simple list
fwts list
  1. Focus on a worktree (claim shared resources):
# Focus on a branch
fwts focus feature/my-feature

# Show current focus
fwts focus

# Clear focus
fwts focus --clear
  1. Clean up when done:
fwts cleanup feature/my-feature
# Or interactively
fwts cleanup

Configuration

Global Config (Multi-Project)

Create ~/.config/fwts/config.toml for managing multiple projects:

# Default project when not in a project directory
default_project = "myproject"

[projects.myproject]
name = "myproject"
main_repo = "~/code/myproject"
worktree_base = "~/code/myproject-worktrees"
base_branch = "main"
github_repo = "username/myproject"

[projects.myproject.focus]
on_focus = ["just docker expose-db"]

[projects.another]
name = "another"
main_repo = "~/code/another"
worktree_base = "~/code/another-worktrees"
base_branch = "dev"

Per-Repo Config

Create .fwts.toml in your repo root:

[project]
name = "myproject"
main_repo = "~/code/myproject"
worktree_base = "~/code/myproject-worktrees"
base_branch = "main"
github_repo = "username/myproject"

[linear]
enabled = true
# LINEAR_API_KEY from environment

[graphite]
enabled = false
trunk = "main"

[tmux]
editor = "nvim ."
side_command = "claude"
layout = "vertical"

[lifecycle]
on_start = ["just up"]
on_cleanup = ["just down"]

[focus]
# Commands to run when this worktree gains focus
on_focus = ["just docker expose-db"]
# Commands to run when this worktree loses focus
on_unfocus = []

# Per-branch pattern overrides
[focus.overrides."feature-*"]
on_focus = ["just docker expose-db", "just connect dev-tunnel"]

[symlinks]
paths = [".env.local"]

[docker]
enabled = true
compose_file = "docker-compose.dev.yml"

# Custom TUI columns
[[tui.columns]]
name = "CI"
hook = "gh run list --branch $BRANCH_NAME --limit 1 --json conclusion -q '.[0].conclusion'"
color_map = { success = "green", failure = "red", pending = "yellow" }

Per-Worktree Config

Create .fwts.local.toml in a worktree to override settings for that specific worktree. This file should be gitignored.

Config Hierarchy

Configuration is loaded and merged in this order (later overrides earlier):

  1. ~/.config/fwts/config.toml (global)
  2. <main_repo>/.fwts.toml (per-repo)
  3. <worktree>/.fwts.local.toml (per-worktree)

Commands

Command Description
fwts start [input] Start or resume a feature worktree
fwts cleanup [input] Clean up worktree, tmux, docker
fwts status Interactive TUI dashboard
fwts list Simple worktree list
fwts focus [branch] Switch focus to a worktree
fwts projects List configured projects
fwts init Initialize config file
fwts init --global Initialize global config
fwts completions <shell> Generate shell completions

Global Options

All commands support:

  • --project, -p - Use a specific named project from global config
  • --config, -c - Use a specific config file

Aliases

fb is an alias for fwts:

fb start SUP-123
fb status
fb focus my-feature

TUI Keyboard Shortcuts

Key Action
j / Move down
k / Move up
space Toggle selection
a Select all
enter Launch selected
f Focus selected
d Cleanup selected
r Refresh
q Quit

Focus Switching

Focus allows one worktree to "claim" shared resources like database ports. This is useful when:

  • Multiple worktrees share localhost ports (e.g., postgres:5432)
  • You need to switch your database GUI between worktrees
  • External tools need to connect to the "current" worktree's services

Configure focus commands in your config:

[focus]
on_focus = ["just docker expose-db"]  # Run when gaining focus
on_unfocus = ["echo 'Releasing resources'"]  # Run when losing focus

Only one worktree per project can have focus at a time. The TUI shows focus status with a ◉ indicator.

Shell Completions

# Bash
eval "$(fwts completions bash)"

# Zsh
eval "$(fwts completions zsh)"

# Fish
fwts completions fish > ~/.config/fish/completions/fwts.fish

Environment Variables

Variable Description
LINEAR_API_KEY Linear API key for ticket integration

Requirements

  • Python 3.10+
  • git
  • tmux
  • gh (GitHub CLI) - optional, for PR integration
  • gt (Graphite) - optional, for stacking workflow

License

MIT

Project details


Download files

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

Source Distribution

fwts-0.1.11.tar.gz (64.9 kB view details)

Uploaded Source

Built Distribution

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

fwts-0.1.11-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file fwts-0.1.11.tar.gz.

File metadata

  • Download URL: fwts-0.1.11.tar.gz
  • Upload date:
  • Size: 64.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fwts-0.1.11.tar.gz
Algorithm Hash digest
SHA256 370ea4e74b36d73f71b7a9b1cc9ec2ba3e0fc6b3959a4095fa70df77f58533ea
MD5 df6519f4569e0021b35cc6dfd0a723d6
BLAKE2b-256 fb3a4b9426e74259a69c93a779c8a94b4e3e8df95157b598ab1cc02f5510ebcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for fwts-0.1.11.tar.gz:

Publisher: release.yml on laudiacay/featurebox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fwts-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: fwts-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fwts-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 36031f42a2b9e1c214e28aca516a65d045d5a19d054c3c69eb8a23aca06bd5a2
MD5 38b55f5cf87b03d3e123011ddcb5b2eb
BLAKE2b-256 a3842dda926d0bd02030bcedc1e921679446648cb167289769501e7cfd580e79

See more details on using hashes here.

Provenance

The following attestation bundles were made for fwts-0.1.11-py3-none-any.whl:

Publisher: release.yml on laudiacay/featurebox

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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