cat articles/herdr-cdd
cdd for herdr
Since my screen and tmux days, I have used a command named cdd. It is a small thing: if window:3 is working in ~/foo/bar, running cdd 3 simply does cd ~/foo/bar. That is all it does, but I use it constantly. I also like the command name cdd; it is easy to type. So I made cdd work with herdr too.
With herdr, there are three kinds of state to consider.
- The directory of a tab or pane in the current workspace
- The directory of a tab or pane in another workspace
- The directory where an agent is working
I took those into account and made a zsh-only version with the following behavior. If you tell an AI coding agent to make a bash version or support another shell, I think it should be able to produce a similar implementation quickly.
- Running only
cddopens a list of all working directories, filtered with fzf, and lets you move to the selected directory cdd 3moves to tab id 3 in the current workspacecdd a3moves to the cwd of the third agent in the agent listcdd w3:p2moves to pane id 2 in workspace id 3. This follows herdr's official notation, such asw3:p2- Pressing Tab in the usual places shows completion candidates and lets you select from them
- It depends on
jqandfzf, so those commands are required