Skip to content

Latest commit

Β 

History

35 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

goto-cli

Simple, dependency-free Bash/Zsh CLI for named directory bookmarks and fast navigation.

πŸ‡ΊπŸ‡¦ Π£ΠΊΡ€Π°Ρ—Π½ΡΡŒΠΊΠ°

goto-cli β€” is a simple CLI utility for quickly navigating between frequently used directories, designed for Bash and Zsh shells.

Save a directory under a short name:

goto -a my-project ~/projects/my-project

and then navigate to it:

goto my-project

πŸ“₯ Installation

git clone <repository-url>
cd goto-cli
make install

After installation, reload your shell:

source ~/.bashrc

For Zsh:

source ~/.zshrc

Check the installation:

goto --help

goto-cli is installed to ~/.local/share/goto and does not require sudo.


πŸ—‘οΈ Uninstallation

From the project directory:

make uninstall

or:

./uninstall.sh

This removes goto-cli and its configuration from .bashrc / .zshrc.

Saved routes are not deleted.


⚑ Quick Start

cd ~/projects/my-project
goto -a my-project

Now:

goto my-project

will take you to:

~/projects/my-project

Show all saved routes:

goto

πŸ› οΈ Main Commands

Command Description
goto Show the list of projects
goto <name> Navigate to a project
goto -a <name> [path] Add a project
goto -m <name> Modify a project
goto -m <name> <value> Change the name or path
goto -r <name> Remove a project
goto -p <name> Explicitly navigate to a project
goto -h Show help

Long options are also available:

--add
--modify
--change
--rm
--remove
--project
--list
--help

βž• Adding a Route

Current Directory

goto -a my-project

The current directory will be used.

Specify a Path

goto -a my-project ~/projects/my-project

Automatically Use the Directory Name

cd ~/projects/my-project
goto -a

The alias will be:

my-project

✏️ Modifying a Project

Interactive Mode

goto -m my-project

You can then choose:

1) Change name
2) Change path
3) Change name and path
0) Cancel

Rename

goto -m my-project new-name

Change Path

goto -m my-project ~/projects/new-location

πŸ—‘οΈ Removing a Route

goto -r my-project

Only the saved route is removed, not the directory itself.

For example:

my-project β†’ /home/user/projects/my-project

after:

goto -r my-project

the directory /home/user/projects/my-project will remain on disk.


πŸ“‹ Viewing Routes

goto

or:

goto -l

or:

goto --list

Example:

Available projects:
frontend             -> /home/user/projects/frontend
backend              -> /home/user/projects/backend
website              -> /home/user/projects/website

⌨️ Tab Completion

goto-cli supports Tab completion in Bash and Zsh.

For example:

goto front<TAB>

may complete the project name.

Command completion is also available:

goto --<TAB>

🏷️ Names Starting with -

If a project name starts with -, use -p:

goto -p "-my-project"

or:

goto --project "-my-project"

πŸ’Ύ Data Storage

By default, routes are stored in:

~/.project_routes

Format:

name|path

For example:

frontend|/home/user/projects/frontend
backend|/home/user/projects/backend
website|/home/user/projects/website

βš™οΈ Custom Routes File

You can use a different file:

export GOTO_PROJECTS_FILE="$HOME/.config/goto/routes"

Routes will then be stored in the specified file.

If the variable is not set, the default is:

~/.project_routes

🩺 Health Check

Check the installation:

make health-check

or:

./check.sh

The following are checked:

  • installation files;
  • src/ and lib/ directories;
  • Bash/Zsh configuration;
  • loading of goto.sh.

πŸ”„ Updating

After pulling a new version:

git pull
make install

Then reload your shell:

source ~/.bashrc

or:

source ~/.zshrc

πŸ“‚ Project Structure

goto-cli/
β”œβ”€β”€ goto.sh          # main file
β”œβ”€β”€ install.sh       # installation
β”œβ”€β”€ uninstall.sh     # uninstallation
β”œβ”€β”€ check.sh         # health check
β”œβ”€β”€ Makefile
β”œβ”€β”€ src/             # functional modules
β”‚   β”œβ”€β”€ add.sh
β”‚   β”œβ”€β”€ go.sh
β”‚   β”œβ”€β”€ help.sh
β”‚   β”œβ”€β”€ list.sh
β”‚   β”œβ”€β”€ merge.sh
β”‚   β”œβ”€β”€ modify.sh
β”‚   └── rm.sh
β”œβ”€β”€ lib/              # shared libraries
β”‚   β”œβ”€β”€ input.sh
β”‚   └── log.sh
└── FUTURE.md

πŸ”§ Development

Main commands:

make install
make uninstall
make health-check
make permissions
make rehash
make help

To run locally without installing:

source ./goto.sh

Then:

goto --help

πŸ’‘ How It Works

goto is a shell function, not a regular executable.

This allows:

goto my-project

to change the directory of the current shell session.

During installation, goto.sh is automatically sourced through .bashrc or .zshrc.


πŸ“œ License

See LICENSE.

About

Simple, dependency-free Bash/Zsh CLI for named directory bookmarks and fast navigation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages