# đ¤ AIask > **Turn plain English into shell commands instantly!** [](https://github.com/Hermithic/aiask/releases) [](LICENSE) [](https://golang.org/) AIask is a powerful command-line assistant that understands what you want to do and gives you the exact shell command. No more googling syntax or reading man pages! ``` $ aiask "find all files larger than 100MB" ⨠Suggested command: find . -type f -size +100M What would you like to do? [e]xecute | [c]opy | e[d]it | [r]e-prompt | [q]uit > ``` --- ## ⨠Features ### Core Features - đŖī¸ **Natural Language** â Just describe what you want in plain English - đ **Multi-Shell** â Works with PowerShell, CMD, Bash, Zsh, and Fish - đ§ **Multiple AI Providers** â Grok, OpenAI, Anthropic, Google Gemini, or local Ollama - ⥠**Interactive** â Execute, copy, edit, or refine commands before running - đĨī¸ **Cross-Platform** â Windows, macOS, and Linux ### New in v2.0 đ - đ **Command History** â Track and search your command history - đ **Templates** â Save and reuse frequently used prompts - đ **Explain Mode** â Understand what any command does - đŦ **Interactive REPL** â Continuous conversation mode - đĄī¸ **Safety Warnings** â Detect and warn about dangerous commands - âŠī¸ **Undo Suggestions** â Get undo commands after execution - đ§ **Error Recovery** â Get help when commands fail - đĨ **Stdin Support** â Pipe output for analysis - đ¨ **Syntax Highlighting** â Colorized command output - đ **Environment Variables** â Configure via env vars for CI/CD - đ¤ **JSON Output** â Machine-readable output for scripting - đ **Verbose Mode** â Debug information when needed - âąī¸ **Configurable Timeout** â Adjust request timeouts - đ **Auto-Update Check** â Know when updates are available - đ¯ **Shell Completions** â Tab completion for Bash, Zsh, Fish, PowerShell --- ## đĻ Installation ### đĒ Windows **Option 1: winget** ```powershell winget install Hermithic.aiask ``` **Option 2: Direct download** ```powershell # Download the latest release Invoke-WebRequest -Uri "https://github.com/Hermithic/aiask/releases/latest/download/aiask-2.0.1-windows-amd64.zip" -OutFile aiask.zip Expand-Archive aiask.zip -DestinationPath . Move-Item aiask-windows-amd64.exe C:\Windows\aiask.exe ``` ### đ macOS ```bash brew tap Hermithic/aiask brew install aiask ``` ### đ§ Linux **Option 1: Direct binary (Recommended)** ```bash wget https://github.com/Hermithic/aiask/releases/latest/download/aiask-2.0.1-linux-amd64.tar.gz tar -xzf aiask-2.0.1-linux-amd64.tar.gz sudo mv aiask-linux-amd64 /usr/local/bin/aiask ``` **Option 2: One-liner install** ```bash curl -fsSL https://raw.githubusercontent.com/Hermithic/aiask/master/install.sh | bash ``` ### đ§ From Source Requires Go 1.23+: ```bash git clone https://github.com/Hermithic/aiask.git cd aiask go build -o aiask ./cmd/aiask ``` --- ## âī¸ Configuration ### Quick Setup ```bash aiask config ``` This interactive wizard helps you configure your AI provider. ### Supported Providers | Provider | Description | API Key Required | |----------|-------------|------------------| | đ **Grok** | xAI's Grok (recommended) | Yes | | đ¤ **OpenAI** | GPT-4o, GPT-4 | Yes | | đ§ **Anthropic** | Claude 3.5/4 | Yes | | ⨠**Gemini** | Google Gemini | Yes | | đ **Ollama** | Run locally, free! | No | ### đ Getting API Keys | Provider | Where to get it | |----------|-----------------| | Grok | [console.x.ai](https://console.x.ai/) | | OpenAI | [platform.openai.com](https://platform.openai.com/api-keys) | | Anthropic | [console.anthropic.com](https://console.anthropic.com/) | | Gemini | [ai.google.dev](https://ai.google.dev/) | | Ollama | No key needed! [ollama.ai](https://ollama.ai/) | ### đ Configuration File AIask stores your settings in `~/.aiask/config.yaml`: ```yaml provider: grok api_key: "xai-..." model: "grok-3" timeout: 60 # Request timeout in seconds ollama_url: "http://localhost:11434" system_prompt_suffix: "" # Custom instructions for the AI check_updates: true # Check for updates on startup ``` ### đ Environment Variables Configure AIask without a config file (great for CI/CD): ```bash export AIASK_PROVIDER=openai export AIASK_API_KEY=sk-... export AIASK_MODEL=gpt-4o export AIASK_TIMEOUT=120 export AIASK_OLLAMA_URL=http://localhost:11434 export AIASK_SYSTEM_PROMPT_SUFFIX="Prefer one-liners when possible" ``` > Environment variables take precedence over the config file. ### đ Using Ollama (100% Local & Free) For maximum privacy, run AI completely locally: ```bash # 1. Install Ollama curl -fsSL https://ollama.ai/install.sh | sh # 2. Pull a model ollama pull llama3.2 # 3. Configure AIask aiask config # Select "ollama" ``` --- ## đ Usage ### Basic Usage ```bash aiask "your request in plain English" ``` ### đ Examples **File Operations:** ```bash aiask "list all .txt files modified in the last 7 days" aiask "find and delete all empty directories" aiask "compress the logs folder into a zip" aiask "count lines of code in all Python files" ``` **System Info:** ```bash aiask "show disk usage for each partition" aiask "list all running processes sorted by memory" aiask "what's my public IP address" aiask "show system uptime" ``` **Git Operations:** ```bash aiask "undo my last commit but keep the changes" aiask "show commits from the last week" aiask "create a new branch called feature-login" aiask "squash the last 3 commits" ``` **Networking:** ```bash aiask "list all open ports" aiask "download this file from URL" aiask "check if google.com is reachable" aiask "show my network interfaces" ``` ### â¨ī¸ Interactive Options After AIask suggests a command: | Key | Action | |-----|--------| | `e` | âļī¸ **Execute** â Run the command now | | `c` | đ **Copy** â Copy to clipboard | | `d` | âī¸ **Edit** â Modify before running | | `r` | đ **Re-prompt** â Ask something different | | `q` | đ **Quit** â Exit without action | --- ## đ New Features in v2.0 ### đ Explain Mode Understand what any command does: ```bash aiask explain "tar -xzvf archive.tar.gz" aiask explain "git rebase -i HEAD~3" aiask explain "find . -name '*.log' -mtime +7 -delete" ``` ### đ Command History Track and search your command history: ```bash aiask history # Show recent history aiask history -n 20 # Show last 20 entries aiask history --search git # Search history aiask history clear # Clear all history ``` ### đ Templates Save and reuse frequently used prompts: ```bash # Save a template aiask save git-log "show commits from the last week with stats" aiask save find-large "find files larger than 100MB" -d "Find large files" # List templates aiask templates # Run a template aiask run git-log ``` ### đŦ Interactive REPL Mode Continuous conversation mode without restarting: ```bash aiask interactive # or aiask i ``` Commands in REPL: - `/help` â Show available commands - `/history` â Show session history - `/config` â Show current configuration - `/clear` â Clear the screen - `/exit` â Exit interactive mode ### đĨ Stdin Support Pipe output for analysis: ```bash # Analyze error logs cat error.log | aiask --stdin "what's wrong here?" # Get help with failed commands npm install 2>&1 | aiask --stdin "how do I fix this?" # Analyze any output docker logs myapp | aiask --stdin "find any errors" ``` ### đĄī¸ Safety Features AIask automatically warns about dangerous commands: ```bash $ aiask "delete all files in root" â ī¸ CRITICAL Warning âĸ Recursive delete of root, all files, or home directory Type 'yes' to confirm execution, or any other key to cancel. ``` After execution, get undo suggestions: ``` đĄ To undo: git reset HEAD~1 (Undo the last commit, keeps changes staged) ``` ### đ¤ JSON Output Machine-readable output for scripting: ```bash aiask --json "list files" | jq .command ``` Output: ```json { "command": "ls -la", "shell": "bash", "os": "linux", "prompt": "list files", "provider": "grok", "model": "grok-3" } ``` ### đ Verbose Mode Debug information when needed: ```bash aiask -v "show disk space" ``` Output: ``` [DEBUG] Shell: PowerShell [DEBUG] OS: Windows [DEBUG] Provider: grok [DEBUG] Model: grok-3 [DEBUG] Timeout: 1m0s [DEBUG] Prompt: show disk space [DEBUG] Response time: 1.234s ``` ### đ¯ Shell Completions Enable tab completion for your shell: ```bash # Bash aiask completion bash > /etc/bash_completion.d/aiask # Zsh aiask completion zsh > "${fpath[1]}/_aiask" # Fish aiask completion fish > ~/.config/fish/completions/aiask.fish # PowerShell aiask completion powershell | Out-String | Invoke-Expression ``` --- ## đ¤ Supported Models | Provider | Default | Other Options | |----------|---------|---------------| | Grok | grok-3 | grok-2 | | OpenAI | gpt-4o | gpt-4o-mini, gpt-4-turbo | | Anthropic | claude-sonnet-4-20250514 | claude-3-opus | | Gemini | gemini-2.0-flash | gemini-1.5-pro | | Ollama | llama3.2 | mistral, codellama, phi | --- ## đ Shell Detection AIask automatically detects your shell and generates appropriate commands: | Platform | Shells Detected | |----------|-----------------| | Windows | PowerShell, CMD | | macOS/Linux | Bash, Zsh, Fish | It also detects: - Current working directory - Git repository status (branch, dirty state) --- ## đ Command Reference ``` Usage: aiask [prompt] [flags] aiask [command] Available Commands: config Configure aiask settings explain Explain what a command does history View command history interactive Start interactive REPL mode templates Manage saved prompt templates save Save a new template run Run a saved template completion Generate shell completion scripts version Print the version number help Help about any command Flags: -v, --verbose Show verbose output including debug information --json Output result as JSON (non-interactive) --stdin Read additional context from stdin -s, --stream Stream the response as it generates -h, --help Help for aiask ``` --- ## đ¨ Building from Source ### Prerequisites - Go 1.23+ - Make (optional) ### Build Commands ```bash make build # Build for current platform make build-all # Build for all platforms make release # Create release archives make deb # Build .deb package make checksums # Generate SHA256 checksums ``` ### Cross-Compilation ```bash # Windows GOOS=windows GOARCH=amd64 go build -o aiask.exe ./cmd/aiask # Linux GOOS=linux GOARCH=amd64 go build -o aiask ./cmd/aiask # macOS GOOS=darwin GOARCH=arm64 go build -o aiask ./cmd/aiask ``` --- ## đ§ Troubleshooting ### â "Config not found" Error ```bash aiask config # Run the setup wizard ``` Or set environment variables: ```bash export AIASK_PROVIDER=openai export AIASK_API_KEY=sk-... ``` ### â API Errors 1. â Verify your API key is correct 2. â Check you have credits/quota with your provider 3. â Ensure you're using a valid model name 4. â Try increasing the timeout: `export AIASK_TIMEOUT=120` ### â Ollama Connection Issues ```bash ollama serve # Make sure Ollama is running ollama list # Verify you have models installed ``` ### â Command Not Executing Some commands need elevated privileges: - **Windows:** Run terminal as Administrator - **Linux/macOS:** Use `sudo` ### â Slow Responses Try a faster model: ```yaml # In ~/.aiask/config.yaml model: gpt-4o-mini # Faster than gpt-4o ``` --- ## đ Privacy & Security - đ API keys stored locally in `~/.aiask/config.yaml` with restricted permissions - đ¤ Prompts are sent to your configured AI provider - đ Use Ollama for 100% local, private inference - â Commands never execute without your confirmation - đĄī¸ Dangerous commands require explicit "yes" confirmation - đ History stored locally in `~/.aiask/history.yaml` --- ## đ¤ Contributing Contributions are welcome! Feel free to: - đ Report bugs - đĄ Suggest features - đ§ Submit pull requests --- ## đ License MIT License â see [LICENSE](LICENSE) for details. --- ## đ Changelog ### v2.0.1 (2025-11-26) - đ§ Fixed release artifacts and distribution package configurations - đ§ Updated Homebrew formula with correct checksums - đ§ Fixed winget manifest structure for package submission ### v2.0.0 (2025-11-26) - ⨠Added `explain` command to describe what commands do - ⨠Added command history with search (`aiask history`) - ⨠Added templates system (`aiask save`, `aiask run`, `aiask templates`) - ⨠Added interactive REPL mode (`aiask interactive`) - ⨠Added stdin support for piping input (`--stdin`) - ⨠Added JSON output mode (`--json`) - ⨠Added verbose/debug mode (`-v`) - ⨠Added dangerous command detection and warnings - ⨠Added undo suggestions after command execution - ⨠Added error recovery assistance - ⨠Added shell completion scripts (`aiask completion`) - ⨠Added environment variable configuration - ⨠Added configurable timeout - ⨠Added custom system prompt suffix - ⨠Added auto-update check on startup - ⨠Added git context awareness (branch, dirty status) - ⨠Added directory context in prompts - ⨠Added syntax highlighting for commands - đ Fixed various shell detection issues - đ Comprehensive documentation update ### v1.0.0 (2025-01-15) - đ Initial release - Basic natural language to command conversion - Support for multiple AI providers - Cross-platform support ---
Made with â¤ī¸ by Hermithic