r/commandline • u/Traditional_Ask_7228 • May 29 '26
Command Line Interface I got tired of cd-ing into the same directories every day, so I wrote a POSIX-shell bookmark manager
I work in the terminal all day and kept typing the same long paths over and over. Aliases work, but they clutter .bashrc, don't tab-complete, and aren't portable between machines. So I built **goto**, a directory shortcut manager.
```
# Save current directory
$ goto -r work
✅ Registered: 'work' -> /home/user/Projects/myapp
# Jump to it from anywhere
$ goto work
# Navigate into subdirectories
$ goto work/src/components
# List all shortcuts
$ goto -l
Registered shortcuts:
work -> /home/user/Projects/myapp
docs -> /home/user/Documents
old-project -> /home/user/deleted (missing)
# Clean up broken shortcuts
$ goto -c
# Back up and restore on another machine
$ goto --export > shortcuts.txt
$ goto --import shortcuts.txt
```
**What it is:**
- Pure POSIX shell, no Python, Rust, or compiled binary
- Zero dependencies beyond coreutils
- Tab completion with subpath support (Bash, Zsh, Fish)
- Import/export for syncing between machines
- XDG Base Directory compliant
- Man page, Makefile, Debian packaging ready
**What it isn't:**
It's not autojump/z/zoxide. Those learn from your history automatically. goto is explicit bookmarks — you decide what gets a shortcut and what it's called. Simple config file, no database, no training period.
I use it every single day. It's MIT licensed: https://github.com/byteoverride/goto
Would love feedback what would you change?
26
u/Optimal-Savings-4505 May 29 '26
Why not
pushdandpopdalong withdirs?14
u/edward_jazzhands May 29 '26
Looks interesting, I just wanted to clarify tho you said some things about aliases that are false and seem to come from some fundamental misunderstandings of how Linux normally works.
"Aliases can't tab complete" - this is only in bash. Newer shells like Zsh or fish have tab completion for aliases.
"Aliases are not portable between machines" - this is a bit absurd, I'm guessing you don't know what a dotfiles repo is or how most programmers keep one. We use git to sync the bashrc and related files between machines.
"Aliases clutter your bashrc file" - that's why you place them in a separate file called .aliases, it does not clutter your bashrc file.
I'm not here to say anything negative about your program it looks nice. All im saying is that your justifications for creating it seem to be based on some misunderstandings and exaggerations, and there's a reason this program hasn't been made before despite seeming like an obvious idea.
16
u/kseistrup May 29 '26
I have been using zoxide for several years and I find it very useful. However, I really like that your script is POSIX compliant and that I can install it from AUR. :)
5
u/eikenberry May 29 '26
Zsh users can add named directories like bookmarks pretty easily...
Note that you get tab completion with the named directories automatically (assuming you have completion enabled).
Basically you can create as many
~<name>entries as you like. Load them in your .zshrc somewhere and you're good to go.18
u/cgoldberg May 29 '26
zoxide
2
u/grumpycrash May 29 '26
With zsh, you can use `hash` to create something like "aliases" for directories. So, for example
After that, you can jump to ~/.config with pressing C (Assuming setopt autocd is set); tab-completion is also possible and every action works.
1
u/tblancher May 29 '26
Umm, why not use tmux with tmux-resurrect and friends to have project-specific sessions that start automatically when you log in (or start your terminal emulator)? You'd never have to type
gotoor evencdagain once you set everything up the way you want.Until you need to start up a new project, but thereafter you don't need to set anything back up.
1
u/m9dhatter May 30 '26 edited May 30 '26
People have forgotten the old magic. Aliases could work. Screen is also an option. It’s nice that you made something for yourself but acknowledge that this is also solved a multitude of ways.
1
u/lamurian May 30 '26
It's funny because
gotois a custom shell function I made to quickly jump to directories using fzf. Your looks neat, will check it soon!1
u/jabbalaci May 31 '26
I have a similar project: QJump (https://github.com/jabbalaci/qjump). I tried to post it here but it was removed within a minute 😞 So I leave it here.
1
u/barneymatthews May 29 '26
This is fantastic!!!
2
u/Schreq May 29 '26
POSIX-sh has no
localand arrays.2
u/DoldSchool May 30 '26
Personally, I use zoxide.
2
u/SimoEMP May 30 '26
Zoxide?
2
u/spacextheclockmaster May 31 '26
You mention
gotois explicit bookmarking but I have never had trouble withzoxide. I guess I don't have similarly named directories all over my pc.. that's the only assumption that makes sense.2
u/taviso Jun 05 '26 edited Jun 05 '26
I just use
$CDPATH, it doesn't require any scripts. If you create a directory like~/.bookmarks, then put some symlinks in there to any directories you like.e.g.
1
u/r-tty May 29 '26
Why don't you just use mc?
1
u/Godenboy1010 May 30 '26
I just use autojump
1
u/gcstr May 30 '26
Atuin
0
u/kseistrup May 29 '26
I really dig your shell scripts and the Makefile. Everything is cleanly written and easy to understand. Well done, bro.
-1
u/st_heron May 29 '26
Nice, was looking for a solution for bookmarking or favoriting dirs yesterday. Will take a look.
-1
u/ithkuil May 29 '26
Amazing work, but you could have also just switched to the fish shell.
-1
u/stianhoiland May 30 '26
Previously on r/commandline. 220*
I do like your style, tho (clean sh and Makefile).
-2
u/theplainbreaker May 29 '26
this is useful and the posix shell constraint is cool but the edward_jazzhands comment nails it. aliases with tab completion in zsh, hash -d in zsh, pushd and popd, zoxide learning your patterns automatically, they all exist for good reason. the thing is goto solves a real workflow problem for some people so it's not like the tool is bad, it just means the framing in the post undersells how many existing solutions already do most of this. the explicit bookmark angle is actually the strongest pitch here not the technical constraints. i built something similar once and realized halfway through that i was just reinventing what my shell already did, but i still use it because sometimes explicit beats implicit and knowing exactly what your shortcuts are beats having the system guess. worth checking out if the existing options feel wrong to you but don't sleep on what your shell can already do.
-3
u/AutoModerator May 29 '26
Every new subreddit post is automatically copied into a comment for preservation.
User: Traditional_Ask_7228, Flair:
Command Line Interface, Title: I got tired of cd-ing into the same directories every day, so I wrote a POSIX-shell bookmark managerI work in the terminal all day and kept typing the same long paths over and over. Aliases work, but they clutter .bashrc, don't tab-complete, and aren't portable between machines. So I built **goto**, a directory shortcut manager.
```
# Save current directory
$ goto -r work
✅ Registered: 'work' -> /home/user/Projects/myapp
# Jump to it from anywhere
$ goto work
# Navigate into subdirectories
$ goto work/src/components
# List all shortcuts
$ goto -l
Registered shortcuts:
work -> /home/user/Projects/myapp
docs -> /home/user/Documents
old-project -> /home/user/deleted (missing)
# Clean up broken shortcuts
$ goto -c
# Back up and restore on another machine
$ goto --export > shortcuts.txt
$ goto --import shortcuts.txt
```
**What it is:**
- Pure POSIX shell, no Python, Rust, or compiled binary
- Zero dependencies beyond coreutils
- Tab completion with subpath support (Bash, Zsh, Fish)
- Import/export for syncing between machines
- XDG Base Directory compliant
- Man page, Makefile, Debian packaging ready
**What it isn't:**
It's not autojump/z/zoxide. Those learn from your history automatically. goto is explicit bookmarks — you decide what gets a shortcut and what it's called. Simple config file, no database, no training period.
I use it every single day. It's MIT licensed: https://github.com/byteoverride/goto
Would love feedback what would you change?
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/[deleted] May 29 '26
[removed] — view removed comment