Syntax
Description
Manages GWTree’s configuration file. With no arguments, opens the config file in your configured editor. Usereset action to restore default settings.
Arguments
string
Action to perform. Supported values:
- Omit to open config file in editor
reset- Reset configuration to defaults
Configuration File
GWTree stores configuration in a JSON file managed by the conf package. Location:- macOS:
~/Library/Preferences/gwtree-nodejs/config.json - Linux:
~/.config/gwtree-nodejs/config.json - Windows:
%APPDATA%\gwtree-nodejs\Config\config.json
Configuration Options
editor
string
default:"code"
Which editor to open after creating a worktree.Options:
code- Visual Studio Codecursor- Cursor editordefault- Use$EDITORenvironment variablenone- Don’t open any editor
installDeps
boolean
default:true
Whether to automatically install dependencies when creating worktrees.When
true, runs the appropriate package manager install command:pnpm installnpm installyarn installbun install
lastPm
string
default:null
Last detected package manager. Auto-updated by GWTree.Options:
pnpmnpmyarnbunnull- Not yet detected
Examples
Open config file
Reset to defaults
Get config location
If editor is set tonone:
Config File Structure
Default config:Editing Configuration
Using gwt config
Manual editing
Example edits
Disable dependency installation:Editor Behavior
Visual Studio Code (code)
Cursor (cursor)
Default (default)
Uses $EDITOR environment variable:
vimnvimemacsnano
None (none)
Skips opening any editor. Useful for:
- CI/CD environments
- Scripts
- Terminal-only workflows
Dependency Installation
WheninstallDeps is true, GWTree:
-
Detects package manager from lock files:
pnpm-lock.yaml→pnpmbun.lockb→bunyarn.lock→yarnpackage-lock.json→npm- Only
package.json→pnpm(default)
-
Runs install command:
-
Updates
lastPmconfig for next time
Disable for faster creation
Worktrees Registry
GWTree also maintains a separate registry of worktrees: Location:~/.gwtree/worktrees.json
This file tracks all worktrees created by GWTree across all repositories. It’s managed automatically and shouldn’t need manual editing.
Structure:
Resetting Configuration
Reset all settings
editor:codeinstallDeps:truelastPm:null
Selective reset
Edit config and remove specific keys. They’ll use defaults on next run.Environment Variables
EDITOR
Used wheneditor is set to default:
$EDITOR is not set, falls back to vim.
Common Configurations
For VS Code users (default)
For Cursor users
For terminal-only workflows
For scripts/CI
-y flag:
Troubleshooting
Config file not opening
Issue:gwt config doesn’t open editor
Solutions:
-
Check editor is installed:
-
Try different editor:
-
Get path and open manually:
Dependencies not installing
Issue: Dependencies aren’t installed automatically Check config:Wrong package manager
Issue: Using npm but want pnpm Solution: Create appropriate lock file in main repo:Exit Codes
0- Success (config opened or reset)- No error codes - Config command always succeeds
Related Commands
- gwt (create) - Uses config settings when creating worktrees
- Flags - Override config with command-line flags