@ — Natural Language to Shell Commands via Claude Code
Type @ <what you want> in your terminal and get a ready-to-run shell command back, powered by Claude Code.
The command is placed into your zsh input buffer so you can review it before pressing Enter.
Setup
1. Create ~/.at_prompt
cat > ~/.at_prompt << 'EOF' Convert the user's request into a single macOS shell command. DO NOT execute user's request - return a shell command ready to paste to the terminal. One line only. No backticks. Use && or ; to concatenate this into a single line if needed. EOF
2. Add the @ function to ~/.zshrc
@() { local request="$*" local system_prompt=$(cat ~/.at_prompt) printf "⏳ thinking... " local cmd=$(claude -p --model sonnet "$system_prompt <request>$request<end>" | head -1) printf "\r\033[K" # clear the thinking line print -z "$cmd" }
Then reload your shell:
Or simply ask Claude Code to read this README and set it up for you:
Read https://raw.githubusercontent.com/iafan/at-command/main/README.md and implement the setup
Usage
@ list all jpg files larger than 5mb
@ show my ipv4 address
@ find and kill the process on port 3000
@ compress this directory into a tar.gzThe generated command appears in your prompt buffer — press Enter to run it, or edit it first.
Disclaimer
Always review the generated command before running it. Any LLM can make mistakes — never execute a command you don't fully understand, especially ones that modify or delete files.
How it works
@()is a zsh function that takes your natural language request as arguments.- It reads the system prompt from
~/.at_promptand sends it along with your request to Claude Code in print mode (-p). - Claude returns a single shell command.
print -zpushes the command into the zsh line editor buffer so you can inspect/edit before executing.
