sproutkit
v1.0.1
Published
A tiny worktree CLI for managing git worktrees
Readme
Sprout
A tiny worktree CLI for managing git worktrees efficiently.
Installation
npm install -g sproutkitTech Stack
- Node.js - Runtime environment
- Chalk - Terminal string styling
- Inquirer - Interactive command line prompts
- Git - Worktree management
Commands
sprout spawn (default)
Create a new worktree via interactive prompts.
sprout spawn
sprout # same as spawnsprout prune
Remove all worktrees under ~/.sprout/<repo>/
sprout prune # with confirmation prompt
sprout prune -f # force removal without confirmationFlags:
-f- Force removal without confirmation prompt
sprout code
Pick a worktree and open it in VS Code.
sprout codesprout open
Pick a worktree and cd into it.
sprout opensprout close
Pick a worktree and remove it (single worktree removal).
sprout closesprout help
Show usage information.
sprout help
sprout -h
sprout --helpUsage
Navigate to any git repository and run:
sprout spawnThis will:
- Prompt you for a branch name
- Prompt you for a folder name (defaults to branch name)
- Create a new worktree in
~/.sprout/<repo-name>/<folder-name> - Copy dotfiles from the main repository
- Change directory to the new worktree
Features
- Interactive prompts - Easy worktree creation with guided input
- Automatic dotfile copying - Copies all dotfiles from main repo to worktree
- Clean organization - All worktrees stored under
~/.sprout/<repo-name>/ - VS Code integration - Direct VS Code opening support
- Batch operations - Remove all worktrees at once with
prune - Cross-platform - Works on macOS, Linux, and Windows
Directory Structure
~/.sprout/
└── <repo-name>/
├── <worktree-1>/
├── <worktree-2>/
└── <worktree-3>/Requirements
- Node.js >= 14.0.0
- Git with worktree support (Git 2.5+)
- VS Code (optional, for
sprout codecommand)
Examples
# Create a new feature worktree
sprout spawn
# Enter: "feature/new-login"
# Enter: "login-feature" (or press enter for default)
# Open existing worktree in VS Code
sprout code
# Remove all worktrees for current repo
sprout prune
# Remove single worktree
sprout close