{"id":13558512,"url":"https://github.com/iridakos/goto","last_synced_at":"2025-05-16T04:05:59.953Z","repository":{"id":30067063,"uuid":"123816488","full_name":"iridakos/goto","owner":"iridakos","description":"Alias and navigate to directories with tab completion in Linux","archived":false,"fork":false,"pushed_at":"2024-07-26T16:57:39.000Z","size":3277,"stargazers_count":888,"open_issues_count":17,"forks_count":65,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-08T14:09:32.987Z","etag":null,"topics":["aliases","bash","directories","linux","productivity","registered-aliases","utility","zsh"],"latest_commit_sha":null,"homepage":"https://iridakos.com/programming/2019/04/10/shell-navigation-with-autocomplete","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iridakos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-04T18:27:09.000Z","updated_at":"2025-04-06T00:15:47.000Z","dependencies_parsed_at":"2024-09-28T08:20:47.952Z","dependency_job_id":"b92667d6-6342-431f-9f5e-5b5f01c8bec9","html_url":"https://github.com/iridakos/goto","commit_stats":{"total_commits":120,"total_committers":20,"mean_commits":6.0,"dds":0.3583333333333333,"last_synced_commit":"b7fda54e0817b9cb47e22a78bd00b4571011cf58"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iridakos%2Fgoto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iridakos%2Fgoto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iridakos%2Fgoto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iridakos%2Fgoto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iridakos","download_url":"https://codeload.github.com/iridakos/goto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aliases","bash","directories","linux","productivity","registered-aliases","utility","zsh"],"created_at":"2024-08-01T12:04:59.596Z","updated_at":"2025-05-16T04:05:54.945Z","avatar_url":"https://github.com/iridakos.png","language":"Shell","funding_links":[],"categories":["Files and Directories","Shell","linux","bash","Command-Line Productivity"],"sub_categories":["Directory Navigation"],"readme":"# goto\n\nA shell utility allowing users to navigate to aliased directories supporting auto-completion :feet:\n\n![Generic badge](https://img.shields.io/badge/version-2.0.0-green.svg)\n\n## How does it work?\n\nUser registers directory aliases, for example:\n```bash\ngoto -r dev /home/iridakos/development\n```\nand then `cd`s to that directory with:\n```bash\ngoto dev\n```\n\n![goto demo gif](https://github.com/iridakos/goto/raw/master/doc/goto.gif)\n\n## goto completion\n\n`goto` comes with a nice auto-completion script so that whenever you press the `tab` key after the `goto` command, bash or zsh prompts with suggestions of the available aliases:\n\n```bash\n$ goto \u003ctab\u003e\nbc /etc/bash_completion.d                     \ndev /home/iridakos/development\nrubies /home/iridakos/.rvm/rubies\n```\n\n## Installation\n\n### Via script\nClone the repository and run the install script as super user or root:\n```bash\ngit clone https://github.com/iridakos/goto.git\ncd goto\nsudo ./install\n```\n\n### Manually\nCopy the file `goto.sh` somewhere in your filesystem and add a line in your `.zshrc` or `.bashrc` to source it.\n\nFor example, if you placed the file in your home folder, all you have to do is add the following line to your `.zshrc` or `.bashrc` file:\n\n```bash\nsource ~/goto.sh\n```\n\n### macOS - Homebrew\n\nA formula named `goto` is available for the bash shell in macOS.\n```bash\nbrew install goto\n```\n\n### Add colored \u003ctab\u003e output\n\n```bash\necho -e \"\\$include /etc/inputrc\\nset colored-completion-prefix on\" \u003e\u003e ~/.inputrc\n```\n\n**Note:**\n- you need to restart your shell after installation\n- you need to have the bash completion feature enabled for bash in macOS (see this [issue](https://github.com/iridakos/goto/issues/36)):\n  - you can install it with `brew install bash-completion` in case you don't have it already\n\n## Usage\n\n* [Change to an aliased directory](#change-to-an-aliased-directory)\n* [Register an alias](#register-an-alias)\n* [Unregister an alias](#unregister-an-alias)\n* [List aliases](#list-aliases)\n* [Expand an alias](#expand-an-alias)\n* [Cleanup](#cleanup)\n* [Help](#help)\n* [Version](#version)\n* [Extras](#extras)\n  * [Push before changing directories](#push-before-changing-directories)\n  * [Revert to a pushed directory](#revert-to-a-pushed-directory)\n* [Troubleshooting](#troubleshooting)\n  * [Updating from 1.x to 2.x](#updating-from-1x-to-2x)\n  * [zsh](#zsh)\n    * [command not found compdef](#command-not-found-compdef)\n\n### Change to an aliased directory\nTo change to an aliased directory, type:\n```bash\ngoto \u003calias\u003e\n```\n\n#### Example:\n```bash\ngoto dev\n```\n\n### Register an alias\nTo register a directory alias, type:\n```bash\ngoto -r \u003calias\u003e \u003cdirectory\u003e\n```\nor\n```bash\ngoto --register \u003calias\u003e \u003cdirectory\u003e\n```\n\n#### Example:\n```bash\ngoto -r blog /mnt/external/projects/html/blog\n```\nor\n```bash\ngoto --register blog /mnt/external/projects/html/blog\n```\n\n#### Notes\n\n* `goto` **expands** the directories hence you can easily alias your current directory with:\n```bash\ngoto -r last_release .\n```\nand it will automatically be aliased to the whole path.\n* Pressing the `tab` key after the alias name, you have the default directory suggestions by the shell.\n\n### Unregister an alias\n\nTo unregister an alias, use:\n```bash\ngoto -u \u003calias\u003e\n```\nor\n```bash\ngoto --unregister \u003calias\u003e\n```\n#### Example\n```\ngoto -u last_release\n```\nor\n```\ngoto --unregister last_release\n```\n\n#### Notes\n\nPressing the `tab` key after the command (`-u` or `--unregister`), the completion script will prompt you with the list of registered aliases for your convenience.\n\n### List aliases\n\nTo get the list of your currently registered aliases, use:\n```bash\ngoto -l\n```\nor\n```bash\ngoto --list\n```\n\n### Expand an alias\n\nTo expand an alias to its value, use:\n```bash\ngoto -x \u003calias\u003e\n```\nor\n```bash\ngoto --expand \u003calias\u003e\n```\n\n#### Example\n```bash\ngoto -x last_release\n```\nor\n```bash\ngoto --expand last_release\n```\n\n### Cleanup\n\nTo cleanup the aliases from directories that are no longer accessible in your filesystem, use:\n\n```bash\ngoto -c\n```\nor\n```bash\ngoto --cleanup\n```\n\n### Help\n\nTo view the tool's help information, use:\n```bash\ngoto -h\n```\nor\n```bash\ngoto --help\n```\n\n### Version\n\nTo view the tool's version, use:\n```bash\ngoto -v\n```\nor\n```bash\ngoto --version\n```\n\n## Extras\n\n### Push before changing directories\n\nTo first push the current directory onto the directory stack before changing directories, type:\n```bash\ngoto -p \u003calias\u003e\n```\nor\n```bash\ngoto --push \u003calias\u003e\n```\n\n### Revert to a pushed directory\nTo return to a pushed directory, type:\n```bash\ngoto -o\n```\nor\n```bash\ngoto --pop\n```\n\n#### Notes\n\nThis command is equivalent to `popd`, but within the `goto` command.\n\n## Troubleshooting\n\n### Updating from 1.x to 2.x\n\nFrom version **2.x and after**, the `goto` DB file is located in the `$XDG_CONFIG_HOME` or in the `~/.config` directory under the name `goto`.\n\nIf you updated from version **1.x** to **2.x or newer**, you need to move this file which was previously located at `~/.goto`.\n\n*Note that the new file is not hidden, it does not start with a dot `.`*\n\n### zsh\n\n#### command not found: compdef\n\nIn case you get such an error, you need to load the `bashcompinit`. Append this to your `.zshrc` file:\n```bash\nautoload bashcompinit\nbashcompinit\n```\n\n## TODO\n\n* ~~Test on macOS~~ extensively\n* Write [tests](https://github.com/iridakos/goto/issues/2)\n\n## Contributing\n\n1. Fork it ( https://github.com/iridakos/goto/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Make sure that the script does not have errors or warning on [ShellCheck](https://www.shellcheck.net/)\n6. Create a new Pull Request\n\n## License\n\nThis tool is open source under the [MIT License](https://opensource.org/licenses/MIT) terms.\n\n[[Back To Top]](#goto)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firidakos%2Fgoto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Firidakos%2Fgoto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Firidakos%2Fgoto/lists"}