Script
repos.zsh
List, navigate and open repos quickly from the command line
Download repos.zsh
Written with LLM assistance. Review before running.
v0.1.2
·
Updated 2026-03-08
A zsh shell function that makes it fast to jump between git repos. Shows a numbered list of favourites and recently visited repos, so you can cd or open in VS Code with a single short command.
Demo

Example
$ repos
Favourites:
[1] frontend work/frontend
[2] site personal/my-site
Recently accessed:
[3] api-service
[4] docs
$ repos frontend # cd to frontend
$ repos 2 # cd to site
$ repos add api # bookmark current dir as 'api', then source ~/.zshrc to apply
$ code frontend # open the frontend repo in VS Code
Installation
- Download repos.zsh and source it in your
.zshrc:
source ~/path/to/repos.zsh
- Reload your shell:
source ~/.zshrc
On first run, ~/.reposrc is created automatically with defaults you can customise.
Configuration
Edit ~/.reposrc (or run repos edit):
# Root folder that contains all your repos
REPOS_DIR="$HOME/code"
# Subfolders of REPOS_DIR that themselves contain repos
# e.g. if you have Code/work/project-a, Code/work/project-b
REPOS_GROUPS=("work" "personal")
# Favourites — short aliases for repos you use most
fav frontend "work/frontend"
fav site "personal/my-site"
Usage
repos List favourites and recently accessed repos
repos -a List all repos
repos <name> cd to a repo by name or favourite alias
repos <number> cd to a repo by number from the last list
repos add <name> Add current directory as a favourite
repos edit Open ~/.reposrc in $EDITOR
repos --help Show usage
code works the same way but opens the repo in VS Code instead of cd-ing to it:
code tools # open the 'tools' favourite in VS Code
code 3 # open item 3 from the last list
Features
- Numbered navigation — run
reposto get a list, thenrepos 3to jump there; the index persists betweenreposandcodecalls - Colour output — section headings in yellow, repo names in cyan, indices dimmed; makes lists easy to scan at a glance
- Favourites with aliases — map short names to long paths via
favin~/.reposrc - Recent history — automatically tracks the last 8 repos visited; shows them below favourites
- Group support — walk into subfolders (e.g.
work/,personal/) to find repos without them being top-level - Tab completion — aliases and folder names complete with
<Tab>
Version history
| Version | Date | Notes |
|---|---|---|
| 0.1.3 | 2026-03-10 | Fix bug with handling of . and ~ |
| 0.1.2 | 2026-03-08 | Tweak formatting |
| 0.1.1 | 2026-03-08 | Fix bug with absolute paths and tweak colours |
| 0.1 | 2026-03-08 | Initial release |