Skip to content
/ gt Public

Navigate to aliased directories in your shell with tab completion.

License

Notifications You must be signed in to change notification settings

mart337i/gt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gt

Navigate to aliased directories in your shell with tab completion.

Version

What is gt?

gt lets you bookmark directories and jump to them instantly. No more typing long paths or spamming cd ../../../.

# Register a directory
gt -r dev ~/projects/development

# Jump to it
gt dev

Tab completion shows all your aliases and their paths.

Installation

Via install script

git clone https://github.com/mart337i/gt.git
cd gt
sudo ./install

Manual

Add this to your .bashrc or .zshrc:

source /path/to/gt.sh

Restart your shell after installation.

Usage

Navigate to alias:

gt <alias>

Register alias:

gt -r <alias> <directory>
gt -r dots ~/.config
gt -r here .  # current directory

List aliases:

gt -l

Unregister alias:

gt -u <alias>

Expand alias (show path):

gt -x <alias>

Cleanup broken aliases:

gt -c

Push/pop directory stack:

gt -p <alias>  # push current, then goto alias
gt -o          # pop back

Help:

gt -h

Examples

# Setup
gt -r api ~/work/backend/api
gt -r web ~/sites/production

# Navigate
gt api
gt web/static

# Stack navigation
gt -p api        # saves current location
gt -o            # returns to saved location

# Cleanup
gt -c            # remove dead aliases

Configuration

Aliases are stored in ~/.config/gt (or $XDG_CONFIG_HOME/gt).

To use a custom location:

export GT_DB="/path/to/your/alias/file"

Testing

Run the test suite to verify everything works:

./tests/run_tests.sh

All 15 tests should pass:

  • Version and help commands
  • Register/unregister/list aliases
  • Navigation (both slash and space notation)
  • Tab completion
  • Push/pop directory stack
  • Cleanup invalid aliases
  • Deep path navigation
  • Real-world workflows

Tests run automatically on every push via GitHub Actions.

Troubleshooting

zsh: command not found: compdef

Add to .zshrc:

autoload bashcompinit
bashcompinit

Migrating from goto

Rename your config file:

mv ~/.config/goto ~/.config/gt

Or point to the old file:

export GT_DB="$HOME/.config/goto"

About

gt is a maintained fork of iridakos/goto by Lazarus Lazaridis.

The original project is no longer maintained. This fork continues development with a shorter command name and active maintenance.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-feature)
  3. Commit your changes (git commit -am 'Add feature')
  4. Push to the branch (git push origin my-feature)
  5. Run ShellCheck on your changes
  6. Create a Pull Request

License

MIT License - see LICENSE

Original project: iridakos/goto by Lazarus Lazaridis

About

Navigate to aliased directories in your shell with tab completion.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages