
A dmenu-style picker for macOS, built on Raycast. Pipe a list of options into the dmenu command-line script, pick one in Raycast, and get your selection printed back to stdout — just like the classic X11 dmenu.
The project has two halves that talk to each other over a local socket:
dmenu.py (bundled with the extension as assets/dmenu.py) — a CLI script you pipe items into. It starts a local socket server, opens the Raycast extension via a deeplink, sends over the list of items, waits for you to pick one, and prints your selection to stdout.dmenu.tsx — the Raycast extension command. It connects to the socket, receives the list, shows it as a searchable Raycast list, and sends your selection back when you choose one.dmenu.py is only meant to be launched through the dmenu script — running the Raycast command directly (from root search, a hotkey, etc.) shows a friendly "not meant to be launched directly" screen instead of crashing, with an action to install the CLI script (see below).
~/.local/bin/dmenu and marks it executable.~/.local/bin is on your PATH. The same screen has a Copy Path Export Line action; paste it into your ~/.zshrc (or equivalent) and reload your shell:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Once that's done, dmenu is callable from any terminal, anywhere:
echo -e "Option A\nOption B\nOption C" | dmenu -p "Pick one"
git branch | sed 's/^[* ] //' | dmenu -p "Checkout branch" | xargs git checkout
If you're working on the extension itself rather than just using it:
git clone https://github.com/AnasFd/dmenu-raycast dmenu-raycast
cd dmenu-raycast
npm install
npm run dev # runs the command via `ray develop`, importing it into Raycast
While developing, you can pipe into assets/dmenu.py directly instead of the installed dmenu shim:
echo -e "Option A\nOption B" | ./assets/dmenu.py -p "Pick one"
dmenu Raycast extension command installed/available locallyBased on irth/dmenu_raycast. Fixed here after the original went stale.
This command mimics a dmenu-like functionality.
~/.local/bin/dmenu path.package-lock.json so a clean install actually resolves @raycast/api to the supported 2.2.1, matching package.json.0700) temp directory, with the socket file itself set to 0600. Previously the port was visible to any local process via ps aux, allowing another process to read the item list or inject a fake selection./tmp/dmenu_ts_debug.log.dmenu script, that copies the bundled CLI to ~/.local/bin/dmenu and marks it executable.