{"id":31045030,"url":"https://github.com/rushikeshg25/cool-code","last_synced_at":"2026-03-05T22:09:24.452Z","repository":{"id":305702949,"uuid":"1021188464","full_name":"rushikeshg25/cool-code","owner":"rushikeshg25","description":"Cli coding Ai agent like Claude Code and Gemini Cli","archived":false,"fork":false,"pushed_at":"2026-02-03T17:22:25.000Z","size":834,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-04T06:56:23.188Z","etag":null,"topics":["agent","ai","cli"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cool-code","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rushikeshg25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-17T03:12:44.000Z","updated_at":"2026-02-03T17:22:30.000Z","dependencies_parsed_at":"2025-07-21T16:35:30.140Z","dependency_job_id":"8d774487-539f-4361-ba63-f03b60f0d07b","html_url":"https://github.com/rushikeshg25/cool-code","commit_stats":null,"previous_names":["rushikeshg25/ai-db-cli","rushikeshg25/cool-code"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rushikeshg25/cool-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushikeshg25%2Fcool-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushikeshg25%2Fcool-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushikeshg25%2Fcool-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushikeshg25%2Fcool-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rushikeshg25","download_url":"https://codeload.github.com/rushikeshg25/cool-code/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rushikeshg25%2Fcool-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","cli"],"created_at":"2025-09-14T16:54:15.600Z","updated_at":"2026-03-05T22:09:24.439Z","avatar_url":"https://github.com/rushikeshg25.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cool-Code: CLI Coding AI Agent\n\nAn intelligent command-line interface that leverages AI to help you interact with codebases and work on them similar to Gemini CLI and Claude Code.\n\n## Overview\n\nCool-Code is a powerful tool that combines the capabilities of large language models with a comprehensive set of development tools to provide an interactive development experience. Simply describe what you want to accomplish, and the AI agent will understand your intent and execute the necessary operations.\n\nDemo of it spinning up a Node Express server with Prisma:\n\nhttps://github.com/user-attachments/assets/b1b59602-f118-4bbe-8b38-e4be0f39119f\n\n## Features\n\n- **Agent Modes**: Switch between Planning, Agent, and Ask modes for different interaction styles.\n- **Task Tracking**: Real-time checklists for complex, multi-step operations.\n- **Input Queuing**: Send new instructions while the agent is still processing a previous request.\n- **Natural Language Processing**: Interact with your codebase using plain English.\n- **Intelligent Code Analysis**: Understands your project structure and coding patterns without needing vector databases.\n- **File Operations**: Read, create, edit, and search files with AI assistance.\n- **Shell Command Execution**: Run system commands safely through the AI agent.\n- **Real-time Streaming**: Get live feedback as the AI processes your requests.\n- **Context-Aware**: Maintains conversation history and project context automatically.\n\n## Setup Guide\n\n### Prerequisites\n\n- Node.js\n- A Google AI API key for Gemini\n\n### Quick Install (Recommended)\n\nInstall globally from npm:\n\n```bash\nnpm install -g cool-code\n```\n\nSet your Google AI API key:\n\n```bash\nexport GOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here\n```\n\n### Development Setup\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/rushikeshg25/cool-code.git\ncd cool-code\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Set up environment variables:\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env` and add your Google AI API key:\n\n```\nGOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here\n```\n\n4. Build the project:\n\n```bash\nnpm run build\n```\n\n5. Link for local development:\n\n```bash\nnpm link\n```\n\n## Usage\n\n### Starting the CLI\n\nNavigate to your project's directory and run:\n\n```bash\ncool-code\n```\n\nOn startup, the CLI will ask to initialize in the current directory before building context.\n\n### Command Line Options\n\n```bash\n# Auto-initialize in current dir\ncool-code --yes\n\n# Exit without initializing\ncool-code --no-init\n\n# Reduce UI output for automation\ncool-code --quiet\n\n# Allow dangerous actions without prompts\ncool-code --allow-dangerous\n\n# Copy final response to clipboard\ncool-code --copy\n```\n\n### Agent Modes\n\nCool-Code supports three distinct modes of operation:\n\n1. **Planning Mode**: Analyzes your request and generates a Task List (TODOs) without touching your code. Useful for architecting changes before execution.\n2. **Agent Mode**: The default mode. Executes tasks autonomously, applying code changes and running commands.\n3. **Ask Mode**: Read-only mode for questions and explanations. Mutating tools (like shell or write_file) are blocked.\n\nSwitch modes mid-session using the `:mode` command:\n- `:mode planning`\n- `:mode agent`\n- `:mode ask`\n\n### Advanced CLI Commands\n\n```bash\n# Project summary and framework detection\ncool-code scan\n\n# Force refresh the scan cache\ncool-code scan --refresh\n\n# JSON output\ncool-code scan --json\n\n# Task planning\ncool-code task \"Add user authentication and password reset\"\n\n# Config management\ncool-code config get llm.model\ncool-code config set llm.model \"gemini-2.5-flash\"\ncool-code config set llm.maxTokens 2048\n```\n\n### Interactive Commands\n\nInside the CLI prompt:\n\n- `:help` Show interactive commands\n- `:mode` Show or switch current mode\n- `:context` Preview the prompt context\n- `:clear` Clear the screen\n- `:exit` or `:quit` Exit\n\n### Non-blocking Input\n\nYou can type and send new messages even while the agent is processing tool calls. These messages will be queued and processed immediately after the current step is completed, allowing you to pivot or provide feedback mid-task.\n\n## Architecture\n\n### Core Components\n\n#### 1. Entry Point (`src/index.ts`)\nThe main entry point that initializes the CLI using Commander.js and starts the interactive session.\n\n#### 2. UI Layer (`src/ui/`)\n- **Landing (`landing.ts`)**: Displays a compact, professional welcome screen.\n- **Query Handler (`query.ts`)**: Manages the main input loop, status bar, and task rendering.\n- **Spinner (`spinner.ts`)**: Provides visual feedback with synchronized status messages.\n\n#### 3. Core Engine (`src/core/`)\n- **Processor (`processor.ts`)**: Main orchestrator handling query turns, tool execution, and message queuing.\n- **LLM (`llm.ts`)**: Manages communication with Google's Gemini models.\n- **Context Manager (`contextManager.ts`)**: Maintains project state, file trees, and mode-specific prompt building.\n- **Prompts (`prompts.ts`)**: Contains high-level system logic, mode definitions, and tool instructions.\n\n#### 4. Tool System (`src/core/tools/`)\n- **File Operations**: `readFileTool`, `editTool`, `newFileTool`, `deleteFileTool`.\n- **Search \u0026 Discovery**: `globTool`, `grepTool`.\n- **System Operations**: `shellTool`, `ignoreGitIgnoreFileTool`.\n\n## Configuration\n\n### Environment Variables\n- `GOOGLE_GENERATIVE_AI_API_KEY`: Your Gemini API key.\n\n### Project Config (.coolcode.json)\n\n```json\n{\n  \"llm\": {\n    \"model\": \"gemini-2.5-flash\",\n    \"temperature\": 0.2,\n    \"maxTokens\": 2048\n  },\n  \"features\": {\n    \"scanCache\": true,\n    \"fileTreeMaxDepth\": 4,\n    \"allowDangerous\": false,\n    \"confirmEdits\": false\n  },\n  \"guardrails\": {\n    \"blockReadPatterns\": [\n      \".env\",\n      \"*.pem\",\n      \"*.key\",\n      \"id_rsa\"\n    ]\n  }\n}\n```\n\n## Safety Features\n\n- **Path Validation**: Operations are restricted to the project root.\n- **Git Integration**: Automatically respects .gitignore patterns.\n- **Dangerous Action Prompts**: Requires explicit confirmation for potentially destructive shell commands.\n- **Edit Confirmations**: Configurable prompts for code edits.\n- **Ask Mode**: Strict read-only enforcement for safer exploration.\n\n## Project Structure\n\n```\ncool-code/\n├── src/\n│   ├── core/                 # Core engine\n│   │   ├── tools/           # Tool implementations\n│   │   ├── utils/           # Utility functions\n│   │   ├── contextManager.ts\n│   │   ├── llm.ts\n│   │   ├── processor.ts\n│   │   └── prompts.ts\n│   ├── types/               # TypeScript definitions\n│   ├── ui/                  # UI components\n│   └── index.ts            # Entry point\n├── dist/                   # Compiled output\n├── package.json\n└── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushikeshg25%2Fcool-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frushikeshg25%2Fcool-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frushikeshg25%2Fcool-code/lists"}