AI-powered shell assistant

don't grep. don't awk. just ask

Quick Install

# macOS / Linux (bash)
curl -fsSL https://raw.githubusercontent.com/elias-ba/ask/main/install.sh | bash

# Windows (PowerShell 7+)
pwsh -NoProfile -Command `
  "iwr https://raw.githubusercontent.com/elias-ba/ask/main/install.ps1 -UseBasicParsing | iex"

# Set up your API key
ask keys set anthropic

# Start asking!
ask "how do I find large files?"

macOS / Linux: bash 3.x+, curl, jq
Windows: PowerShell 7+

Why ask?

Agent Mode

Let AI execute tasks for you with risk-assessed command execution. Auto-approve safe operations or review each step.

Shell Native

Works perfectly with pipes, redirects, and Unix philosophy. Pure bash, no Python or Node required.

Function Generation

Generate reusable bash functions from descriptions. Build your own custom toolset.

Streaming Responses

See answers in real-time as they're generated. Fast, responsive, and interactive.

Secure Key Management

Built-in API key management with 600 permissions. No config file editing needed.

Context Aware

Understands your git repo, recent commands, system state, and working directory automatically.

Multi-Provider

Works with Anthropic, OpenAI, and OpenRouter. Switch models and providers on the fly.

Interactive Mode

Start conversations, save history, switch models mid-chat. Full conversation management.

Git Integration

Generate semantic commit messages, review PRs, explain changes. Built for developers.

Quick Examples

Simple Queries

# Quick questions
ask "how do I find large files in Linux?"

# With piped input
git log --oneline | ask "summarize recent changes"

# Debug errors
cat error.log | ask "what's causing these errors?"

Agent Mode

Let ask execute tasks safely with approval

# Organize files automatically
ask --agent "organize these files by type"

# Dry run first
ask --agent --dry-run "cleanup old docker images"

# Auto-approve safe commands
ask --agent "find TODO comments"
# Type 'a' when prompted to auto-approve

Generate Functions

Create reusable bash functions

# Generate a function
ask --fn parse_nginx "extract 500 errors from nginx logs"

# Use it immediately
source ~/.config/ask/functions.sh
parse_nginx /var/log/nginx/access.log

Git Workflow

Smart git integration

# Generate semantic commit message
git add .
ask commit

# Review PR changes
ask pr-review

# Explain what changed
git diff main | ask "explain these changes"

Interactive Mode

Start a conversation

# Start interactive chat
ask

# Use special commands
ask> /models          # List available models
ask> /switch openai   # Switch provider
ask> /context full    # Enable full context
ask> /save            # Save conversation
ask> /exit            # Exit

Documentation

Quick Start

Get up and running in 5 minutes

Read Guide →

Examples

Usage examples and patterns

View Examples →

Key Management

Secure API key setup and management

Learn More →