Shell Integration
Two small touches make WorkFlow feel native in your shell: a cd helper for jumping into workspaces, and tab completions for every command.
The cd helper
A shell can't change your current directory from a subprocess, so wf can't cd for you directly. Instead, wf path <branch> prints a workspace's path, and a one-line shell function turns that into a jump:
# add to ~/.bashrc or ~/.zshrc
wfd() { cd "$(wf path "$1")"; }# add to ~/.config/fish/config.fish
function wfd
cd (wf path $argv[1])
endThen:
wfd feature-x # cd into the feature-x workspaceScope to a project when a branch name is ambiguous by extending the helper to pass --project, or just call wf path feature-x --project myrepo directly.
Completions
WorkFlow generates completion scripts for bash, zsh, fish, and PowerShell. The install script sets these up automatically; you can also manage them yourself.
Install
wf completions install # auto-detect $SHELL and install
wf completions install zsh # or name the shell: bash, zsh, fish
wf completions install --force # overwrite an existing completion fileinstall writes to the standard per-user location for your shell:
| Shell | Installed to | Notes |
|---|---|---|
| bash | $XDG_DATA_HOME/bash-completion/completions/wf | Auto-loaded; start a new shell |
| zsh | $XDG_DATA_HOME/zsh/site-functions/_wf | Ensure the dir is on your fpath before compinit |
| fish | $XDG_CONFIG_HOME/fish/completions/wf.fish | Auto-loaded; start a new shell |
For zsh, the command prints the one-time lines to add to ~/.zshrc:
fpath=($XDG_DATA_HOME/zsh/site-functions $fpath)
autoload -U compinit && compinitPrint to stdout
To place the script yourself (or for PowerShell, which install doesn't handle), print it:
wf completions zsh > _wf
wf completions bash > /etc/bash_completion.d/wf
wf completions powershell # print the PowerShell script($XDG_DATA_HOME defaults to ~/.local/share; $XDG_CONFIG_HOME to ~/.config.)