Skip to content

erishforG/git-parsec

Repository files navigation

git-parsec

Crates.io License: MIT CI

From ticket to PR. One command. Git worktree lifecycle manager โ€” isolated workspaces tied to your tickets, with stacked PRs, multi-forge support, and clean shipping.

demo

$ parsec start PROJ-1234     # creates worktree, fetches Jira title, sets up branch
$ parsec ship PROJ-1234      # pushes, opens PR, cleans worktree

That's the whole loop. Plain git worktree doesn't track state, doesn't talk to your tracker, doesn't open PRs, doesn't clean up. parsec does.


Why use it

  • No index.lock collisions โ€” every workspace has its own .git/index, so multiple developers (or AI agents) can run git add on the same repo at the same time.
  • One command per phase โ€” start (worktree + tracker fetch), ship (push + PR + cleanup), merge (merge + branch cleanup), clean (sweep merged branches). No web UI round-trips.
  • Stacked PRs that don't melt your brain โ€” parsec start FOO --on BAR chains workspaces; parsec stack --submit opens the whole stack in topological order with auto-posted "โ† prev / next โ†’" navigation comments.
  • Cross-worktree conflict detection โ€” parsec conflicts flags files modified in two workspaces before anyone pushes.
  • Multi-forge โ€” GitHub, GitLab, Bitbucket Cloud. Multi-tracker โ€” Jira, GitHub Issues, GitLab Issues, Bitbucket.
  • Agent-friendly โ€” --json on every command, structured error codes, JSONL execution log, headless/offline modes.

Roadmap

Vision: parsec = AI agents + human devs both โ€” worktree-native git CLI.

Milestone Status Theme
v0.4.0 โœ… Released (2026-05-04) Multi-forge + multi-tracker foundation (GitHub / GitLab / Bitbucket; Jira / Linear)
v0.5.0 โ€” The visualization release โœ… Released (2026-06-03) smartlog ยท TUI dashboard ยท speculative merge ยท parsec test ยท health ยท reviews ยท AI PR descriptions
v1.0 โ€” AI-Native Standard ๐Ÿšง Next MCP server signature โ€” Claude / Cursor / Copilot invoke parsec as a first-class tool
v2.0+ โ€” Ecosystem Hub ๐Ÿ”ฎ Plugins ยท VS Code extension ยท Linear-native tracker ยท org-scale workflows

v1.0 work is tracked under the v1.0 milestone; see the CHANGELOG for the full v0.5.0 release notes.


Install

# Homebrew / pre-built binary (recommended)
curl -LO https://github.com/erishforG/git-parsec/releases/latest/download/parsec-x86_64-unknown-linux-gnu.tar.gz
tar xzf parsec-*.tar.gz && sudo mv parsec /usr/local/bin/

# Cargo (Rust toolchain required)
cargo install git-parsec

Other targets (macOS arm64/x86_64, Windows x86_64) ship on every release โ€” see Releases. After install, run parsec config init for the interactive first-time setup, then parsec doctor to validate.

Shell completion

parsec ships dynamic completion scripts that suggest live worktrees and branches as you type (e.g. parsec switch <Tab> lists your active tickets).

# zsh โ€” copy to a site fpath dir, or add the repo path to fpath:
cp completions/_parsec ~/.zsh/completions/      # then: fpath=(~/.zsh/completions $fpath)

# bash:
source completions/parsec.bash                  # or symlink into /etc/bash_completion.d/

# fish:
cp completions/parsec.fish ~/.config/fish/completions/

A purely static fallback (no live candidates) is also available via parsec config completions <shell> if you'd rather not source the dynamic scripts.


60-second tour

# Pull a ticket from Jira / GitHub / GitLab / Bitbucket and start work
$ parsec start PROJ-1234
โœ“ Worktree: ../myapp.PROJ-1234
  Title:    Add rate limiting (fetched from Jira)
  Branch:   feature/PROJ-1234

# See everything in flight
$ parsec list
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ Ticket    โ”‚ Branch            โ”‚ Status โ”‚ Path                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ PROJ-1234 โ”‚ feature/PROJ-1234 โ”‚ active โ”‚ ../myapp.PROJ-1234      โ”‚
โ”‚ PROJ-5678 โ”‚ feature/PROJ-5678 โ”‚ active โ”‚ ../myapp.PROJ-5678      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

# Hop in (shell integration auto-cd's)
$ parsec switch PROJ-1234

# Make commits the normal way, then ship โ€” push + PR + cleanup in one shot
$ parsec ship PROJ-1234
โœ“ Pushed feature/PROJ-1234
โœ“ PR opened: github.com/org/repo/pull/42
โœ“ Worktree cleaned up

# Watch CI without leaving the terminal
$ parsec ci PROJ-1234 --watch

# Merge from terminal once CI is green
$ parsec merge PROJ-1234

Top features

๐ŸŒฟ Stacked PRs that don't melt your brain

$ parsec start PROJ-2 --on PROJ-1   # new worktree on top of PROJ-1's branch
$ parsec stack --submit              # open all PRs in the stack, root first

parsec auto-posts โ† previous PR / next PR โ†’ navigation comments so reviewers can walk the chain.

๐Ÿ”„ Multi-forge, multi-tracker

  • Forges: GitHub ยท GitLab ยท Bitbucket Cloud (full PR lifecycle on each)
  • Trackers: Jira ยท GitHub Issues ยท GitLab Issues ยท Bitbucket
  • CI status: GitHub Actions ยท GitLab CI ยท Bitbucket Pipelines

