simple bash script that helps you with terminal commands with the power of chatgpt
Turn plain-English descriptions into shell commands. Powered by OpenAI or Google Gemini.

cat file | ask "...").- prefix.ask !! — Explain the last command from your history.ask commit — Generate a commit message for current changes and commit them.rm -rf, sudo).~/.ask_config.curl -fsSL https://zmsp.github.io/ask/install.sh | bash
Or manually:
curl -fsSL https://raw.githubusercontent.com/zmsp/ask/main/ask.sh -o /usr/local/bin/ask
chmod +x /usr/local/bin/ask
ask --setup
irm https://zmsp.github.io/ask/install.ps1 | iex
Or manually:
irm https://raw.githubusercontent.com/zmsp/ask/main/ask.ps1 -OutFile "$env:USERPROFILE\bin\ask.ps1"
# Add $env:USERPROFILE\bin to your PATH, then:
ask --setup
| Platform | Script | Installer |
|---|---|---|
| macOS / Linux | ask (bash) |
install.sh |
| Windows | ask.ps1 (PowerShell 5.1+) |
install.ps1 |
| Tool | Install |
|---|---|
bash 4+ |
Pre-installed on macOS/Linux |
curl |
brew install curl / apt install curl |
jq |
brew install jq / apt install jq |
| AI API key | OpenAI or Gemini |
ask "list all .log files modified in the last 7 days"
ask "restart nginx if it's not running"
ask "find the 5 largest files in my home directory"
Suggested:
find ~ -type f -printf '%s %p\n' | sort -rn | head -5
Run this command? (y/n): y
ask -q "What does HEAD~3 mean in git?"
ask -e "Explain the difference between CMD and ENTRYPOINT in Docker"
cat error.log | ask "why is this failing?"
git diff | ask "summarise these changes"
cat config.yml | ask "is anything misconfigured here?"
ls -la /etc/hosts
ask !!
# → Explains ls, -l (long format), -a (hidden files), and the path
ask commit
Git status:
M src/index.js
M README.md
Suggested commit message:
Update index.js routing and expand README usage section
Commit with this message? (y/n): y
[main 3f2a1b4] Update index.js routing and expand README usage section
ask "recursively delete all files in /tmp/cache"
Suggested:
rm -rf /tmp/cache/*
⚠ This command looks dangerous. Type yes to run, anything else cancels.
Run ANYWAY? yes
Configuration is stored in ~/.ask_config (user-readable only).
Run the interactive wizard:
ask --setup
Or edit the file directly:
# ~/.ask_config
provider=openai # openai | gemini
model=gpt-4.1-nano # leave blank for cheapest default
max_tokens=200
openai_api_key=sk-...
gemini_api_key=AIza...
Environment variables always take priority over the config file:
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="AIza..."
export VERBOSE=true # print debug info
| Provider | Default model | Price (input/output per 1M tokens) |
|---|---|---|
openai |
gpt-4.1-nano |
$0.10 / $0.40 |
gemini |
gemini-2.5-flash-lite |
$0.10 / $0.40 |
OpenAI models: gpt-4.1-nano · gpt-4.1-mini · gpt-4.1 · gpt-4o-mini
Gemini models: gemini-2.5-flash-lite · gemini-2.5-flash · gemini-2.5-pro
MIT © Zobair