Skip to main content

Quickstart

Get AIRun running in 5 minutes. This guide will help you install AIRun, create your first executable AI script, and run it.

Prerequisites

Before you begin, make sure you have at least one AI runtime installed — Claude Code or Codex CLI. AIRun works with either.
You need an active Claude subscription or Codex/OpenAI account. AIRun auto-detects which runtime is available.

Installation

1

Clone the repository

2

Run the setup script

The setup script will:
  • Install commands to /usr/local/bin
  • Create ~/.ai-runner/ for configuration
  • Copy a secrets template for API keys
The setup is non-destructive. Your plain claude command always works unchanged.
3

Verify installation

You should see the AIRun version number.

Your First Executable AI Script

Let’s create a simple executable markdown file that runs as an AI program.
1

Create a markdown file

Create a file called hello.md with the following content:
hello.md
The first line is a shebang that tells the system to run this file with AIRun using the Haiku model (fastest and most cost-effective).
2

Make it executable

3

Run it

The AI will execute your prompt and respond. This uses your Claude subscription by default.
You can also run any markdown file without making it executable:

Example: Piping Data

One of AIRun’s most powerful features is Unix-style piping. Let’s create a script that analyzes data:
analyze-code.md
The --skip flag is shorthand for --dangerously-skip-permissions, which gives the AI full system access. Only use it in trusted directories with trusted scripts.
Make it executable and run it:

Example: Script Variables

Create reusable scripts with customizable variables:
summarize-topic.md
Run with defaults or override variables:

Example: Unix Pipes

Pipe data into your AI scripts:

Switch Providers

Use different AI providers by adding flags:
You’ll need to configure your API credentials for cloud providers. See the Installation Guide for details.

Available Commands

AIRun installs these commands:

Next Steps

Installation Guide

Detailed installation and configuration instructions

Provider Setup

Configure AWS, Azure, Vertex, and other providers

Examples

More example scripts and use cases

Scripting Guide

Learn advanced scripting patterns and automation

Tips

Use #!/usr/bin/env -S for shebangs with flagsStandard env only accepts one argument, so you need -S to pass multiple flags:
Flag precedence: CLI flags > shebang flags > saved defaultsRunning ai --vercel task.md overrides the script’s shebang provider.
Set a default provider