JSPM

@vdntio/clai

0.1.0-alpha.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q45560F
  • License MIT

AI-powered CLI that converts natural language into executable shell commands

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@vdntio/clai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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 install -g clai@alpha

    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.