Ai

AI CLI 1. Setup This project is a command-line interface tool that connects to OpenRouter models to generate text responses. To set it up: - Install dependencies with `npm install` - Set the `OPENROUTER` environment variable with your OpenRouter API key - Run the CLI using `node main.ts` or by executing the script directly if running in a compatible environment The tool uses the following packages: - `@openrouter/sdk` for interacting with OpenRouter's AI models - `commander` for parsing command-line arguments - `@types/node` for Node.js type definitions 2. Use Cases This CLI tool is designed for: - Generating text responses from AI models based on prompts - Including file contents as context for AI processing - Quick access to different AI models through command-line interface - Cost tracking of AI model usage - Processing code-related tasks using coding-specific models 3. Examples Basic prompt: ```bash export OPENROUTER=*** ai "Explain quantum computing in simple terms" ``` Using specific model: ```bash ai "Write a Python function to sort a list" -m openai/gpt-5.2 ``` Including files as context: ```bash ai "Review this code for bugs" -f main.ts package.json ``` The tool automatically formats file contents with appropriate syntax highlighting and presents them to the AI model along with your prompt. It streams the response in real-time and displays the cost of each operation at the end.