Skip to main content

AI-generated utility for firectory navigation by alias — jump to any directory with a short name

Project description

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" .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cx_command-0.1.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cx_command-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file cx_command-0.1.0.tar.gz.

File metadata

  • Download URL: cx_command-0.1.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cx_command-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef9068bff0909df7b922bb4af28bfb6da8ca5a275db97f86e3a84862b81d5381
MD5 97b8e48f086f1a55d90f92b6091dd577
BLAKE2b-256 653a52771cd182f314ba7209437be9c6ca74b376999d296b46faf4f4e3585e52

See more details on using hashes here.

File details

Details for the file cx_command-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cx_command-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for cx_command-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daf165c3a62142c902b242bab7146ee9c002e723d85b7aa9b01a84ce4dab5189
MD5 6797b2b123aa63d66a1cbbace8d063eb
BLAKE2b-256 57b7d9f0f0a7fb902175004e22313fc47c7fa1f66711f8b27428cda708dc8167

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page