A command-line tool for managing isolated development workspaces with multiple git repositories. Designed for developers working on microservices, monorepos, or multiple related projects.
- Isolated Workspaces: Create separate workspace environments for different features or experiments
- Git Worktree Integration: Feature workspaces use git worktrees for lightweight, isolated branch development
- Branch Management: Track, cleanup, and manage branches across all repositories
- Shared Context: All workspaces share
.claudedirectory for consistent AI assistance - Automatic Sync: Fetches and pulls latest changes when creating workspaces
- Interactive UI: Terminal interface powered by Bubble Tea
- Shell Integration: Seamless navigation with the
wcommand - Protected Workspaces: Default workspace is protected from accidental deletion
- Unpushed Commit Detection: Warns before deleting branches with unpushed work
brew install jcleira/tap/workspacecurl -LO https://github.com/jcleira/workspace/releases/latest/download/workspace_$(curl -s https://api.github.com/repos/jcleira/workspace/releases/latest | grep tag_name | cut -d '"' -f 4 | tr -d 'v')_linux_amd64.deb
sudo dpkg -i workspace_*.debcurl -LO https://github.com/jcleira/workspace/releases/latest/download/workspace_$(curl -s https://api.github.com/repos/jcleira/workspace/releases/latest | grep tag_name | cut -d '"' -f 4 | tr -d 'v')_linux_amd64.rpm
sudo dnf install ./workspace_*.rpmcurl -LO https://github.com/jcleira/workspace/releases/latest/download/workspace_$(curl -s https://api.github.com/repos/jcleira/workspace/releases/latest | grep tag_name | cut -d '"' -f 4 | tr -d 'v')_linux_amd64.apk
sudo apk add --allow-untrusted workspace_*.apkscoop bucket add jcleira https://github.com/jcleira/scoop-bucket
scoop install workspaceyay -S workspace-cli-bin
# or
paru -S workspace-cli-bingo install github.com/jcleira/workspace@latestgit clone https://github.com/jcleira/workspace.git
cd workspace
make install
# Or install to user directory
make install-local# Configure workspace directories
workspace config setup
# View current configuration
workspace config show# Create a new workspace (uses git worktrees)
workspace create my-feature
# Initialize shell integration for the 'w' command
workspace config init
# Add to your shell config and reload
source ~/.bashrc # or ~/.zshrc# Interactive workspace selector
workspace # or just 'w' after shell integration
# Direct navigation
w my-feature
# List all workspaces
workspace list| Command | Description |
|---|---|
workspace |
Interactive workspace selector |
workspace create <name> |
Create a new workspace |
workspace list |
List all workspaces |
workspace switch <name> |
Switch to a workspace |
workspace delete <name> |
Delete workspace and its branches |
| Command | Description |
|---|---|
workspace branch list |
List all branches with workspace associations |
workspace branch cleanup |
Delete orphaned branches (interactive) |
workspace branch ignore add <pattern> |
Add pattern to ignore list |
workspace branch ignore remove <pattern> |
Remove pattern from ignore list |
workspace branch ignore list |
List ignored patterns |
workspace branch ignore clear |
Clear all ignored patterns |
| Command | Description |
|---|---|
workspace config show |
Display current configuration |
workspace config setup |
Interactive configuration setup |
workspace config set <key> <value> |
Set configuration value |
workspace config init |
Initialize shell integration |
workspace config completion <shell> |
Generate shell completions |
workspaces-dir: Directory where workspaces are storedrepos-dir: Directory where main git repositories are locatedclaude-dir: Shared Claude context directory
When creating a new workspace, the CLI automatically:
- Fetches latest changes from remote (
git fetch origin) - Pulls the default branch to ensure it's up-to-date
- Creates worktrees from the latest code
- default workspace: Uses normal git clones for persistent, long-term development
- feature workspaces: Uses git worktrees for lightweight branch checkouts
# Creates normal clones
workspace create default
# Creates worktrees linked to repos-dir
workspace create feature-authOn Creation:
- Branches are created from the latest main/master
On Deletion:
- Branches are deleted by default when deleting workspace
- Branches with unpushed commits are automatically skipped (safe default)
Protect branches from cleanup with patterns:
# Add patterns
workspace branch ignore add "runtime-*"
workspace branch ignore add "staging"
# Pattern types supported
workspace branch ignore add "local-*" # Prefix
workspace branch ignore add "*-backup" # Suffix
workspace branch ignore add "release/*" # Globworkspace/
├── main.go # Entry point
├── cmd/ # Cobra commands
│ ├── root.go # Root command & dashboard launcher
│ ├── create/ # Workspace creation
│ ├── delete/ # Workspace deletion
│ ├── list/ # List workspaces
│ ├── switch/ # Switch workspace
│ ├── branch/ # Branch management (list, cleanup, ignore)
│ └── config/ # Configuration (show, set, setup, init)
├── pkg/ # Public packages
│ ├── workspace/ # Workspace service, manager, types
│ ├── branch/ # Branch service and types
│ ├── status/ # Repository status service
│ ├── config/ # Configuration management
│ ├── git/ # Git operations (clone, worktree, status)
│ ├── ui/
│ │ ├── commands/ # CLI output helpers
│ │ └── dashboard/ # Interactive dashboard (Bubble Tea)
│ └── shell/ # Shell integration
├── Makefile # Build automation
└── README.md # This file
git clone https://github.com/jcleira/workspace.git
cd workspace
go mod download
make build
make testmake build # Build the binary
make build-all # Build for all platforms
make install # Install to /usr/local/bin
make install-local # Install to ~/go/bin
make test # Run tests
make test-coverage # Generate coverage report
make check # Run fmt, vet, and lint
make lint # Run golangci-lint
make clean # Remove build artifactsConfiguration is stored in ~/.config/workspace/config.json:
{
"workspaces_dir": "/Users/you/workspaces",
"repos_dir": "/Users/you/repos",
"claude_dir": "/Users/you/.claude"
}workspace config set workspaces-dir ~/Projects/workspaces
workspace config set repos-dir ~/Projects/repos
workspace config set claude-dir ~/Projects/.claudeThe w function provides quick workspace navigation:
w # Interactive workspace selection
w project # Navigate directly to workspace
w pr[TAB] # Autocomplete workspace names# Bash
workspace config completion bash > /etc/bash_completion.d/workspace
# Zsh
workspace config completion zsh > "${fpath[1]}/_workspace"
# Fish
workspace config completion fish > ~/.config/fish/completions/workspace.fish# Create a feature workspace
workspace create frontend
# Default workspace uses normal clones
workspace create default# List all branches and their workspaces
workspace branch list
# Clean up orphaned branches
workspace branch cleanup
# Protect branches from cleanup
workspace branch ignore add "staging"
workspace branch ignore add "release-*"# Delete workspace and its branches
workspace delete old-featureWorkspaces automatically link to a shared .claude directory:
workspace-myproject/
├── .claude -> ~/Tactic/.claude # Shared AI context
├── frontend/ # Your repositories
├── backend/
└── .workspace-info # Workspace metadata
export PATH="/usr/local/bin:$PATH"
# Or for user installation
export PATH="$HOME/go/bin:$PATH"- Run
workspace config init - Add the function to your shell config
- Reload:
source ~/.bashrcorsource ~/.zshrc
ssh-add ~/.ssh/id_rsa
ssh -T git@github.comMIT License - see LICENSE file for details.
- Cobra - CLI framework
- Bubble Tea - TUI framework
- Lipgloss - Terminal styling