A focused set of Fish shell utilities for pnpm workspace management, command prefix toggling, and keybindings.
- pnpm workspace helpers (
pnf,pnx,pnc) withfzfselection - Command prefix toggling via
with_prefixandwith_prefix_bind - Ready-made keybind presets for
sudoandproxychains
- Fish shell (interactive)
- fzf — interactive selection for
pnfandpnx - jq — package name extraction in
_pnpm_get_projects - pnpm — workspace discovery and execution
- find — used by
pncfor recursive cleanup - Nerd Font (optional) — improves icons in
pnf
fisher install pourdaavar/fish-toolboxomf install https://github.com/pourdaavar/fish-toolboxcp -r functions/* ~/.config/fish/functions/
cp -r conf.d/* ~/.config/fish/conf.d/
cp -r completions/* ~/.config/fish/completions/Restart Fish or run exec fish.
| Command | Description |
|---|---|
pnf <args…> |
Pick one or more workspace packages and run pnpm -F ... <args…> |
pnx <cmd…> |
Pick workspaces and run pnpm -F <pkg> exec -- <cmd…> |
pnc |
Remove all node_modules under the current directory |
pni→pnpm installpna→pnf addpnu→pnf removepnd→pnf run devpnb→pnf run buildpnt→pnf test
_pnpm_get_projects.fish— lists workspace packages (marks current with ★)pnf.fish— interactivepnpm filterrunner (multi-select)pnx.fish— run commands in selected workspacespnc.fish— recursivenode_modulescleanupconf.d/pnpm_workspace.fish— abbreviations (interactive only)
Toggle a prefix (e.g. sudo, proxychains -q) at the start of the current command line.
with_prefix "proxychains -q"Use fish_key_reader to discover key sequences:
with_prefix_bind \c\eP "proxychains -q" # Ctrl+Alt+P| File | Key binding | Prefix |
|---|---|---|
proxychains_prefix.fish |
Ctrl+P |
proxychains -q |
sudo_prefix.fish |
Ctrl+Shift+S |
sudo |
Edit the bind line in each file to change the key sequence.
with_prefix.fish— toggles prefix on the current command linewith_prefix_bind.fish— binds a key towith_prefix <prefix>completions/with_prefix_bind.fish— tab completions
pncis destructive — runsrm -rfon everynode_modulesunder the current directory. Use with care.- Verify key sequences with
fish_key_readerbefore binding. - Prefer
Ctrl+AltoverCtrl+Shiftfor portability across terminals.
# Toggle sudo
with_prefix_bind \cs "sudo"
# Toggle proxychains
with_prefix_bind \c\eE "proxychains -q"
# Toggle environment variable
with_prefix_bind \c\eH "env HTTP_PROXY=127.0.0.1:7890"