Ask Terminal AI is a command-line tool that allows users to quickly get and execute shell commands using AI or interact directly with AI in the terminal. It provides both a virtual terminal mode for command suggestions and a conversation mode for general queries.
⚡ DISCLAIMER: 99% of this project's code was generated by AI ⚡
- Download file
wget -O ask "https://github.com/keizman/Ask-Terminal-AI/releases/download/main/ask_linux" - Generate config.yaml and edit
If u have not config.yaml at conf dir, it will auto generate and hint you file location
ask Modify model and apikey
vim /root/.config/askta/config.yaml - start to use
- Copy from another machine
scp -r root@{ip}:/root/.config/askta /root/.config/- Download file
wget -O ask "https://github.com/keizman/Ask-Terminal-AI/releases/download/main/ask_linux" - Make the binary executable:
chmod +x ask- Optionally install to the system path:
sudo mv ask /usr/local/bin/ask-
Clone the repository:
git clone https://github.com/keizman/Ask-Terminal-AI.git # Or if you already have the code: cd Ask-Terminal-AI
-
Build the binary:
go build -o ask main.go
-
Make the binary executable:
chmod +x ask
-
Optionally install to the system path:
sudo mv ask /usr/local/bin/ask
Before using Ask Terminal AI, you need to create a configuration file.
-
Create a configuration directory:
mkdir -p ~/.config/askta -
Create a
config.yamlfile:nano ~/.config/askta/config.yaml -
Add the following content (replace with your actual values):
# AI service configuration base_url: "https://api.openai.com/v1/" # API base URL api_key: "your-api-key" # API key model_name: "gpt-4o-mini" # Model to use # Feature configuration private_mode: false # Privacy mode sys_prompt: "I'm using Linux" # Custom system prompt # Provider configuration provider: "openai-compatible" # Currently only supports openai-compatible
-
Save the file: Use
Ctrl+O, pressEnter, thenCtrl+Xto exit nano.
-
To get AI-suggested commands, type:
ask
Then, enter a query like:
how to find the largest files on my system
-
You'll get a list of suggested commands. Here are the key bindings:
- Arrow keys (↑/↓): Navigate suggestions
- Enter: Execute the selected command
Ctrl+qorCtrl+C: Exit
- To have a conversation with the AI, use:
ask -i "explain the difference between grep and awk" - Or input file content
echo "Do you see spelling errors in the following text?"; cat script.sh | ask -i
| Option | Description |
|---|---|
-c, --config FILE |
Specify configuration file location |
-m, --model NAME |
Temporarily specify model to use |
-p, --provider NAME |
Temporarily specify AI provider (currently only openai-compatible) |
-u, --url URL |
Temporarily specify API base URL |
-k, --key KEY |
Temporarily specify API key |
-s, --sys-prompt TEXT |
Temporarily specify system prompt |
-x, --proxy URL |
Specify proxy URL (e.g., http://user:pass@host:port) |
--private-mode |
Enable privacy mode |
-v, --version |
Show version information |
-h, --help |
Show help information |
-show |
Show command history |
ask --model gpt-4 --sys-prompt "I'm using Ubuntu 22.04" "how to install Docker"- Command history:
C:\Users\{user}\AppData\Local\Temp\askta_Chistory.log - Application logs:
/tmp/askta_run.log
- API keys are stored encrypted on disk.
- Use
--private-modeto avoid sending directory structure in queries.
go mod init ask_terminal && go mod tidy
go build -ldflags="-s -w" -o ask.exe main.go
upx --best ask.exe
(choco install upx)
- Support multi-turn conversations
- Support (i18n)
- ✓ Support proxy