Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Repository files navigation

dx

Tiny, local-only directory autocomplete for zsh.

dx watches directories you visit, keeps a small background index, and shows a terminal-native list while you type cd .... Press Tab/Shift-Tab to cycle, then Enter to open the selected directory.

% cd ~/dev/s

dx  directories
  › ~/dev/sites
    ~/dev/services
  Tab next · Shift-Tab previous · Enter open

Why

Modern terminal autocomplete is excellent, but the useful directory layer does not need a large AI application. dx isolates that job in one small binary and one zsh hook.

Properties

  • one self-contained Go binary;
  • shared background daemon over a user-private Unix socket;
  • filesystem-prefix and frequency/recency ranking;
  • terminal-native menu; no Accessibility permission or macOS input method;
  • no network, account, telemetry, AI model, or secret access;
  • Linux and macOS; zsh 5.8+;
  • MIT licensed.

dx is an independent implementation. It does not copy or embed code from Kiro, Fig, Amazon Q, or another proprietary autocomplete product. The menu is terminal-native rather than an operating-system floating overlay.

Install from source

Requirements: Go 1.22+, zsh 5.8+.

git clone https://github.com/dmdfami/dx.git
cd dx
make test e2e
make install
exec zsh

Then type:

cd ~/dev/

Commands

dx daemon start|stop|status
dx add /path
dx query --plain web
dx init zsh
dx doctor
dx version

Data and security

  • State: ${XDG_STATE_HOME:-~/.local/state}/dx/state.json
  • Socket: ${XDG_RUNTIME_DIR:-/tmp/dx-$UID}/dx/dx.sock
  • Log: ${XDG_STATE_HOME:-~/.local/state}/dx/daemon.log

The daemon accepts only a tiny JSON protocol, caps request sizes, validates existing directories, binds a Unix socket with mode 0600, and never executes stored paths as commands.

Uninstall

bash scripts/uninstall.sh          # keep ranking state
bash scripts/uninstall.sh --purge  # remove state too

Development

go test ./...
bash test/e2e.sh

The E2E test starts an isolated daemon, validates socket permissions and ranking, opens a real zsh through a pseudo-terminal, checks that the live menu is drawn, and uses Tab + Enter to change directory.

About

Tiny local-first directory autocomplete for Zsh

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages