Skip to content

vdntio/clAI

Repository files navigation

clAI

⚠️ Alpha Release: This is an early alpha version. Expect bugs and breaking changes.

AI-powered CLI that converts natural language instructions into executable shell commands using OpenRouter.

Example

clai "find all TypeScript files modified in the last 7 days"
# Outputs: find . -name "*.ts" -mtime -7

clai "list top 10 largest files in current directory"
# Outputs: du -h * | sort -rh | head -10

Features

  • 🤖 Natural language to shell commands using AI
  • 🎨 Beautiful terminal UI with Ink
  • 🔒 Safety checks for dangerous commands (rm -rf, etc.)
  • 📝 Context-aware (current directory, shell type, git status)
  • ⚡ Fast startup with Bun runtime
  • 🌍 Cross-platform (Linux, macOS, Windows)

Installation

npm (Recommended)

npm install -g @vdntio/clai

Standalone Binary

Download from Releases

See Installation Guide for detailed instructions.

Quick Start

  1. Get an OpenRouter API key from openrouter.ai

  2. Set your API key:

    export OPENROUTER_API_KEY="your-key-here"
  3. Run a command:

    clai "your natural language instruction"

Configuration

clAI uses TOML config files. Priority order:

  1. ./.clai.toml (project-level)
  2. ~/.config/clai/config.toml (user-level)
  3. /etc/clai/config.toml (system-level)

Example config:

openrouter_api_key = "sk-..."

[providers.openrouter]
model = "qwen/qwen3-coder"  # Default model (can override with anthropic/claude-3.5-sonnet, etc.)

[safety]
confirm_dangerous = true

Development

# Install dependencies
bun install

# Run in development mode
bun run dev

# Run tests
bun test

# Build
bun run build

OpenRouter Costs

clAI uses OpenRouter's API which charges per token. Default model is qwen/qwen3-coder (free tier available). You can override to use other models like anthropic/claude-3.5-sonnet (~$3 per million input tokens). Get credits at openrouter.ai.

License

MIT - See LICENSE for details.

Issues & Feedback

Report bugs or request features at GitHub Issues.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •