v1.0.0 • 2026

ask-ai
A Lightweight Bash CLI for AI API Interactions

Minimal, cross-platform tool for interacting with OpenAI, Anthropic, and Ollama APIs. Only depends on bash, curl, and jq.

live-by-unix 2026 MIT License
ask-ai
$

Features

Lightweight

Only requires bash, curl, and jq. No heavy dependencies or complex installations.

Cross-Platform

Works on Linux, macOS, and Windows (via Git Bash). True portability.

Multiple APIs

Support for OpenAI, Anthropic, and local Ollama APIs in one tool.

Pipe Support

Seamlessly integrate with Unix pipelines for powerful workflows.

JSON Output

Option for structured JSON responses for programmatic processing.

Secure

Automatic file permissions, error sanitization, and security warnings.

Installation

1

Clone the repository

git clone https://github.com/live-by-unix/ask-ai.git
cd ask-ai
2

Install dependencies

# Ubuntu/Debian
sudo apt-get install curl jq

# macOS
brew install curl jq
3

Make executable

chmod +x ask-ai
4

Configure

./ask-ai config
5

(Optional) Create an alias

# Add to ~/.bashrc or ~/.zshrc
alias ask-ai='/path/to/ask-ai/ask-ai'
# Reload shell
source ~/.bashrc

Usage Examples

# Interactive configuration wizard
./ask-ai config

# Pipe model name to config
echo "gpt-4" | ./ask-ai config
# Interactive chat
./ask-ai chat gpt-4

# Pipe input
echo "Explain quantum computing" | ./ask-ai chat claude-3

# JSON output
./ask-ai chat gpt-4 --json

# Pipe to file
cat prompt.md | ./ask-ai chat gpt-5.5 > response.md
# From file
cat prompt.md | ./ask-ai chat gpt-4

# From command output
ls -la | ./ask-ai chat gpt-4

# Chain commands
curl -s https://api.example.com/data | ./ask-ai chat gpt-4

Interactive Demo

Try the interactive terminal simulation below to see ask-ai in action.

ask-ai — Interactive Demo
$ ./ask-ai --help
ask-ai - A lightweight Bash CLI for AI API interactions USAGE: ask-ai <command> [options] COMMANDS: config Configure API settings (interactive wizard) chat <model> Send a chat request to the configured API --version, --v Print version information --help, -h Show this help message
$

Try these commands:

Ready to get started?

Install ask-ai today and start interacting with AI APIs from your terminal.