rai

Run AI Instructions directly from your terminal, scripts, and CI/CD pipelines.

cargo install rai-cli
Quick demo
In your terminal

Run AI in your shell — pipe and chain it like any Unix tool, from quick one-liners to structured markdown runbooks.

$ rai "whois github.com" Registrar: MarkMonitor Inc.
$ ls -al | rai "count all file size" Total: 42 files, 1.2 MB combined
$ rai --model kimi-k2.5 "FIX_TODO.md" ~/my-project Fixed 5 TODOs across 3 files. See diff below.
In your scripts

Supercharge your project workflows with AI-powered scripts.

{ "scripts": { "test": "npm run test", "check": "rai rules-check.md & rai security.md" } }
In CI/CD

Drop any AI steps into your build pipeline.

steps: - run: npm install - run: npm run build - run: rai translate.md - run: npm run deploy
Why rai
Open source & lightweight

Single binary, no runtime dependencies. Installs in seconds and starts instantly.

Unix-native

Supports arguments, piping, and chaining. Fits seamlessly into your existing shell scripts and workflows.

No lock-in

Choose your own provider and model — from OpenAI, Anthropic, and Google to local LLMs via Ollama.

Privilege control

Fine-grained tool permissions and rule-based guardrails keep AI actions safe and scoped.

Good for

Quick AI tasks, script automation, and CI/CD steps — use it like grep or curl.

Not designed for

Complex multi-hour tasks or long-running persistent AI agents.

Usage

Install

# via cargo $ cargo install rai-cli   # or via curl $ curl -sSL https://appmakes.github.io/Rai/install.sh | sh # uninstall (curl install only) $ curl -sSL https://appmakes.github.io/Rai/uninstall.sh | sh

Setup & configure

First-time setup picks your provider, API key, and default model. Revisit anytime with rai config.

$ rai start ? Select provider: OpenAI ? API key: sk-•••••••• ? Default model: gpt-4o ✓ Config saved to ~/.config/rai/config.toml

Common flags

-m, --model Override model per run
-y, --yes Auto-approve tool calls
-s, --silent No follow-up input
--no-tools Disable tool calling
--bill Print token & cost summary
--profile <name> Use a named config profile
--<variable> <value> Pass custom variables to task files

Task files

Run prompts directly, or write them as markdown files for complex, reusable tasks. Task files support frontmatter for model config and {{ variables }} for templating.

# Run a prompt directly $ rai "test my network speed"   # Or run a task file $ rai review.md

Example task file with variables:

# review.md --- model: gpt-4o args: - target - language - focus? ---   Review {{ target }} written in {{ language }}. Focus on {{ focus }} if specified.

Pass variables as positional or named args:

$ rai review.md src/main.rs rust $ rai review.md --target src/ --language rust --focus security