# @ — Natural Language to Shell Commands via Claude Code ![at-command demo](at-command.gif) Type `@ ` 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` ```sh 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` ```sh @() { local request="$*" local system_prompt=$(cat ~/.at_prompt) printf "⏳ thinking... " local cmd=$(claude -p --model sonnet "$system_prompt $request" | head -1) printf "\r\033[K" # clear the thinking line print -z "$cmd" } ``` Then reload your shell: ```sh source ~/.zshrc ``` 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 ```sh @ 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.gz ``` The 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 1. `@()` is a zsh function that takes your natural language request as arguments. 2. It reads the system prompt from `~/.at_prompt` and sends it along with your request to Claude Code in print mode (`-p`). 3. Claude returns a single shell command. 4. `print -z` pushes the command into the zsh line editor buffer so you can inspect/edit before executing.