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 cdd opens a list of all working directories, filtered with fzf, and lets you move to the selected directory
  • cdd 3 moves to tab id 3 in the current workspace
  • cdd a3 moves to the cwd of the third agent in the agent list
  • cdd w3:p2 moves to pane id 2 in workspace id 3. This follows herdr's official notation, such as w3:p2
  • Pressing Tab in the usual places shows completion candidates and lets you select from them
  • It depends on jq and fzf, so those commands are required

cat related_articles/herdr-cdd.yaml

  1. herdr-tiny-fingers: tmux-fingers-style Copying for herdrI made herdr-tiny-fingers, a small herdr plugin for copying URLs, SHAs, UUIDs, and similar text from the terminal screen with short keys.
  2. Adding type hints to a Python project and getting value from type checkingI added Python type hints and pyright to a machine learning project, and found that the setup cost was low while editor support and static checks were immediately useful.
  3. OpenProvence: A Model for Removing Irrelevant Sentences Before Passing Text to an LLMI released OpenProvence, an open project for pruning irrelevant sentences from retrieved text before passing it to an LLM.