{"_id":"@aigent47-devlabs/grok-code-cli","_rev":"4-cea0f139cf207cf7a5eb0ca6b90b2df2","name":"@aigent47-devlabs/grok-code-cli","dist-tags":{"latest":"1.2.1"},"versions":{"1.0.0":{"name":"@aigent47-devlabs/grok-code-cli","version":"1.0.0","keywords":["grok","xai","cli","ai","code","terminal"],"author":{"url":"AiGent47.com, LLC","name":"Robert DiCrisci","email":"robert@aigent47.com"},"license":"MIT","_id":"@aigent47-devlabs/grok-code-cli@1.0.0","maintainers":[{"name":"aigent47","email":"rob@aigent47.com"}],"homepage":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI#readme","bugs":{"url":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues"},"bin":{"grok":"index.js"},"dist":{"shasum":"c4f2c52219042525194a1eaa00ebb11b2527af2c","tarball":"https://registry.npmjs.org/@aigent47-devlabs/grok-code-cli/-/grok-code-cli-1.0.0.tgz","fileCount":9,"integrity":"sha512-NTbIMvkN5Qo8I61NAPKbZjIJ7Discpik8kQYM8T225/kx9ngaivuQ4d7cs19mp1h/oAf3qlDL8N8lFgLEX2K3Q==","signatures":[{"sig":"MEUCIDOGwQVjMnRuE6Eb2TA0l7PWP8os/AGx/ehCT3adHbs/AiEAq1xqYb5m4wmQSJ8PP1dgYKjakcdZzhNiOgYz26j+GDs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":38355},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"99e2335e759c95a42d23215e2dd3b374d5586e0e","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aigent47","email":"rob@aigent47.com"},"repository":{"url":"git+https://github.com/AiGent47-DevLabs/Grok-Code-CLI.git","type":"git"},"_npmVersion":"11.4.2","description":"GROK-CODE CLI Terminal Agent - Interact with Grok 4 for code tasks in your terminal","directories":{},"_nodeVersion":"24.3.0","dependencies":{"uuid":"^10.0.0","chalk":"^4.1.2","dotenv":"^16.4.5","openai":"^4.56.0","fs-extra":"^11.2.0","inquirer":"^10.1.8","commander":"^12.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/grok-code-cli_1.0.0_1752456255906_0.6004942260420945","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@aigent47-devlabs/grok-code-cli","version":"1.1.0","keywords":["grok","xai","cli","ai","code","terminal"],"author":{"url":"AiGent47.com, LLC","name":"Robert DiCrisci","email":"robert@aigent47.com"},"license":"MIT","_id":"@aigent47-devlabs/grok-code-cli@1.1.0","maintainers":[{"name":"aigent47","email":"rob@aigent47.com"}],"homepage":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI#readme","bugs":{"url":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues"},"bin":{"grok":"index.js"},"dist":{"shasum":"6eb0af581b50a1d33f49ffe25e634b0f3b519752","tarball":"https://registry.npmjs.org/@aigent47-devlabs/grok-code-cli/-/grok-code-cli-1.1.0.tgz","fileCount":15,"integrity":"sha512-pbhIieW/xRRYBPfbxdIvjkETijZdljfGS/kltypyTJpL3RAyEpxROEwtssfzWxpqbBGNbMHcth6R9pYqf6Mj7Q==","signatures":[{"sig":"MEUCIQCfjw83zrHPHEsb7DWMPfb6MSKmbUTiw2WEP4/Rs0VJKwIgCLwikHqq/jOCJmp5wauXINSaxWOmTBTLldVr8YES6Fk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68022},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"0e410cead699f19ae970d2cf3c4fb90c0ef8881c","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aigent47","email":"rob@aigent47.com"},"repository":{"url":"git+https://github.com/AiGent47-DevLabs/Grok-Code-CLI.git","type":"git"},"_npmVersion":"11.4.2","description":"GROK-CODE CLI Terminal Agent - Interact with Grok 4 for code tasks in your terminal","directories":{},"_nodeVersion":"24.3.0","dependencies":{"uuid":"^10.0.0","axios":"^1.10.0","chalk":"^4.1.2","dotenv":"^16.4.5","openai":"^4.56.0","semver":"^7.7.2","fs-extra":"^11.2.0","inquirer":"^10.1.8","commander":"^12.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/grok-code-cli_1.1.0_1752457349692_0.9553350655580237","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@aigent47-devlabs/grok-code-cli","version":"1.2.0","keywords":["grok","xai","cli","ai","code","terminal"],"author":{"url":"AiGent47.com, LLC","name":"Robert DiCrisci","email":"robert@aigent47.com"},"license":"MIT","_id":"@aigent47-devlabs/grok-code-cli@1.2.0","maintainers":[{"name":"aigent47","email":"rob@aigent47.com"}],"homepage":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI#readme","bugs":{"url":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues"},"bin":{"grok":"index.js"},"dist":{"shasum":"a6da742f5e2a305bb1edd3f6863187209402bb4d","tarball":"https://registry.npmjs.org/@aigent47-devlabs/grok-code-cli/-/grok-code-cli-1.2.0.tgz","fileCount":25,"integrity":"sha512-lV/JWz378C8AODt7Y8FGdVxoTH9NicB5I4IauOHnt5XPRmcQSjL4wcGwzyfUsI0zoTAb3a271f7Q0buq1rx4sA==","signatures":[{"sig":"MEUCIA21eBMXAWOAGjGJYF3WuhtjOxKcmTiOxyd7ogzRBmZFAiEA4Q2hAIMYHVrSsb65FRyT7kaB9AgGcMszY3L17FNobm4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100527},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"edf91f56a090d30965daa1f8f0c85b143267fb14","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aigent47","email":"rob@aigent47.com"},"repository":{"url":"git+https://github.com/AiGent47-DevLabs/Grok-Code-CLI.git","type":"git"},"_npmVersion":"11.4.2","description":"GROK-CODE CLI Terminal Agent - Interact with Grok 4 for code tasks in your terminal","directories":{},"_nodeVersion":"24.3.0","dependencies":{"uuid":"^10.0.0","axios":"^1.10.0","chalk":"^4.1.2","dotenv":"^16.4.5","openai":"^4.56.0","semver":"^7.7.2","js-yaml":"^4.1.0","chokidar":"^3.5.3","fs-extra":"^11.2.0","inquirer":"^10.1.8","commander":"^12.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/grok-code-cli_1.2.0_1752525267693_0.6276652276285732","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@aigent47-devlabs/grok-code-cli","version":"1.2.1","description":"GROK-CODE CLI Terminal Agent - Interact with Grok 4 for code tasks in your terminal","main":"index.js","bin":{"grok":"index.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["grok","xai","cli","ai","code","terminal"],"author":{"name":"Robert DiCrisci","email":"robert@aigent47.com","url":"AiGent47.com, LLC"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/AiGent47-DevLabs/Grok-Code-CLI.git"},"bugs":{"url":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues"},"homepage":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI#readme","engines":{"node":">=14.0.0"},"dependencies":{"@octokit/rest":"^20.0.2","axios":"^1.10.0","chalk":"^4.1.2","chokidar":"^3.5.3","commander":"^12.1.0","dotenv":"^16.4.5","express":"^4.18.2","fs-extra":"^11.2.0","inquirer":"^10.1.8","js-yaml":"^4.1.0","openai":"^4.56.0","semver":"^7.7.2","uuid":"^10.0.0"},"_id":"@aigent47-devlabs/grok-code-cli@1.2.1","gitHead":"4c3b91d88d48fb2e429ce6397db9659d5afc2b63","_nodeVersion":"24.3.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-hDu5SIBR4UfbNSoG/XB1LbesposXfUvEqKn+rTZLfXXiHqskj8I+Kfk4HFc2ABOM58FzHzC93nrtC8X+lrjJkQ==","shasum":"8c6efbf9824b11b9ea8abfd6eb92b64fbad6696d","tarball":"https://registry.npmjs.org/@aigent47-devlabs/grok-code-cli/-/grok-code-cli-1.2.1.tgz","fileCount":16,"unpackedSize":95276,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDwyW4z5zAvmlk8K2huzHNfh6aqgg38bRS/jx4dSlwadAIhAI0tRuZQKowf1n4jsxFqhThhXVikCKnTOgXrGzVO/QLm"}]},"_npmUser":{"name":"aigent47","email":"rob@aigent47.com"},"directories":{},"maintainers":[{"name":"aigent47","email":"rob@aigent47.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/grok-code-cli_1.2.1_1752858392199_0.49338854271796406"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-14T01:24:15.782Z","modified":"2025-07-18T17:06:32.601Z","1.0.0":"2025-07-14T01:24:16.087Z","1.1.0":"2025-07-14T01:42:29.874Z","1.2.0":"2025-07-14T20:34:27.884Z","1.2.1":"2025-07-18T17:06:32.394Z"},"bugs":{"url":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues"},"author":{"name":"Robert DiCrisci","email":"robert@aigent47.com","url":"AiGent47.com, LLC"},"license":"MIT","homepage":"https://github.com/AiGent47-DevLabs/Grok-Code-CLI#readme","keywords":["grok","xai","cli","ai","code","terminal"],"repository":{"type":"git","url":"git+https://github.com/AiGent47-DevLabs/Grok-Code-CLI.git"},"description":"GROK-CODE CLI Terminal Agent - Interact with Grok 4 for code tasks in your terminal","maintainers":[{"name":"aigent47","email":"rob@aigent47.com"}],"readme":"# GROK-CODE CLI\n\nA powerful CLI terminal agent for Grok 4, inspired by Claude Code. Enables code generation, editing, running, and more via natural language interactions.\n\n![npm version](https://img.shields.io/npm/v/@aigent47-devlabs/grok-code-cli)\n![license](https://img.shields.io/npm/l/@aigent47-devlabs/grok-code-cli)\n![node version](https://img.shields.io/node/v/@aigent47-devlabs/grok-code-cli)\n\n## Features\n\n### Core Features\n- 🤖 Natural language code generation and editing\n- 📝 Interactive file editing with AI assistance\n- 🔧 Execute code and commands directly\n- 💾 Session management with conversation history\n- 🎨 Beautiful colored terminal output\n- 🔒 Safe file operations with user consent\n- 🚀 Project initialization assistance\n- 🔄 Auto-update system (checks every 24 hours)\n- 🔁 Self-correction on API errors\n- 📋 GROK.md context support (global and project-specific)\n\n### New in v1.2.0\n- 🎨 **Canvas Preview** - Visualize HTML, JavaScript, and Python files in browser\n- 📧 **Email Integration** - Convert email requests into GitHub issues\n- ☀️ **Morning Init** - Start your day with context from previous sessions\n- 🌙 **Pack It Up** - End-of-day summaries with next day priorities\n- 🤖 **Multi-Agent System** - Automated GitHub workflow management\n- 📦 **Interactive UI** - Beautiful input box like Claude Code\n\n## Important Disclaimer\n\n**⚠️ WARNING**: This tool uses AI to generate code. AI-generated code can be unpredictable, incorrect, or potentially harmful. **You are solely responsible for reviewing and testing all generated code before execution.**\n\nOn first run, you'll see a disclaimer notice. For the full legal disclaimer, run:\n```bash\ngrok /disclaimer\n```\n\n## Visual Experience\n\nThe CLI features a beautiful ASCII art splash screen in X.AI's signature magenta color scheme:\n\n```\n ██████╗ ██████╗  ██████╗ ██╗  ██╗      ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝ ██╔══██╗██╔═══██╗██║ ██╔╝     ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║  ███╗██████╔╝██║   ██║█████╔╝█████╗██║     ██║   ██║██║  ██║█████╗  \n██║   ██║██╔══██╗██║   ██║██╔═██╗╚════╝██║     ██║   ██║██║  ██║██╔══╝  \n╚██████╔╝██║  ██║╚██████╔╝██║  ██╗      ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═╝       ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n\n🤖 GROK-CODE - AI-Powered Development Assistant\nVersion 1.2.0 | Powered by X.AI\nDeveloped by: AiGent47.com\n```\n\n## Prerequisites\n\n- Node.js >= 14.0.0\n- npm or yarn\n- X.AI API key (get one at [https://x.ai/api](https://x.ai/api))\n\n## Installation\n\n```bash\nnpm install -g @aigent47-devlabs/grok-code-cli\n```\n\nOr with yarn:\n\n```bash\nyarn global add @aigent47-devlabs/grok-code-cli\n```\n\n## Quick Start\n\n1. Install the CLI globally:\n   ```bash\n   npm install -g @aigent47-devlabs/grok-code-cli\n   ```\n\n2. Configure your API key:\n   ```bash\n   grok /config\n   ```\n\n3. Start using Grok:\n   ```bash\n   grok \"Write a Python script that calculates fibonacci numbers\"\n   ```\n\n## Configuration\n\n### Initial Setup\n\nOn first run, configure your X.AI API key:\n\n```bash\ngrok /config\n```\n\nThis will prompt you for:\n- **API Key**: Your X.AI API key\n- **Working Directory**: Default directory for file operations (defaults to current directory)\n\nConfiguration is stored in `~/.grok/config.json`.\n\n### Environment Variables\n\nYou can also set your API key via environment variable:\n\n```bash\nexport XAI_API_KEY=\"your-api-key-here\"\n```\n\n### API Key Format\n\nYour X.AI API key should look like: `xai-XXXXXXXXXXXXXXXXXXXXXXXX`\n\nGet your API key from: [https://x.ai/api](https://x.ai/api)\n\n## Commands\n\n### Basic Usage\n\n```bash\n# Send a prompt to Grok\ngrok \"Explain how async/await works in JavaScript\"\n\n# Use slash commands\ngrok /help\n```\n\n### Available Commands\n\n| Command | Description | Example |\n|---------|-------------|---------|\n| `/help` | Show all available commands | `grok /help` |\n| `/new` | Start a new session | `grok /new` |\n| `/history` | View current session history | `grok /history` |\n| `/resume <id>` | Resume a previous session | `grok /resume abc123` |\n| `/model <name>` | Switch AI model | `grok /model grok-3` |\n| `/config` | Configure API key and settings | `grok /config` |\n| `/explain <code/file>` | Explain code or file contents | `grok /explain app.js` |\n| `/edit <file>` | AI-assisted file editing | `grok /edit index.js` |\n| `/run <cmd/file>` | Execute command or file | `grok /run \"npm test\"` |\n| `/init` | Initialize a new project | `grok /init` |\n| `/canvas <file>` | Preview HTML/JS/Python visualizations | `grok /canvas demo.html` |\n| `/email` | Email integration commands | `grok /email review` |\n| `/morning-init` | Initialize morning workspace | `grok /morning-init` |\n| `/pack-it-up` | End of day summary | `grok /pack-it-up` |\n| `/disclaimer` | View legal disclaimer | `grok /disclaimer` |\n| `/exit` | Exit the CLI | `grok /exit` |\n\n## Examples\n\n### Code Generation\n\n```bash\n# Generate a React component\ngrok \"Create a React TodoList component with add and delete functionality\"\n\n# Generate a Python script\ngrok \"Write a Python script to scrape headlines from a news website\"\n```\n\n### Code Explanation\n\n```bash\n# Explain a file\ngrok /explain server.js\n\n# Explain code snippet\ngrok /explain \"const [state, setState] = useState(0)\"\n```\n\n### File Editing\n\n```bash\n# Edit a file with AI assistance\ngrok /edit app.js\n# Then provide instructions: \"Add error handling to all async functions\"\n```\n\n### Project Initialization\n\n```bash\n# Initialize a new project\ngrok /init\n# Then specify: \"python\" or \"node\" or \"react\"\n```\n\n### Session Management\n\n```bash\n# Start fresh\ngrok /new\n\n# View conversation history\ngrok /history\n\n# Resume previous session\ngrok /resume <session-id>\n```\n\n### Canvas Preview (New!)\n\n```bash\n# Preview HTML visualization\ngrok /canvas examples/earth-simulation.html\n\n# Preview JavaScript charts\ngrok /canvas examples/data-viz.js\n\n# Preview Python plots\ngrok /canvas examples/analysis.py\n```\n\n### Email Integration (New!)\n\n```bash\n# Review pending email requests\ngrok /email review\n\n# Process a specific request\ngrok /email process <request-id>\n\n# Generate email template\ngrok /email template feature\n\n# Start webhook server\ngrok /email webhook\n```\n\n### Daily Workflow (New!)\n\n```bash\n# Start your day\ngrok /morning-init\n\n# Work throughout the day...\n\n# End your day\ngrok /pack-it-up\n```\n\n## Session Storage\n\nSessions are stored in `~/.grok/sessions/` with the following structure:\n- Each session is saved as a JSON file\n- Session ID is a UUID\n- Contains full conversation history\n- Preserves model selection\n\n## Safety Features\n\n- **File Consent**: All file operations require explicit user confirmation\n- **Backup Creation**: Automatic backups before file modifications\n- **Directory Creation**: Automatic directory creation with user consent\n- **Large File Warning**: Warns when reading files over 1MB\n\n## Troubleshooting\n\n### API Key Issues\n\nIf you see \"Invalid API key\" errors:\n1. Verify your API key at [https://x.ai/api](https://x.ai/api)\n2. Re-run `grok /config` to update your key\n3. Check environment variable: `echo $XAI_API_KEY`\n\n### Network Errors\n\nIf you see network errors:\n1. Check your internet connection\n2. Verify X.AI API is accessible\n3. Check for proxy/firewall issues\n\n### Model Availability\n\nAvailable models:\n- `grok-4` (default)\n- `grok-3`\n- Additional models as they become available\n\n## Development\n\n### Local Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/AiGent47-DevLabs/Grok-Code-CLI.git\ncd Grok-Code-CLI\n\n# Install dependencies\nnpm install\n\n# Link for local testing\nnpm link\n\n# Run locally\ngrok /help\n```\n\n### Running Tests\n\n```bash\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Inspired by Claude Code and similar AI-powered development tools\n- Built with [Commander.js](https://github.com/tj/commander.js/) for CLI parsing\n- Uses [Chalk](https://github.com/chalk/chalk) for beautiful terminal colors\n- Powered by [X.AI's Grok models](https://x.ai)\n\n## Support\n\n- 🐛 Report bugs via [GitHub Issues](https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues)\n- 💡 Request features via [GitHub Issues](https://github.com/AiGent47-DevLabs/Grok-Code-CLI/issues)\n- 📧 Contact: robert@aigent47.com\n\n## Changelog\n\n### v1.2.0 (2025-07-14)\n- Added Canvas preview system for visualizations\n- Email integration for feature requests\n- Morning-init and pack-it-up commands\n- Interactive UI with input box\n- Multi-agent GitHub automation\n- Daily summary system\n\n### v1.1.0 (2025-07-14)\n- Auto-update functionality\n- Self-correction error handling\n- GROK.md context support\n- Workspace analysis\n- MCP Zapier connector\n\n### v1.0.0 (2025-07-13)\n- Initial release\n- Basic code generation and editing\n- Session management\n- File operations with consent\n- Multiple model support\n\n## Design Document Compliance\n\nThis CLI implements the core features from the original design document:\n\n### ✅ Implemented\n- Conversational code generation\n- File operations (read/write/edit)\n- Session history management\n- Slash commands\n- Environment integration (/run)\n- Multi-model support\n- Configuration management\n- File access controls\n\n### 🚧 Planned Features\n- **Security**: API key encryption, sandboxed execution, audit logging\n- **Extensibility**: Plugin support, model backend abstraction\n- **Advanced**: Batch processing, file diffs, dedicated /docs and /test commands\n\nSee [TODO.md](TODO.md) for the complete roadmap.\n\n---\n\nMade with ❤️ by Robert DiCrisci  \n© 2025 AiGent47.com, LLC","readmeFilename":"readme.md"}