{"_id":"@ai-helper/ai-cli","_rev":"5-4aa9ab3bcee1130ad47d1cfd00e58546","name":"@ai-helper/ai-cli","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@ai-helper/ai-cli","version":"0.1.0","keywords":["cli","ai","gpt","openai","command","intent","natural-language","shell"],"author":{"name":"Rupesh Jain"},"license":"MIT","_id":"@ai-helper/ai-cli@0.1.0","maintainers":[{"name":"rupesh2k","email":"rupesh2k@gmail.com"}],"homepage":"https://github.com/rupesh2kgithub/ai-cli#readme","bugs":{"url":"https://github.com/rupesh2kgithub/ai-cli/issues"},"bin":{"ai-cli":"bin/ai.js"},"dist":{"shasum":"e42af116c5ff49b84b7e51cc73937779c0be71d3","tarball":"https://registry.npmjs.org/@ai-helper/ai-cli/-/ai-cli-0.1.0.tgz","fileCount":11,"integrity":"sha512-XgKOA2q/et4pRc6o3qncd6jC2F6DD9N0OCMwPm83RZ35QyEATu4or3qmJJdNOkMr2tGbNFWv+8KQCheV8MyAFg==","signatures":[{"sig":"MEYCIQDWe3B6ZwND5PtmqskrWyPM4VyNU9GmJFsJ1xWe6xSp6gIhAO9tdUgiyHLlM93g3D/q5DHbvy1NcBdlHFoFxZv1jQTC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11060},"main":"index.js","type":"module","gitHead":"6393d49b94944cce41ce702ace1901eedcb187c8","_npmUser":{"name":"rupesh2k","email":"rupesh2k@gmail.com"},"repository":{"url":"git+https://github.com/rupesh2kgithub/ai-cli.git","type":"git"},"_npmVersion":"11.6.2","description":"AI-powered CLI to run commands from natural language using GPT","directories":{},"_nodeVersion":"22.15.0","dependencies":{"chalk":"^5.6.2","dotenv":"^17.3.1","commander":"^14.0.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-cli_0.1.0_1774128657051_0.933881559920666","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ai-helper/ai-cli","version":"0.2.0","keywords":["cli","ai","gpt","openai","command","intent","natural-language","shell"],"author":{"name":"Rupesh Jain"},"license":"MIT","_id":"@ai-helper/ai-cli@0.2.0","maintainers":[{"name":"rupesh2k","email":"rupesh2k@gmail.com"}],"homepage":"https://github.com/rupesh2k/ai-cli#readme","bugs":{"url":"https://github.com/rupesh2k/ai-cli/issues"},"bin":{"ai-cli":"bin/ai.js"},"dist":{"shasum":"9d54c1967c362abb5988b21b294b29afcb49b573","tarball":"https://registry.npmjs.org/@ai-helper/ai-cli/-/ai-cli-0.2.0.tgz","fileCount":11,"integrity":"sha512-KSj9RdjLf2d+8XsMX6lVdPGw1n9dciMjrX2oXmflXYkIWhEayv+c0ygdi10avizMKyUXcWe++dG9Wjzav9AvKA==","signatures":[{"sig":"MEYCIQDjdSEWx3wtQpt/pXhCtXLwiwL2z0cgZ5z5WuuYZhabuQIhAOMS0pKTS5Qm0o6idrVgQiYZsH6CE5/atcho1DNLmXam","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11089},"main":"index.js","type":"module","gitHead":"c63c1dc685a33ac14d093ac25dcfb400c37e5521","_npmUser":{"name":"rupesh2k","email":"rupesh2k@gmail.com"},"repository":{"url":"git+https://github.com/rupesh2k/ai-cli.git","type":"git"},"_npmVersion":"11.6.2","description":"AI-powered CLI to run commands from natural language using GPT","directories":{},"_nodeVersion":"22.15.0","dependencies":{"chalk":"^5.6.2","dotenv":"^17.3.1","commander":"^14.0.3","@ai-helper/ai-cli":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-cli_0.2.0_1774129630761_0.07972480108830049","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ai-helper/ai-cli","version":"0.3.0","keywords":["cli","ai","gpt","openai","command","intent","natural-language","shell"],"author":{"name":"Rupesh Jain"},"license":"MIT","_id":"@ai-helper/ai-cli@0.3.0","maintainers":[{"name":"rupesh2k","email":"rupesh2k@gmail.com"}],"homepage":"https://github.com/rupesh2k/ai-cli#readme","bugs":{"url":"https://github.com/rupesh2k/ai-cli/issues"},"bin":{"ai-cli":"bin/ai.js"},"dist":{"shasum":"a9f9adfcfd54ce1225acea01629e32ad123d0362","tarball":"https://registry.npmjs.org/@ai-helper/ai-cli/-/ai-cli-0.3.0.tgz","fileCount":12,"integrity":"sha512-SSjDT7NBtCHGRSbMVaLHYNYiCe2h0W+crrn/AZ1lNZOiQCnJGV1r3xRw+fRVxPxDdsDX80IBk383Do+P6xfR7A==","signatures":[{"sig":"MEYCIQDYyAR7epyog8vvkqKeABs0bQP4za6TN/50o0+NB7X25QIhAK7+LhOJE5tW3Oaob1VMecnSUCqOLFaFn1wyQkv7qKYD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21008},"main":"index.js","type":"module","gitHead":"1897cf530c259615ceb206552cb9daa7d0511a40","_npmUser":{"name":"rupesh2k","email":"rupesh2k@gmail.com"},"repository":{"url":"git+https://github.com/rupesh2k/ai-cli.git","type":"git"},"_npmVersion":"11.6.2","description":"AI-powered CLI to run commands from natural language using GPT","directories":{},"_nodeVersion":"22.15.0","dependencies":{"chalk":"^5.6.2","dotenv":"^17.3.1","commander":"^14.0.3","@ai-helper/ai-cli":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-cli_0.3.0_1774136661378_0.8843891386435936","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@ai-helper/ai-cli","version":"0.4.0","keywords":["cli","ai","gpt","openai","command","intent","natural-language","shell"],"author":{"name":"Rupesh Jain"},"license":"MIT","_id":"@ai-helper/ai-cli@0.4.0","maintainers":[{"name":"rupesh2k","email":"rupesh2k@gmail.com"}],"homepage":"https://github.com/rupesh2k/ai-cli#readme","bugs":{"url":"https://github.com/rupesh2k/ai-cli/issues"},"bin":{"ai-cli":"bin/ai.js"},"dist":{"shasum":"e1fb5f1ce41556eb26f7f53a1ec63fad6428a1a3","tarball":"https://registry.npmjs.org/@ai-helper/ai-cli/-/ai-cli-0.4.0.tgz","fileCount":13,"integrity":"sha512-NjNui2l5B83WWz4fffvYWKkExZG6IpAxSNXDhLfF8fg5GsAqfsPljda/fXYpiy2T+/h8syPCPAWdbnUQr6whzQ==","signatures":[{"sig":"MEYCIQC+6P8Roi+hA88hXnH5H6qgmkva7JSBZk2aH1V718jzggIhAIx57UeW0y4VVhheuhV74LaeW6LxjuMlOwiyA8njXJcQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30389},"main":"index.js","type":"module","gitHead":"cbec4b664298ec938736e15db5ae6990d2076846","_npmUser":{"name":"rupesh2k","email":"rupesh2k@gmail.com"},"repository":{"url":"git+https://github.com/rupesh2k/ai-cli.git","type":"git"},"_npmVersion":"11.6.2","description":"AI-powered CLI to run commands from natural language using GPT","directories":{},"_nodeVersion":"22.15.0","dependencies":{"chalk":"^5.6.2","dotenv":"^17.3.1","commander":"^14.0.3","@ai-helper/ai-cli":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ai-cli_0.4.0_1774223591645_0.2763086544513824","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@ai-helper/ai-cli","version":"0.5.0","description":"AI-powered CLI to run commands from natural language using GPT","main":"index.js","bin":{"ai-cli":"bin/ai.js"},"type":"module","license":"MIT","author":{"name":"Rupesh Jain"},"keywords":["cli","ai","gpt","openai","command","intent","natural-language","shell"],"repository":{"type":"git","url":"git+https://github.com/rupesh2k/ai-cli.git"},"dependencies":{"@ai-helper/ai-cli":"^0.1.0","chalk":"^5.6.2","commander":"^14.0.3","dotenv":"^17.3.1"},"gitHead":"cbec4b664298ec938736e15db5ae6990d2076846","_id":"@ai-helper/ai-cli@0.5.0","bugs":{"url":"https://github.com/rupesh2k/ai-cli/issues"},"homepage":"https://github.com/rupesh2k/ai-cli#readme","_nodeVersion":"22.15.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-5W/kGGPsPDyWd3K/uHK4H/2RopiqsaMzfEHI60fmRynxhXMR6qXIsVch04BWosQ+ipaWJa493qltVrLDeVB1pQ==","shasum":"e1602df09bd667ffa2989622e60443d511f0e83c","tarball":"https://registry.npmjs.org/@ai-helper/ai-cli/-/ai-cli-0.5.0.tgz","fileCount":13,"unpackedSize":30718,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICuXeMBMMrSFOeMitI1Wt9PGc0vx8HWf+5VUM+a+7FYUAiBcrIX39ZBIruFO/DGoSaUG17Ci0vMRSY7HET8qnA1bXA=="}]},"_npmUser":{"name":"rupesh2k","email":"rupesh2k@gmail.com"},"directories":{},"maintainers":[{"name":"rupesh2k","email":"rupesh2k@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ai-cli_0.5.0_1774925468920_0.19873833321870826"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T21:30:56.975Z","modified":"2026-03-31T02:51:09.222Z","0.1.0":"2026-03-21T21:30:57.190Z","0.2.0":"2026-03-21T21:47:10.916Z","0.3.0":"2026-03-21T23:44:21.536Z","0.4.0":"2026-03-22T23:53:11.784Z","0.5.0":"2026-03-31T02:51:09.080Z"},"bugs":{"url":"https://github.com/rupesh2k/ai-cli/issues"},"author":{"name":"Rupesh Jain"},"license":"MIT","homepage":"https://github.com/rupesh2k/ai-cli#readme","keywords":["cli","ai","gpt","openai","command","intent","natural-language","shell"],"repository":{"type":"git","url":"git+https://github.com/rupesh2k/ai-cli.git"},"description":"AI-powered CLI to run commands from natural language using GPT","maintainers":[{"name":"rupesh2k","email":"rupesh2k@gmail.com"}],"readme":"# AI CLI\n\nRun terminal commands using natural language with AI assistance.\n\n## Quick Start\n\n```bash\n# Install globally\nnpm install -g @ai-helper/ai-cli\n\n# First-time setup (required)\nai-cli init\n\n# Use it\nai-cli \"kill port 3000\"\nai-cli \"find large files in downloads\"\nai-cli \"compress all pdfs in this folder\"\n```\n\n## Setup\n\nOn first use, you'll need to configure your OpenAI API key:\n\n```bash\nai-cli init\n```\n\nThis will:\n- Prompt you for your OpenAI API key (get one at https://platform.openai.com/api-keys)\n- Save configuration to `~/.ai-cli/config.json`\n- Set up the CLI for immediate use\n\n## Features\n\n- **Natural language → commands** - Describe what you want in plain English\n- **Multiple AI providers** - Choose from OpenAI, Ollama (local), Anthropic Claude, or Google Gemini\n- **Local models support** - Run completely offline with Ollama\n- **Interactive placeholders** - Automatically prompts for command arguments like `<PORT>`, `YOUR_MESSAGE`, etc.\n- **Dry-run mode** - Preview commands before execution\n- **Safety first** - Blocks dangerous commands like `rm -rf`, `shutdown`, etc.\n- **Interactive approval** - Review and approve commands before execution\n- **Risk assessment** - Shows risk level (low/medium/high) for each command\n\n## Examples\n\n### Basic Usage\n\n```bash\n# Process management\nai-cli \"kill port 3000\"\n\n# File operations\nai-cli \"find files larger than 100MB\"\nai-cli \"compress all images in this folder\"\n\n# System info\nai-cli \"show disk usage\"\nai-cli \"list running processes using most memory\"\n\n# Network\nai-cli \"check if port 8080 is in use\"\nai-cli \"show my public IP\"\n\n# Git operations\nai-cli \"undo last commit but keep changes\"\nai-cli \"create a new branch called feature-x\"\n\n# Text processing\nai-cli \"count lines in all js files\"\nai-cli \"find and replace foo with bar in all txt files\"\n```\n\n### Dry Run Mode (Preview Only)\n\nPreview what a command will do without executing it:\n\n```bash\n# See what the command would do\nai-cli --dry-run \"delete all log files\"\n\n# Output shows:\n# 🔍 DRY RUN MODE - Command preview only\n# ============================================================\n# 📝 Generated Command:\n#   rm /var/log/*.log\n# 💬 Explanation:\n#   Removes all .log files from /var/log directory\n# ⚠️  Risk Level: HIGH\n# 🔧 Command Breakdown:\n#   • Main command: rm\n#   • Arguments: /var/log/*.log\n# ⚠️  WARNING: This command deletes files/directories\n# ============================================================\n# 💡 This is a preview only. To execute, run without --dry-run\n\n# Short form\nai-cli -d \"compress this folder\"\n```\n\n### Verbose Mode (Detailed Information)\n\nGet detailed analysis of the command:\n\n```bash\n# Show extra details\nai-cli --verbose \"install redis\"\n\n# Or combine with dry-run\nai-cli -d -v \"create a backup of this directory\"\n\n# Shows provider, model, command breakdown, and more\n```\n\n### Interactive Placeholders\n\nWhen commands have placeholders, the CLI automatically prompts for values:\n\n```bash\n$ ai-cli \"commit my changes with a message\"\n\n⏳ Generating command using OpenAI...\n\nSuggested Command:\n  git commit -m \"YOUR_MESSAGE\"\n\nExplanation:\n  Commits staged changes with your commit message\n\nRisk Level: low\n\n🔧 Detected 1 placeholder in the command:\n  • YOUR_MESSAGE\n\n📝 This command needs some information from you:\n\n  your message: Fixed login bug\n\n✓ Final command:\n  git commit -m \"Fixed login bug\"\n\nRun this command? (y/n): y\n```\n\n**Supported placeholder formats:**\n- `<PLACEHOLDER>` - e.g., `<PORT>`, `<FILE>`\n- `${PLACEHOLDER}` - e.g., `${USERNAME}`, `${PATH}`\n- `YOUR_*` - e.g., `YOUR_MESSAGE`, `YOUR_NAME`\n- `[PLACEHOLDER]` - e.g., `[OPTION]`, `[VALUE]`\n\n**Examples:**\n```bash\n# Git commit with message\nai-cli \"commit with message about bug fix\"\n# Prompts: your message: Fixed authentication bug\n\n# Docker run with port\nai-cli \"run nginx container on port 8080\"\n# Prompts: port: 8080\n\n# Create file with name\nai-cli \"create a new file named config\"\n# Prompts: file name: config.json\n```\n\n## AI Providers\n\nChoose from multiple AI providers during setup:\n\n### 1. **OpenAI** (GPT-4, GPT-3.5-turbo)\n- Requires API key from https://platform.openai.com/api-keys\n- Models: `gpt-4o`, `gpt-4o-mini`, `gpt-4-turbo`, `gpt-3.5-turbo`\n- Fast and accurate\n\n### 2. **Ollama** (Local Models - FREE!)\n- No API key needed - runs completely offline\n- Download from https://ollama.com/download\n- Models: `llama3.2`, `llama3.1`, `mistral`, `codellama`, `gemma2`, `qwen2.5`\n- Free and private\n\nSetup Ollama:\n```bash\n# Install Ollama\nbrew install ollama  # or download from ollama.com\n\n# Start Ollama\nollama serve\n\n# Pull a model\nollama pull llama3.2\n\n# Configure ai-cli to use Ollama\nai-cli init\n# Select option 2 (Ollama)\n```\n\n### 3. **Anthropic** (Claude)\n- Requires API key from https://console.anthropic.com/settings/keys\n- Models: `claude-3-5-sonnet`, `claude-3-5-haiku`, `claude-3-opus`\n- Excellent reasoning capabilities\n\n### 4. **Google Gemini**\n- Requires API key from https://aistudio.google.com/app/apikey\n- Models: `gemini-1.5-pro`, `gemini-1.5-flash`, `gemini-2.0-flash-exp`\n- Fast and multimodal\n\n## Configuration\n\nConfiguration is stored in `~/.ai-cli/config.json`:\n\n### OpenAI config example:\n```json\n{\n  \"provider\": \"openai\",\n  \"apiKey\": \"your-openai-api-key\",\n  \"model\": \"gpt-4o-mini\",\n  \"setupDate\": \"2024-03-21T...\"\n}\n```\n\n### Ollama config example:\n```json\n{\n  \"provider\": \"ollama\",\n  \"ollamaUrl\": \"http://localhost:11434\",\n  \"ollamaModel\": \"llama3.2\",\n  \"setupDate\": \"2024-03-21T...\"\n}\n```\n\nTo reconfigure, run `ai-cli init` again.\n\n## Command Options\n\n### `--dry-run` / `-d`\nPreview the command without executing it. Shows:\n- The generated command\n- Detailed explanation\n- Risk level assessment\n- Command breakdown\n- Special warnings for file operations (delete, move, write)\n\nPerfect for:\n- Testing potentially dangerous commands\n- Learning what commands do\n- Verifying the AI understood your intent\n\n### `--verbose` / `-v`\nShow additional details:\n- AI provider and model used\n- Command structure breakdown\n- Detailed analysis\n\nCan be combined with `--dry-run`:\n```bash\nai-cli -d -v \"your intent\"\n```\n\n## Safety\n\nThe CLI includes built-in safety checks:\n- **Dry-run mode** - Preview commands before execution\n- **Safety filter** - Blocks destructive commands (`rm -rf`, `mkfs`, `shutdown`, `reboot`)\n- **Interactive approval** - Requires explicit confirmation before executing\n- **Risk assessment** - Shows risk level (low/medium/high) for transparency\n- **Secure prompts** - AI models trained with safety-focused instructions\n\n## Publishing to npm\n\nTo publish this package:\n\n```bash\n# Login to npm (one-time)\nnpm login\n\n# Publish (scoped packages require --access=public)\nnpm publish --access=public --otp=YOUR_OTP_CODE\n```\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Link for local development\nnpm link\n\n# Test locally\nai-cli \"your intent\"\nai-cli init\n\n# Or run directly\nnode bin/ai.js \"your intent\"\nnode bin/ai.js init\n```\n\n## License\n\nMIT","readmeFilename":"README.md"}