Stop typing long
directory paths.
Goto is a cross-platform CLI tool that lets you bookmark directories with short names, then jump to them instantly from anywhere.
# Save a directory with a short name
$ goto add projects /home/user/projects
Saved 'projects' -> /home/user/projects
# Jump to it from anywhere
$ goto jump projects
/home/user/projects $#Overview
Bookmark
Save any directory with a short, memorable alias.
Jump
Instantly cd to any bookmarked directory by name.
Cross-Platform
Works on Mac, Linux, and Windows with shell-specific setup.
How it works
- The Go binary (
gotocli) handles all data storage and retrieval, saving directories to~/.goto.json - The shell wrapper (
goto) intercepts thejumpcommand and runscdin the current shell - This is the same pattern used by popular tools like z and autojump
#Installation
You can either download a pre-built binary or build from source.
Option A โ Download pre-built binary
Grab the latest binary for your platform from the releases page. No dependencies required.
Mac & Linux
# Download the binary for your platform from the releases page
$ chmod +x gotocli
$ sudo mv gotocli /usr/local/bin/Windows
# Download gotocli.exe from the releases page
Move gotocli.exe to C:\Program Files\gotocli\Option B โ Build from source
Requires Go 1.25+ installed on your system.
# Clone the repository
$ git clone git@github.com:CharlesChinedum/goto-cli.git
$ cd goto-cli
# Build the binary
$ go build -o gotocli app/main.goThen add to your PATH โ Mac & Linux
$ sudo mv gotocli /usr/local/bin/Then add to your PATH โ Windows
Move gotocli.exe to C:\Program Files\gotocli\#Shell Setup
A shell wrapper function is required so that goto jump can actually change your working directory. The wrapper also lets you use goto directly instead of gotocli goto.
Mac & Linux โ add to ~/.zshrc or ~/.bashrc
function goto() {
local command=$1
local name=$2
local path=$3
local extra=$4
if [ "$command" = "jump" ]; then
TARGET=$(/usr/local/bin/gotocli goto jump "$name" 2>/dev/null)
if [ -z "$TARGET" ]; then
echo "No directory found for '$name'"
else
cd "$TARGET"
fi
elif [ "$command" = "edit" ]; then
/usr/local/bin/gotocli goto edit "$name" "$path"
elif [ "$command" = "rename" ]; then
/usr/local/bin/gotocli goto rename "$name" "$path"
else
/usr/local/bin/gotocli goto "$command" "$name" "$path" "$extra"
fi
}
# Then reload your shell
$ source ~/.zshrcWindows โ add to PowerShell $PROFILE
function goto {
param($command, $name, $path, $extra)
if ($command -eq "jump") {
$TARGET = & "C:\Program Files\gotocli\gotocli.exe" goto jump $name 2>$null
if (-not $TARGET) {
Write-Host "No directory found for '$name'"
} else {
Set-Location $TARGET
}
} elseif ($command -eq "edit") {
& "C:\Program Files\gotocli\gotocli.exe" goto edit $name $path
} elseif ($command -eq "rename") {
& "C:\Program Files\gotocli\gotocli.exe" goto rename $name $path
} else {
& "C:\Program Files\gotocli\gotocli.exe" goto $command $name $path $extra
}
}Why a shell wrapper? A subprocess (like a Go binary) cannot change the parent shell's working directory. The wrapper intercepts the jump command to run cd in the current shell session, and forwards all other commands directly to gotocli.
#Commands
Save a directory path with a short alias name. Paths with spaces are supported.
# Usage
$ goto add <name> <path>
# Example
$ goto add projects /home/user/projects
Saved 'projects' -> /home/user/projectsJump to a saved directory. The shell wrapper intercepts this command to cd into the target path.
# Usage
$ goto jump <name>
# Example
$ goto jump projectsDisplay all saved directory bookmarks and their paths.
# Usage
$ goto list
# Example
$ goto list
projects -> /home/user/projects
docs -> /home/user/DocumentsDelete a saved directory bookmark by its alias name.
# Usage
$ goto remove <name>
# Example
$ goto remove projects
Removed 'projects'Update the path of an existing saved directory bookmark.
# Usage
$ goto edit <name> <newpath>
# Example
$ goto edit projects /home/user/new-projectsRename an existing directory bookmark without changing its path.
# Usage
$ goto rename <oldname> <newname>
# Example
$ goto rename projects work-projects#Quick Reference
| Action | Command |
|---|---|
| Save a directory | goto add <name> <path> |
| Jump to a directory | goto jump <name> |
| List all bookmarks | goto list |
| Remove a bookmark | goto remove <name> |
| Edit a directory path | goto edit <name> <newpath> |
| Rename a bookmark | goto rename <oldname> <newname> |
| Config file location | ~/.goto.json |