Conversation
…wt-open, wt-reopen, --json, init, env vars Major new features and CLI ergonomics improvements: - `wtf version` command (table-stakes for any CLI tool) - Command aliases: new, pub, pr, up, clean, ls, st, cd, open, reopen - Auto-detect SLUG from current worktree (no more typing slug every time) - `wtf wt-cd SLUG` — print worktree path for shell composition - `wtf wt-open SLUG` — open worktree in editor ($EDITOR/code/vim/nano) - `wtf wt-reopen SLUG` — recreate worktree from existing remote branch - `wtf init` — interactive config wizard for .worktreeflow.toml - `--json` global flag for machine-readable output (doctor, wt-list, wt-status) - `--open` flag on wt-new to open editor after creation - Environment variable overrides: WTF_BASE_BRANCH, WTF_DEBUG, WTF_DRY_RUN, etc. - Enhanced wt-list: last activity dates, stale worktree detection (30+ days), PR status - Centralized `_require_gh()` for consistent gh CLI prerequisite checks - Updated tutorial and quickstart with all new features - 30 new tests (158 total), all passing with clean lint https://claude.ai/code/session_01A1Z3oDtv65NzXVqYaSsn8G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds several quality-of-life improvements to worktreeflow:
wt-cd,wt-open, andwt-reopenfor easier worktree management--jsonflag for machine-readable output from commands likedoctor,wt-list, andwt-statusnew→wt-new,pub→wt-publish) for faster typinginitcommand for interactive setupWTF_*environment variablesKey Changes
Core Manager Enhancements (
manager.py)json_outputparameter toGitWorkflowManager.__init___infer_slug_from_cwd()to detect slug from worktree path pattern{worktree_base}/{repo_name}/{slug}resolve_slug()method to handle explicit slug or auto-detection with clear error messages_require_gh()helper to validate GitHub CLI availability with helpful error messagesdoctor()to support JSON output mode while maintaining rich table displaywt_list()to show last activity dates, staleness indicators, and PR informationwt_status()to support JSON outputwt_cd(): Print worktree path for shell composition (cd $(wtf wt-cd slug))wt_open(): Open worktree in editor (auto-detects from$EDITORor tries code/vim/nano)wt_reopen(): Recreate a worktree from an existing remote branchCLI Interface (
cli.py)AliasGroupcustom Click group class to support command aliasesnew,pub,pr,up,clean,ls,st,cd,open,reopen--jsonglobal flag for machine-readable outputWTF_DEBUG,WTF_DRY_RUN,WTF_QUIET,WTF_VERBOSE,WTF_BASE_BRANCHwt-publish,wt-pr,wt-update,wt-clean,wt-status,wt-cd,wt-openversioncommand to display worktreeflow versioninitcommand for interactive configuration--openflag towt-newto open editor after creationConfiguration (
config.py)generate_config()function to programmatically generate.worktreeflow.tomlcontent with customizable optionsTests (
test_new_features.py)Notable Implementation Details
--verboseflagwt_opencommand respects dry-run mode and doesn't spawn editor processes during previewwt_listis only fetched whenghCLI is available and fork/upstream are configuredhttps://claude.ai/code/session_01A1Z3oDtv65NzXVqYaSsn8G