parsec ci and pr-status work the same shape across all of them.

๐Ÿค– Agent-friendly by design

Every command has --json. Errors emit structured codes (E001โ€ฆE013). parsec log --export outputs JSONL with execution IDs and per-step timing for tooling/agents to consume. --offline and [behavior].offline config skip all network ops for air-gapped or CI environments.

๐Ÿงน Lifecycle hygiene

parsec clean sweeps worktrees for already-merged branches. parsec conflicts flags cross-worktree file overlap before you push. parsec undo reverses the last operation (start, ship, clean). parsec doctor validates every part of your setup with actionable fix instructions.

๐Ÿ“‚ Worktree build cache sharing

[worktree].shared_cache = ["target", "node_modules", ".venv"] lets new worktrees reuse the main repo's caches via symlink (default) or copy. Eliminates cold-build cost on parsec start for any project with significant dependency caches.

๐Ÿ“‹ Sprint board + issue creation

parsec board turns your active sprint into a Kanban board in the terminal. parsec create and parsec new-issue open issues in your tracker without leaving the shell.

๐ŸŒŒ Visualization & power-user tools (new in v0.5)

  • parsec smartlog (alias sl) โ€” ASCII commit DAG of every active worktree with PR / CI overlay.
  • parsec dashboard (alias dash) โ€” real-time TUI panel showing worktrees, CI, and PRs in one screen (ratatui + crossterm).
  • parsec health โ€” lock / uncommitted / stale / CI checks across every worktree, with a configurable stale threshold.
  • parsec reviews โ€” open PR reviews you've received vs. requested, unified across worktrees.
  • parsec conflicts --simulate โ€” in-memory three-way merge to surface real line-level conflicts before you push (worktree-vs-base + cross-worktree pairs, read-only).
  • parsec test โ€” run tests in parallel across worktrees with tree-hash result caching (--all --jobs N --cache).
  • parsec commit โ€” AI-generated commit messages from staged diff (OpenAI / Anthropic, --conventional for Conventional Commits).
  • parsec sync โ€” fast-forward stale worktrees against origin/<base> (rebase or merge, --all, --dry-run).

33+ commands total โ€” see the full command reference for every flag and example.

Each PR body includes a stack navigation table:

Ticket Branch
โฌ† Parent PROJ-1 feature/PROJ-1
โžก Current PROJ-2 feature/PROJ-2
โฌ‡ Child PROJ-3 feature/PROJ-3

Configuration (minimal example)

# ~/.config/parsec/config.toml
#:schema https://json.schemastore.org/parsec.json

[workspace]
layout         = "sibling"      # ../repo.ticket/  (alt: "internal")
branch_prefix  = "feature/"
offline        = false           # true = skip all network ops

[tracker]
provider = "jira"               # jira | github | gitlab | bitbucket | none

[tracker.jira]
base_url = "https://yourcompany.atlassian.net"
# Auth: PARSEC_JIRA_TOKEN env var

[ship]
auto_pr      = true
auto_cleanup = true
draft        = false             # true = open PRs as drafts
# template   = ".github/PULL_REQUEST_TEMPLATE.md"

[worktree]
shared_cache    = ["target", "node_modules", ".venv"]
cache_strategy  = "symlink"      # alt: "copy"

Auth tokens (set via env vars, all optional):

PARSEC_JIRA_TOKEN       PARSEC_GITHUB_TOKEN       PARSEC_GITLAB_TOKEN
PARSEC_BITBUCKET_TOKEN  GITHUB_TOKEN (fallback)   GITLAB_TOKEN (fallback)
PARSEC_OFFLINE=1        โ€” force offline mode globally

Full schema and every option: parsec config schema (also published to schemastore.org).


Comparison

parsec GitButler worktrunk git worktree git-town
Tracker integration Jira + GitHub + GitLab + Bitbucket โ€” โ€” โ€” โ€”
Physical worktree isolation โœ… โŒ (virtual) โœ… โœ… โŒ
Cross-worktree conflict detection โœ… n/a โŒ โŒ โŒ
One-step ship (push + PR + cleanup) โœ… โŒ โŒ โŒ โœ…
Forges GitHub + GitLab + Bitbucket Both GitHub โ€” GitHub, GitLab, Gitea, Bitbucket
CI integrations Actions + GitLab CI + Bitbucket Pipelines โ€” โ€” โ€” โ€”
Operation log + undo โœ… โœ… โŒ โŒ partial
JSON output โœ… โœ… โŒ โŒ โŒ
Stacked PRs โœ… โœ… โŒ โŒ โœ…
GUI CLI only Desktop + TUI CLI CLI CLI

Documentation


Error codes

Every command exits with a structured code. JSON output (--json) includes the same code:

E001 no auth token E005 workspace not found E009 policy violation
E002 CI failing E006 workspace already exists E010 PR not found
E003 merge conflict E007 no active workspaces E011 tracker not configured
E004 PR not mergeable E008 pre-ship hook failed E012 ship partial
E013 cannot undo
$ parsec ship PROJ-1234 --json 2>&1
{"error":{"code":"E001","message":"No GitHub token configured","hint":"Set PARSEC_GITHUB_TOKEN or run gh auth login"}}
$ echo $?
2

License

MIT โ€” see LICENSE.

About

Git worktree lifecycle manager โ€” ticket to PR in one command. Jira, GitHub Issues & GitLab integration. Parallel AI agent workflows, CI monitoring, stacked PRs, conflict detection.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors