mkcd creates brace-expanded directory trees and drops you into a selected branch.
Given:
mkcd test/{test1,test2}/ok/{first,second}it will:
- Create all combinations:
test/test1/ok/firsttest/test1/ok/secondtest/test2/ok/firsttest/test2/ok/second
cdinto the selected path (default first option at each brace level).
- Works with quoted and unquoted brace paths
- 1-based index selection per brace level (
2,1) - Empty or
0index means default (1),10,20, 2
- Optional trailing dot suffix to step up from selected path
..../..
zshmkdir(standard on macOS/Linux)
From repo root:
./install.shThen reload your shell:
source ~/.zshrc
# or source ~/.bashrc / ~/.bash_profile depending on your shell./install.sh --shell zsh|bash
./install.sh --rc-file /path/to/rcfile
./install.sh --prefix /custom/install/dir
./install.sh --skip-rc
./install.sh --forcemkcd test/{a,b}/x/{y,z}
# cd => test/a/x/ymkcd test/{a,b}/x/{y,z} 2,1
# cd => test/b/x/ymkcd test/{test1,test2}/ok/{first,second} ,1
# cd => test/test1/ok/first
mkcd test/{test1,test2}/ok/{first,second} 0, 2
# cd => test/test1/ok/secondmkcd test/{test1,test2}/ok/{first,second} 2,1 ..
# cd => test/test2/ok
mkcd test/{test1,test2}/ok/{first,second} ..
# cd => test/test1/okRun:
zsh ./test_mkcd.zshExpected:
All mkcd tests passed.
- Remove the source line from your shell rc file.
- Delete the installed file (default):
rm -f "$HOME/.local/share/mkcd/mkcd.zsh"If mkcd still behaves like an old version, check where it is loading from:
whence -v mkcdIf it shows ~/.zsh/functions/mkcd.zsh, that legacy autoload path is taking precedence.
Re-run the installer with --force; it now updates that file too.