{"_id":"@arjunambavane/clai","name":"@arjunambavane/clai","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@arjunambavane/clai","version":"1.0.0","main":"./dist/index.js","scripts":{"build":"tsc","dev":"npm run build && npm run start","start":"node dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/ArjunAmbavane01/clai.git"},"author":{"name":"Arjun Ambavane","email":"arjun.ambavane@gmail.com"},"description":"A sleek, AI-powered terminal assistant that answers questions and runs shell commands.","keywords":["cli","clai","ai","openai","terminal","assistant","gpt","linux","windows","macos"],"license":"ISC","type":"module","bin":{"clai":"dist/index.js"},"bugs":{"url":"https://github.com/ArjunAmbavane01/clai/issues"},"homepage":"https://github.com/ArjunAmbavane01/clai#readme","dependencies":{"ink":"^5.2.1","ink-big-text":"^2.0.0","ink-gradient":"^3.0.0","ink-select-input":"^6.2.0","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","lucide-react":"^0.503.0","react":"^18.3.1","react-dom":"^18.3.1"},"devDependencies":{"@types/node":"^22.15.3","@types/react":"^19.1.2","tsx":"^4.19.4","typescript":"^5.8.3"},"publishConfig":{"access":"public"},"_id":"@arjunambavane/clai@1.0.0","gitHead":"de089898c0f8a633be8a3801d720535deeded67b","_nodeVersion":"23.6.1","_npmVersion":"11.0.0","dist":{"integrity":"sha512-c9La2vM5uCKbSX5tBCGo+fCc8nFjl7fFMRyT4LkcBt8E79AiFruxEI+yAm9jcBsX/qmKHEBal+iSeXO0KqYeSw==","shasum":"a988677832764db7bab1bcd027f6b45252a7e26a","tarball":"https://registry.npmjs.org/@arjunambavane/clai/-/clai-1.0.0.tgz","fileCount":22,"unpackedSize":29147,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFNjXy9GsrHL1fgDNJ8gVJ2JQLMxSXgx+QVWHP27qU/TAiBLSy8TdWhELRRWo1QwJs2gwg48YA84P66kKh3zK6mubg=="}]},"_npmUser":{"name":"arjunambavane","email":"arjun.ambavane@gmail.com"},"directories":{},"maintainers":[{"name":"arjunambavane","email":"arjun.ambavane@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clai_1.0.0_1746779501453_0.6550498997903267"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-09T08:31:41.349Z","1.0.0":"2025-05-09T08:31:41.655Z","modified":"2025-05-09T08:31:41.924Z"},"maintainers":[{"name":"arjunambavane","email":"arjun.ambavane@gmail.com"}],"description":"A sleek, AI-powered terminal assistant that answers questions and runs shell commands.","homepage":"https://github.com/ArjunAmbavane01/clai#readme","keywords":["cli","clai","ai","openai","terminal","assistant","gpt","linux","windows","macos"],"repository":{"type":"git","url":"git+https://github.com/ArjunAmbavane01/clai.git"},"author":{"name":"Arjun Ambavane","email":"arjun.ambavane@gmail.com"},"bugs":{"url":"https://github.com/ArjunAmbavane01/clai/issues"},"license":"ISC","readme":"<h1 align=\"center\">CLAI — Command Line AI Assistant</h1>\r\n<p align=\"center\">⚡ A sleek, AI-powered terminal assistant that runs commands and answers your coding questions intelligently.</p>\r\n\r\n<div align=\"center\">\r\n  <a href=\"https://www.npmjs.com/package/@rjun/clai\">\r\n    <img src=\"https://img.shields.io/npm/v/clai.svg\" alt=\"npm version\" />\r\n  </a>  \r\n  <a href=\"https://opensource.org/licenses/MIT\">\r\n    <img src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License: MIT\" />\r\n  </a>\r\n</div>\r\n\r\n![CLAI Demo](https://github.com/ArjunAmbavane01/clai/raw/main/.github/clai-demo.gif)\r\n\r\n\r\n## ✨ Features\r\n\r\n- **Terminal Integration**: AI assistant that lives in your terminal\r\n- **Command Execution**: Automatically runs shell commands on your behalf\r\n- **Multiple AI Models**: Switch between various language models (Mistral, Claude, GPT, Gemini, etc.)\r\n- **Context Awareness**: Maintains chat history for more contextual responses\r\n- **Beautiful TUI**: Modern terminal UI built with React Ink\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\nnpm install -g clai\r\n```\r\n\r\nor\r\n\r\n```bash\r\nyarn global add clai\r\n```\r\n\r\n## 🔑 Prerequisites\r\n\r\nCLAI requires an [OpenRouter](https://openrouter.ai/) API key to function. If you don't have one:\r\n\r\n1. Create an account at [OpenRouter.ai](https://openrouter.ai/)\r\n2. Generate an API key from your dashboard\r\n3. The API key will be requested on first run or can be set manually (see Configuration)\r\n\r\n## 🚀 Quick Start\r\n\r\nAfter installation, simply run:\r\n\r\n```bash\r\nclai\r\n```\r\n\r\nOn first run, you'll be prompted for your OpenRouter API key. After that, you can start chatting with your AI assistant.\r\n\r\n## 💬 Usage\r\n\r\nCLAI provides two main types of responses:\r\n\r\n### 1. Explanations\r\n\r\nThe AI will respond with helpful text, code examples, and guidance.\r\n\r\n### 2. Command Execution\r\n\r\nWhen appropriate, the AI will suggest and execute terminal commands:\r\n\r\n- The command will be shown with an explanation\r\n- You'll see real-time execution\r\n- Results will be displayed directly in the chat\r\n\r\n## ⚙️ Configuration\r\n\r\nYou can set your OpenRouter API key in one of these ways:\r\n\r\n1. Let CLAI prompt you on first run\r\n2. Create a config file at `~/.clai/config.json`:\r\n   ```json\r\n   {\r\n     \"apiKey\": \"your-openrouter-api-key\"\r\n   }\r\n   ```\r\n\r\n## 🔄 Model Selection\r\n\r\nCLAI supports multiple AI models through OpenRouter:\r\n\r\n- mistralai/mistral-7b-instruct (default)\r\n- neversleep/noromaid-20b\r\n- perplexity/llama-3.1-sonar-small-128k-online\r\n- perplexity/sonar\r\n- openai/gpt-3.5-turbo\r\n- anthropic/claude-3.5-haiku\r\n- google/gemini-flash-1.5-8b\r\n\r\nTo change models during a session:\r\n\r\n1. Type `/models` at the prompt\r\n2. Select your preferred model from the list\r\n\r\n## ⌨️ Commands\r\n\r\n- `/help` - Show all available commands\r\n- `/clear` - Clear the current chat history\r\n- `/model` - Change the AI model\r\n- `/exit` or `Ctrl+C` - Exit CLAI\r\n\r\n## 📊 Project Structure\r\n\r\n```\r\nclai/\r\n├── components/        # React components for the TUI\r\n├── hooks/             # Custom React hooks\r\n├── utils/             # Utility functions and types\r\n│   ├── aiClient.ts    # OpenRouter API client\r\n│   ├── models.ts      # Model definitions\r\n│   ├── chatTypes.ts   # Type definitions\r\n│   └── config.js      # Configuration management\r\n└── index.tsx          # Application entry point\r\n```\r\n\r\n## 🔒 Privacy & Security\r\n\r\nCLAI:\r\n\r\n- Only sends your prompts to the selected AI model via OpenRouter\r\n- Can execute shell commands on your machine, so review before confirming\r\n- Does not collect telemetry or user data\r\n\r\n## 📝 TODO\r\n\r\n- Implement previous chat context memory\r\n- Add offline support\r\n- Add support for command aliasing\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\r\n4. Push to the branch (`git push origin feature/amazing-feature`)\r\n5. Open a Pull Request\r\n\r\n## 📜 License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n---\r\n\r\n<p align=\"center\">Made with 💻 and ☕</p>\r\n","readmeFilename":"README.md","_rev":"1-1d16a15686f3948e702ef87a9ec5eb5a"}