Skip to main content

cx — directory navigation by alias

NOTE: this project was generated by AI. Use at your own risk.

Jump to any directory with a short name. cx lets you define aliases for commonly used directories and navigate to them instantly — with bash completion, auto-assigned letter shortcuts, and sub-path navigation.

cx add src ~/projects/src
cx src                          # cd to ~/projects/src
c                               # cd by letter shortcut
cx src/sub/module               # cd with sub-path
cx -                            # cd to previous dir

Install

pip install cx-command

Then add shell integration to your ~/.bashrc:

eval "$(cx init bash)"

Restart your shell or source ~/.bashrc. That's it.

Usage

Command Description
cx List all aliases (letter, name, path)
cx <name> cd to alias
cx <letter> cd by auto-assigned letter (a, b, c, ...)
cx <name>/sub/path cd to alias joined with sub-path
cx - cd to previous directory
cx add <name> <path> [-g <group>] Add an alias
cx rm <name> Remove an alias
cx edit Open config in $EDITOR
cx which <name>[/sub] Print resolved path (scriptable)
cx recent [N] Show last N visited dirs
cx open [<name>[/sub]] [-w <opener>] Open in file manager/VSCode/etc.
cx ls <name>[/sub] [-- ls-args] List directory contents
cx exec <name>[/sub] -- cmd args Run command in resolved dir
cx init <shell> Print shell integration code

Config

Aliases are stored in ~/.cxrc.toml. The file is created automatically on first use.

[settings]
history_size = 50

[openers]
code = "code"
explorer = "explorer"

[aliases]
src = "${PROJECTS}/src"
nb  = "~/notebook"

[aliases.projects]
foo = "~/projects/foo"
bar  = "~/projects/bar"
  • Paths support ${VAR}, $VAR environment variable expansion and ~ home expansion.
  • Letters (a, b, c, ... aa, ab, ...) are auto-assigned in the order aliases appear.
  • Groups are for display only — all names are globally unique.
  • Openers are named commands for cx open. The default opener is xdg-open on Linux, open on macOS, explorer on Cygwin/Windows.

Scripting

cx which writes the resolved path to stdout without any shell directives, so it's safe for subshell use:

cd "$(cx which foo)/conf"
cp "$(cx which foo)/config.yaml" .

Metadata

Release files for cx-command 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cx-command 0.1.0
File Size Uploaded
cx_command-0.1.0.tar.gz 22.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cx-command 0.1.0
File Interpreter ABI Platform
cx_command-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.6 kB

Release files / cx_command-0.1.0.tar.gz

Download URL cx_command-0.1.0.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ef9068bff0909df7b922bb4af28bfb6da8ca5a275db97f86e3a84862b81d5381
BLAKE2b-256 checksum
How to use checksums
653a52771cd182f314ba7209437be9c6ca74b376999d296b46faf4f4e3585e52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / cx_command-0.1.0-py3-none-any.whl

Download URL cx_command-0.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daf165c3a62142c902b242bab7146ee9c002e723d85b7aa9b01a84ce4dab5189
BLAKE2b-256 checksum
How to use checksums
57b7d9f0f0a7fb902175004e22313fc47c7fa1f66711f8b27428cda708dc8167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page