Skip to main content

Installation

This guide covers installation, configuration, and verification of Andi AIRun on all supported platforms.

Supported Platforms

  • macOS 13.0+
  • Linux (Ubuntu 20.04+, Debian 10+)
  • Windows 10+ via WSL

Prerequisites

AIRun requires at least one AI runtime — Claude Code or Codex CLI. Install one or both:
1

Install a runtime

Claude Code (Anthropic — default runtime):
Codex CLI (OpenAI — alternative runtime):
If both are installed, AIRun uses Claude Code by default. Use --codex to select Codex, or ai --codex --set-default to make it your default.
2

Verify your runtime

Install AIRun

1

Clone the repository

2

Run the setup script

The setup script will:
  • Install commands to /usr/local/bin (may require sudo)
  • Create ~/.ai-runner/ configuration directory
  • Copy secrets.example.sh to ~/.ai-runner/secrets.sh
  • Install library scripts to /usr/local/share/ai-runner
  • Migrate existing ~/.claude-switcher/ configuration if present
The setup is non-destructive. Your plain claude command always works untouched as before. All AIRun operations are session-scoped and automatically restore your original configuration on exit.
3

Verify installation

You should see the AIRun version number (e.g., ai-runner v1.2.0).

Configure Providers

AIRun supports multiple AI providers. You only need to configure the providers you want to use.
1

Open the secrets file

This file contains templates for all supported providers. Uncomment and fill in the credentials for the providers you want to use.
2

Configure your providers

Choose the providers you want to configure:
Ollama - Runs models locally or on Ollama’s cloud:
Hardware note: Coding models need 24GB+ VRAM (or unified memory on Apple Silicon). Ollama’s cloud models work on any hardware.
LM Studio - Local models with MLX support (fast on Apple Silicon):
Add to ~/.ai-runner/secrets.sh:
See Claude Code AWS Bedrock docs for more details.
Add to ~/.ai-runner/secrets.sh:
Google Cloud Authentication (in precedence order):
  1. Service Account Key File (highest precedence, recommended for production/CI):
  2. Application Default Credentials (recommended for local development):
  3. gcloud User Credentials (fallback):
AIRun automatically detects and uses the appropriate method.See Claude Code Vertex AI docs for more details.
Add to ~/.ai-runner/secrets.sh:
Get your API key from console.anthropic.com.
Add to ~/.ai-runner/secrets.sh:
See Claude Code Azure docs for more details.
Add to ~/.ai-runner/secrets.sh:
Get your token from the Vercel dashboard.Vercel AI Gateway supports 100+ models from OpenAI, xAI, Google, Meta, and more. See vercel.com/ai-gateway.
3

Save the file

After adding your credentials, save and close the file.
The secrets.sh file contains sensitive credentials. Keep it secure and never commit it to version control.

Verify Configuration

1

Check overall status

This command shows:
  • Current tool and provider
  • Authentication method
  • Configured models
  • Available providers
Look for green checkmarks next to providers you’ve configured.
2

Test with your default provider

This launches an interactive Claude Code session. You should see a message indicating which provider and model are active.Type /status in Claude to verify the authentication method.
3

Test provider switching

Try switching to different providers:
Each command should launch Claude Code with the specified provider.

Model Configuration (Optional)

AIRun uses sensible default models for each provider, but you can override them.

Default Model Tiers

AIRun provides these model tiers:
  • --fable / --best - Most capable model (Claude Fable 5, Anthropic providers only; opt-in)
  • --opus / --high - Highest Opus-tier model (Opus 5, default)
  • --sonnet / --mid - Mid-tier model (Sonnet 5)
  • --haiku / --low - Lowest-tier model (Haiku 4.5, fastest)

Override Default Models

To use different model versions, add overrides to ~/.ai-runner/secrets.sh:

Dual Model Configuration

Claude Code uses two models:
  1. ANTHROPIC_MODEL - Main model for interactive work
  2. ANTHROPIC_SMALL_FAST_MODEL - Background operations (defaults to Haiku)
You can override the small/fast model:

Set Default Provider

Save your preferred provider and model as the default:

Updating

1

Update AIRun

Or manually:
AIRun checks for updates once every 24 hours (non-blocking) and shows a notice when a new version is available. Your API keys in ~/.ai-runner/secrets.sh are preserved during updates.
Disable update checks by setting: export AI_NO_UPDATE_CHECK=1 in your ~/.ai-runner/secrets.sh

Troubleshooting

Common Issues

  1. Verify API key: grep ANTHROPIC_API_KEY ~/.ai-runner/secrets.sh
  2. Confirm you’re using ai (not plain claude)
  3. Run ai-status during the session
  4. In Claude, run /status to see authentication method
  1. Use ai --pro or plain claude
  2. Run /status in Claude to verify authentication
  1. Verify the server is running:
  2. Check the host configuration in ~/.ai-runner/secrets.sh
  3. Ensure you have a model loaded
The setup script needs write access to /usr/local/bin. If you see permission errors:
The script will automatically request sudo access only if needed.

Session-Scoped Behavior

ai with no flags uses your regular Claude subscription, identical to running claude directly. Provider flags (--aws, --ollama, etc.) only affect the current session:
  • On exit, your original Claude settings are automatically restored
  • Plain claude in another terminal is completely unaffected
  • No global configuration is changed

Uninstallation

To remove AIRun:
This removes all installed commands and optionally removes the configuration directory.

Next Steps

Quickstart

Create and run your first executable AI script

Examples

Explore example scripts and use cases

Scripting Guide

Learn advanced scripting patterns

Provider Guide

Detailed provider setup and model recommendations