{"id":16759431,"url":"https://github.com/victorfsf/cdpath","last_synced_at":"2026-05-07T10:37:03.779Z","repository":{"id":90234564,"uuid":"79598348","full_name":"victorfsf/cdpath","owner":"victorfsf","description":"A simple CLI for handling the CDPATH environment variable.","archived":false,"fork":false,"pushed_at":"2017-11-14T14:25:03.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T08:28:35.852Z","etag":null,"topics":["bash","cd","cdpath","cli","shellscript","shortcut","zsh"],"latest_commit_sha":null,"homepage":"","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/victorfsf.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2017-01-20T21:06:15.000Z","updated_at":"2023-03-24T05:39:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"fec440ed-5318-4b85-b372-f9a439160240","html_url":"https://github.com/victorfsf/cdpath","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/victorfsf/cdpath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fcdpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fcdpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fcdpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fcdpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorfsf","download_url":"https://codeload.github.com/victorfsf/cdpath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorfsf%2Fcdpath/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268618266,"owners_count":24279243,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bash","cd","cdpath","cli","shellscript","shortcut","zsh"],"created_at":"2024-10-13T04:08:07.231Z","updated_at":"2026-05-07T10:37:03.519Z","avatar_url":"https://github.com/victorfsf.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdpath.sh\n\n[![Build Status](https://travis-ci.org/victorfsf/cdpath.svg?branch=master)](https://travis-ci.org/victorfsf/cdpath)\n\nA simple CLI for handling the CDPATH environment variable.\n**Tested on Bash and ZSH**.\n\n### What's CDPATH?\n\n`CDPATH` is an environment variable present on Unix-based systems that allows you to create shortcuts to any directory on your system, which will be accessible by using the `cd` command. Consider the directory: `$HOME/company/projects/my_project`. With `CDPATH`,\nyou can access it by defining a shortcut (the name, though, must be the last directory name):\n```shell\n$ cd my_project\n~/company/projects/my_project\n```\nBut, for that to happen, you'd have to `export CDPATH` with the following structure, and keep it saved on your shell's `rc file (.bashrc, .zshrc...)`:\n```shell\n$ export CDPATH=\".:my_project:$HOME/company/projects/\"\n```\n\n## Sumary\n\n  - [Installation](#installation)\n    - [Manual Installation](#manual-installation)\n    - [Using install.sh](#using-installsh)\n  - [Using cdpath.sh](#using-cdpathsh)\n  - [Uninstalling](#uninstalling)\n  - [Known Problems](#known-problems)\n\n## Installation\n\n#### Manual Installation\nDownload the file `cdpath.sh` to any directory you'd like (usually, I'd use `/usr/local/bin/`):\n```\ncurl -o /usr/local/bin/cdpath.sh https://raw.githubusercontent.com/victorfsf/cdpath/master/cdpath.sh\n```\nThen, add the following line to your shell's `rc file (.bashrc, .zshrc...)`:\n```shell\nsource \"/path/to/cdpath.sh\"\n```\nSo, if you chose `/usr/local/bin/`:\n```shell\nsource \"/usr/local/bin/cdpath.sh\"\n```\nThen, restart or source your shell:\n```shell\n$ . ~/.bashrc\n```\n\n#### Using install.sh\nRun the following command:\n```shell\n# shell = \"~/.bashrc\", \"~/.zshrc\" or any other shell .rc file\n$ bash \u003c(curl -s https://raw.githubusercontent.com/victorfsf/cdpath/master/install.sh) \u003cshell\u003e\n# e.g. \"bash \u003c(curl -s https://raw.githubusercontent.com/victorfsf/cdpath/master/install.sh) ~/.bashrc\"\n```\n\n## Using cdpath.sh\n\nBy using `cdpath.sh`, you can not only have more control over the paths you choose to give a shortcut, but you can manage them with a simple interface.\n\n### Sumary:\n\n  - [Base Command](#base-command)\n  - [Asking for help](#asking-for-help)\n  - [Adding a path/shortcut](#adding-a-pathshortcut)\n  - [Removing a path/shortcut](#removing-a-pathshortcut)\n  - [Listing paths/shortcuts](#listing-pathsshortcuts)\n  - [Installing the `.cdpath` file](#installing-the-cdpath-file)\n  - [Uninstalling the `.cdpath` file](#uninstalling-the-cdpath-file)\n\n#### Base Command\n\nBy typing only `cdpath`, you'll see this:\n```\n$ cdpath\nusage: cdpath [-h] [-r] [-l] [-i] [-u] \u003cname\u003e \u003cpath\u003e\nSee \"cdpath -h\" for help.\n```\n\n#### Asking for help\n\n```\n$ cdpath -h\ncdpath basic usage: \"cdpath \u003cname\u003e \u003cpath\u003e\"\n    name    The path's shortcut, called with \"cd\"\n    path    The path to link the name with\n\ncdpath options:\n    -h    Shows help\n    -r    Removes a shortcut from cdpath (e.g. \"cdpath -r \u003cname\u003e\")\n    -l    Lists all shortcuts and their respective paths\n    -i    Installs cdpath (e.g. \"cdpath -i ~/.bashrc\")\n    -u    Uninstalls cdpath (e.g. \"cdpath -u ~/.bashrc\")\n```\n\n#### Adding a path/shortcut\n\n`cdpath.sh` accepts any of the following path structures:\n```\n$ cdpath my_project $HOME/company/projects/\n```\n\n```\n$ cdpath my_project $HOME/company/projects/my_project\n```\n```\n$ cdpath my_project .\n```\n\n```\n$ cdpath my_project company/projects/\n```\n\n```\n$ cdpath my_project company/projects/my_project\n```\n\n#### Removing a path/shortcut\n\n`cdpath.sh` will loop through the arguments after the `-r` option and try to remove all of the given shortcuts:\n```\n$ cdpath -r my_project\nSuccessfully removed \"my_project\"\n```\n\n```\n$ cdpath -r my_project another_folder\nSuccessfully removed \"my_project\"\nThere's no shortcut named \"another_folder\"\n```\n\n#### Listing paths/shortcuts\n\n```\n$ cdpath -l\nShortcuts:\n    my_project -\u003e /home/user/company/projects/my_project\n```\n\n#### Installing the `.cdpath` file\n\n*This action will be performed when you add a new shortcut*, but if you want to create and configure the `~/.cdpath` file (in case you changed shells and that shell isn't properly configured, for example), you can just call:\n```shell\n# shell = \"~/.bashrc\", \"~/.zshrc\" or any other shell .rc file\ncdpath -i \u003cshell\u003e\n```\n\n#### Uninstalling the `.cdpath` file\n\nTo remove the `~/.cdpath` file and its `source` from the shell's rc file, just type:\n```shell\n# shell = \"~/.bashrc\", \"~/.zshrc\" or any other shell .rc file\n$ cdpath -u \u003cshell\u003e\nUninstalling cdpath...\nDone.\n```\n\n## Uninstalling\n\nTo uninstall, just remove the `cdpath files` and its source from your shell's `rc file`:\n```\nsource \"/usr/local/bin/cdpath.sh\"\n```\nFiles to remove:\n```\n$HOME/.cdpath\n/usr/local/bin/cdpath.sh\n```\n\n## Known Problems\n\nFeel free to report any issues [here](https://github.com/victorfsf/cdpath/issues).\n\n- `cdpath` won't properly work with directories containing spaces in their names.\n- Not exactly sure if it works fine on OSX.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorfsf%2Fcdpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorfsf%2Fcdpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorfsf%2Fcdpath/lists"}