{"id":44763157,"url":"https://github.com/elias-ba/ask","last_synced_at":"2026-02-28T21:02:23.283Z","repository":{"id":225208001,"uuid":"765357315","full_name":"elias-ba/ask","owner":"elias-ba","description":"ask is an AI-powered CLI tool for developers who live in the terminal. It brings multi-provider LLM support, agent capabilities, and shell-native intelligence to your fingertips.","archived":false,"fork":false,"pushed_at":"2025-12-22T00:14:07.000Z","size":256,"stargazers_count":41,"open_issues_count":15,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-22T22:52:28.043Z","etag":null,"topics":["agent","ai","anthropic","automation","bash","claude","cli","developer-tools","gpt","llm","openai","openrouter","shell","terminal"],"latest_commit_sha":null,"homepage":"https://elias-ba.github.io/ask/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elias-ba.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-29T19:06:11.000Z","updated_at":"2025-12-22T00:14:11.000Z","dependencies_parsed_at":"2024-02-29T20:26:22.808Z","dependency_job_id":"7c4be998-6135-4d35-89ee-1bf9d964cf01","html_url":"https://github.com/elias-ba/ask","commit_stats":null,"previous_names":["elias-ba/chatgpt-cli","elias-ba/ask"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/elias-ba/ask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ba%2Fask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ba%2Fask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ba%2Fask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ba%2Fask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elias-ba","download_url":"https://codeload.github.com/elias-ba/ask/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elias-ba%2Fask/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T02:07:14.481Z","status":"online","status_checked_at":"2026-02-16T02:03:22.852Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","anthropic","automation","bash","claude","cli","developer-tools","gpt","llm","openai","openrouter","shell","terminal"],"created_at":"2026-02-16T03:27:26.421Z","updated_at":"2026-02-16T03:27:26.984Z","avatar_url":"https://github.com/elias-ba.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n  \u003cimg src=\"assets/ask_3.png\" alt=\"ask\" width=\"50\" height=\"50\"\u003e\n  \u003cstrong style=\"font-size: 2.5rem;\"\u003eask.\u003c/strong\u003e \u003cem\u003edon't grep. don't awk. just ask\u003c/em\u003e\n\u003c/p\u003e\n\nask is an AI-powered CLI tool for developers who live in the terminal. It brings multi-provider LLM support, agent capabilities, and shell-native intelligence to your fingertips.\n\n## Why ask?\n\nUnlike generic LLM CLIs, ask is built for **shell power users**:\n\n- **Generates reusable bash functions** - Not just answers, but tools\n- **Agent mode** - Executes safe plans with your approval\n- **Shell-native** - Works perfectly with pipes and Unix philosophy\n- **Context-aware** - Understands git repos, recent commands, system state\n- **Fast \u0026 streaming** - Real-time responses as you type\n- **Multi-provider** - Anthropic, OpenAI, Google Gemini, OpenRouter, DeepSeek, and Ollama (local)\n- **Structured output** - `--json`, `--csv`, `--md`, `--raw` for pipeline composability\n- **Pure bash** - No Python, Node, or other runtimes needed\n\n## Installation\n\n### Quick Install\n\n```bash\n# Download\ncurl -o ask https://raw.githubusercontent.com/elias-ba/ask/main/ask\nchmod +x ask\n\n# Move to PATH\nsudo mv ask /usr/local/bin/\n\n# Or for user-only install\nmv ask ~/.local/bin/\n```\n\n### Using Git\n\n```bash\ngit clone https://github.com/elias-ba/ask.git\ncd ask\nchmod +x ask\nsudo ln -s \"$(pwd)/ask\" /usr/local/bin/ask\n```\n\n### Dependencies\n\n- `curl` - For API calls\n- `jq` - For JSON processing\n- Optional: `glow` or `bat` for prettier output\n\nInstall on Ubuntu/Debian:\n\n```bash\nsudo apt-get install curl jq\n```\n\nInstall on macOS:\n\n```bash\nbrew install curl jq\n```\n\n### Uninstall\n\nTo completely remove ask from your system:\n\n```bash\n# Remove the binary\nsudo rm /usr/local/bin/ask\n# Or if installed to user directory\nrm ~/.local/bin/ask\n\n# Remove configuration and saved functions\nrm -rf ~/.config/ask/\n\n# Remove cache and history\nrm -rf ~/.cache/ask/\n```\n\n## Setup\n\n### Quick Setup (Recommended)\n\nask manages API keys for you:\n\n```bash\n# Set your API key (it will prompt you securely)\nask keys set anthropic\n\n# Or for other providers\nask keys set openai\nask keys set openrouter\nask keys set google\nask keys set deepseek\n\n# List your configured keys\nask keys list\n\n# Check where keys are stored\nask keys path\n```\n\nKeys are stored securely in `~/.config/ask/keys.env` with 600 permissions (readable only by you).\n\n### Alternative: Environment Variables\n\nIf you prefer environment variables:\n\n```bash\n# Anthropic (recommended)\nexport ANTHROPIC_API_KEY='sk-ant-...'\n\n# OpenAI\nexport OPENAI_API_KEY='sk-...'\n\n# Google Gemini\nexport GOOGLE_API_KEY='...'\n\n# OpenRouter\nexport OPENROUTER_API_KEY='sk-or-...'\n\n# DeepSeek\nexport DEEPSEEK_API_KEY='...'\n\n# Ollama (optional, defaults to http://localhost:11434)\nexport OLLAMA_HOST='http://localhost:11434'\n```\n\nAdd to your `~/.bashrc` or `~/.zshrc` to persist.\n\n### Get API Keys\n\n- **Anthropic**: \u003chttps://console.anthropic.com/\u003e\n- **OpenAI**: \u003chttps://platform.openai.com/api-keys\u003e\n- **Google Gemini**: \u003chttps://aistudio.google.com/apikey\u003e\n- **OpenRouter**: \u003chttps://openrouter.ai/keys\u003e\n- **DeepSeek**: \u003chttps://platform.deepseek.com/api_keys\u003e\n\n#### Ollama (Local Models)\n\nOllama requires no API key. Install it and pull a model:\n\n```bash\n# Install Ollama (https://ollama.com)\n# Then pull a model\nollama pull llama3.2\n\n# Use with ask\nask -L \"your question\"\n```\n\n## Usage\n\n### Quick Questions\n\n```bash\n# Simple queries\nask \"how do I find large files?\"\n\n# Pipe input\ngit log --oneline | ask \"summarize recent changes\"\n\n# Debug errors\ncat error.log | ask \"what's causing these errors?\"\n```\n\n### Agent Mode\n\nLet ask execute tasks for you:\n\n```bash\n# Optimize images\nask --agent \"find and optimize all PNG files in ./images\"\n\n# Clean up\nask --agent \"remove docker containers older than 30 days\"\n\n# Dry run first\nask --agent --dry-run \"reorganize these files by type\"\n```\n\n### Generate Shell Functions\n\nCreate reusable tools:\n\n```bash\n# Generate a function\nask --fn parse_nginx \"extract 500 errors from nginx access logs\"\n\n# ask will generate, validate, and save:\n# parse_nginx() {\n#   grep \" 500 \" \"$1\" | awk '{print $1, $7}' | sort | uniq -c\n# }\n\n# Use it immediately\nsource ~/.config/ask/functions.sh\nparse_nginx /var/log/nginx/access.log\n```\n\n### Git Helpers\n\n```bash\n# Generate semantic commit messages\ngit add .\nask commit\n\n# Review PR\nask pr-review\n\n# Explain what changed\ngit diff main | ask \"explain these changes\"\n```\n\n### Interactive Mode\n\n```bash\nask\n# Starts interactive chat with:\n# - Conversation history\n# - Context awareness\n# - Multi-turn dialogue\n# - Special commands (/help, /clear, etc.)\n```\n\n## Special Modes\n\n### Context-Aware Queries\n\n```bash\n# Minimal context (pwd, date)\nask --context min \"what's in this directory?\"\n\n# Auto context (git, recent commands)\nask --context auto \"debug this error\"\n\n# Full context (env, history, system)\nask --context full \"why did that command fail?\"\n```\n\n### Local Models (Ollama)\n\n```bash\n# Use a local model\nask -L \"explain this error\"\n\n# List installed local models\nask -L --list-models\n\n# Use a specific local model\nask -L -m mistral \"your question\"\n\n# Custom Ollama host\nOLLAMA_HOST=http://192.168.1.10:11434 ask -L \"hello\"\n```\n\n### Model Selection\n\n```bash\n# List available models\nask --list-models\n\n# Use specific model\nask -m gpt-4o \"write a poem\"\n\n# Switch provider\nask -p openai \"your question\"\n```\n\n### Structured Output\n\n```bash\n# JSON with metadata envelope (validated with jq)\nask --json \"list HTTP status codes\" | jq '.response'\n\n# CSV with headers\nask --csv \"compare python vs javascript\" \u003e comparison.csv\n\n# Clean Markdown\nask --md \"explain REST APIs\"\n\n# Raw text, no ANSI codes (useful in scripts)\nask --raw \"generate a UUID\" | pbcopy\n```\n\nJSON and CSV automatically disable streaming to validate and post-process the full response.\n\n### Streaming Control\n\n```bash\n# Enable streaming (default)\nask -s \"long explanation\"\n\n# Disable for parseable output\nask -n \"output json\" | jq .\n```\n\n## Interactive Commands\n\nInside `ask` interactive mode:\n\n| Command                      | Description                |\n| ---------------------------- | -------------------------- |\n| `/clear`                     | Clear conversation history |\n| `/save`                      | Save conversation to file  |\n| `/load`                      | Load previous conversation |\n| `/models`                    | List available models      |\n| `/switch [provider] [model]` | Switch provider/model      |\n| `/context [level]`           | Set context level          |\n| `/help`                      | Show help                  |\n| `/exit` or `/quit`           | Exit                       |\n\n## Configuration\n\nask uses XDG Base Directory spec:\n\n```bash\n~/.config/ask/           # Configuration\n  └── functions.sh       # Generated functions\n\n~/.cache/ask/            # Cache \u0026 history\n  ├── history.jsonl      # Conversation history\n  └── context.json       # Context cache\n```\n\n## Examples\n\n### Pipeline Integration\n\n```bash\n# Analyze logs\ntail -f /var/log/app.log | ask \"alert me to errors\"\n\n# Process data\ncat users.csv | ask \"find duplicate emails\"\n\n# Code review\ngit diff | ask \"suggest improvements\"\n```\n\n### Development Workflow\n\n```bash\n# Debug\nask \"why is this segfaulting?\" \u003c debug.log\n\n# Test generation\nask --fn test_auth \"generate pytest tests for auth.py\"\n\n# Documentation\nask \"explain this codebase\" --context full\n```\n\n### System Administration\n\n```bash\n# Diagnose issues\ndocker ps | ask \"which containers are unhealthy?\"\n\n# Performance analysis\ntop -bn1 | ask \"what's consuming resources?\"\n\n# Security audit\nask --agent \"find files with 777 permissions\"\n```\n\n## Contributing\n\nContributions welcome! ask is designed to be:\n\n- **Simple** - Pure bash, easy to understand\n- **Powerful** - Real developer workflows\n- **Safe** - Always confirm dangerous operations\n- **Extensible** - Easy to add providers/features\n\n## Philosophy\n\nask follows the Unix philosophy:\n\n1. **Do one thing well** - Shell-native AI assistance\n2. **Work together** - Pipe-friendly, composable\n3. **Text streams** - Universal interface\n4. **Simple** - Bash script, no complex dependencies\n\nBuilt for developers who never leave the terminal.\n\n## Troubleshooting\n\n### Command not found\n\n```bash\n# Check installation\nwhich ask\n\n# Verify it's executable\nchmod +x /usr/local/bin/ask\n\n# Check PATH\necho $PATH\n```\n\n### API key errors\n\n```bash\n# Verify key is set\necho $ANTHROPIC_API_KEY\n\n# Test manually\nask --version\n```\n\n### Streaming issues\n\n```bash\n# Disable streaming if terminal has issues\nask -n \"your query\"\n```\n\n## License\n\nMIT License - See LICENSE file\n\n## Links\n\n- **GitHub**: \u003chttps://github.com/elias-ba/ask\u003e\n- **Issues**: \u003chttps://github.com/elias-ba/ask/issues\u003e\n- **Discussions**: \u003chttps://github.com/elias-ba/ask/discussions\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias-ba%2Fask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felias-ba%2Fask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felias-ba%2Fask/lists"}