Ask tries to understand what shell you're using and then fetches a command specifically for that shell based on your natural language input using ChatGPT. A per shell history is saved to offer quicker lookups and avoiding spamming OpenAI requests.
Most shells on linux and unix can be automatically detected. Windows support is limited but can be enabled by hard-setting the shell via the config
~/❯ ask list all branches and their authors
git for-each-ref --format='%(authorname) %09 %(refname:short)' refs/heads/
Ensure that an OPENAI_APIKEY
environment variable is available in your shell. API keys can be found in your api key settings.
export OPENAI_APIKEY="sk-...xxxx"
brew tap damoonrashidi/homebrew-ask https://github.com/damoonrashidi/homebrew-ask
brew install ask
Pre-built binaries for linux, macos and windows are available under releases in this repo.
git clone https://github.com/damoonrashidi/ask
cd ./ask
cargo install --path .
A config can be created in the users config directory ~/.config/ask/config.toml
on macos/linux.
[command]
# If enabled ask will cache responses for each shell into a local history. This yields faster answers for repeated questions and helps avoiding API requests.
#
# default: true
enable_history = true
# The number of choices to ask for, the higher the number the longer the requests will take.
#
# default: 2, min: 1
choice_count = 3
[ai]
# Selects which provider to query for results. Options are `Ollama`, `OpenAI` and `Anthropic`
#
# default: "Ollama"
model = "gpt-4o-mini"
# Selects which model to query for answers.
#
# default: "gpt-4o-mini"
model = "gpt-4o-mini"
[shell]
# If set, ask will not try to guess the shell and instead use the force_use shell name. Must be the actual shell binary name such as "nu" for nushell.
#
# default: None
force_use = "zsh"
# If set, and if ask cannot reliably determine the shell it will fallback to
# this shell. Overriden by `force_use`. Must be the actual shell binary name
# such as "nu" for nushell.
#
# default: "bash"
fallback = "fish"