# cds **Repository Path**: shanewa/cds ## Basic Information - **Project Name**: cds - **Description**: Deep paths get typed once and then forgotten. cds stores them as names, jumps straight there, and keeps working on Linux, WSL2, Cygwin, Git Bash, and macOS. - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-10-30 - **Last Updated**: 2026-10-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: Linux, Cli ## README

cds

cds

Change directory. Savor the shortcut.

Source · Gitee Mirror · Submit an Issue · MIT License

GitHub stars  Last commit  MIT license  bash or zsh



Deep paths get typed once and then forgotten. `cds` stores them as names, jumps straight there, and keeps working on Linux, WSL2, Cygwin, Git Bash, and macOS. ## Why the name `cds` is typed with the left hand alone. On a QWERTY keyboard, `c`, `d`, and `s` sit close together on the left side, and `d` and `s` are on the home row. Your fingers barely leave their resting position, so the command goes out fast, one-handed, and without a reach. Each keystroke is a short, comfortable move. ## Install Works with bash 3.2+ or zsh on Linux, WSL2, Cygwin, Git Bash, and macOS. ```bash curl -fsSL https://raw.githubusercontent.com/shanewa/cds/main/install.sh | sh ``` In mainland China, use the Gitee mirror. The installer also tries Gitee on its own when GitHub is unreachable. ```bash curl -fsSL https://gitee.com/shanewa/cds/raw/main/install.sh | sh ``` Prefer to read the script before running it: ```bash curl -fsSL -o install.sh https://raw.githubusercontent.com/shanewa/cds/main/install.sh less install.sh sh install.sh ``` Set `CDS_RAW_BASE` to fetch from one source only, for example `CDS_RAW_BASE=https://gitee.com/shanewa/cds/raw/main sh install.sh`. The installer saves `cds` to `~/.local/share/cds/cds` and adds one `alias cds=...` line to `~/.bashrc`, `~/.bash_profile` (macOS bash), or `~/.zshrc`. Run it again to update `cds`. The alias is not added twice. Installing from a clone instead? Source the script yourself. `cd` has to happen in the shell you are already using, so never execute it. ```bash alias cds=". /path/to/cds/src/cds" ``` Requires bash 3.2+ or zsh. ```text cds work # jump to a saved alias cds -a work -p # save the current directory as work cds -g # walk the only subdirectory until the path forks cds -w 'C:\src' # land on the POSIX path for that Windows folder ``` ## Commands ```text cds [ --help|-h ] [ ] [ - ] [ --go|-g ] [ --last|-l ] [ --first|-f ] [ --win|-w ] [ --add|-a ] [ --path|-p ] [ --delete|-d ] [ --show|-s ] ``` | Command | What it does | | --- | --- | | `cds` | `cd` to `$ROOT` when that directory exists | | `cds ` | `cd` to the path saved under that name | | `cds -a -p [path]` | Save an alias. Omit the path to use `$PWD` | | `cds -d ` | Delete an alias | | `cds -s` | List every alias | | `cds -n` | `cd` to the nth entry from `ls` | | `cds -f` / `cds -l` | `cd` to the first or last entry from `ls` | | `cds -g` | Keep entering the only subdirectory until there are zero or several | | `cds -w ` | `cd` to a Windows path (`C:\...` or `C:/...`) | | `cds -h` / `cds -v` | Help, or the version history | Aliases live in `~/.cds.cnfg` as `name:path`. Override the file with `CDS_CNFG`. ```bash export CDS_CNFG="$HOME/dotfiles/cds.cnfg" ``` A path under `$ROOT` is stored as `${ROOT}/...` and expanded again when you jump. ## Windows paths `cds -w` picks the converter for the shell you are in. Set `CDS_LINUX_MOUNT` only when the prefix is not the default. | Shell | `C:\Program Files` becomes | | --- | --- | | WSL2 | `/mnt/c/Program Files` via `wslpath` | | Cygwin | `/cygdrive/c/Program Files` via `cygpath` | | MSYS2 / Git Bash | `/c/Program Files` via `cygpath` | WSL2 falls back to `automount.root` in `/etc/wsl.conf` when `wslpath` is missing. ```bash export CDS_LINUX_MOUNT=/mnt cds -w "C:\Program Files (x86)" ``` ## Where it runs - GNU/Linux, including Ubuntu, Debian, and Red Hat - WSL2 - Cygwin, MSYS2, and Git Bash - macOS, with zsh or bash No `gawk`. No bash 4 associative arrays. The same file sources on all of them.