An intelligent command-line interface that leverages AI to help you interact with codebases and work on them similar to Gemini CLI and Claude Code.
Cool-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.
Demo of it spinning up a Node Express server with Prisma:
Cool.Code.Demo.VId.mp4
- Agent Modes: Switch between Planning, Agent, and Ask modes for different interaction styles.
- Task Tracking: Real-time checklists for complex, multi-step operations.
- Input Queuing: Send new instructions while the agent is still processing a previous request.
- Natural Language Processing: Interact with your codebase using plain English.
- Intelligent Code Analysis: Understands your project structure and coding patterns without needing vector databases.
- File Operations: Read, create, edit, and search files with AI assistance.
- Shell Command Execution: Run system commands safely through the AI agent.
- Real-time Streaming: Get live feedback as the AI processes your requests.
- Context-Aware: Maintains conversation history and project context automatically.
- Node.js
- A Google AI API key for Gemini
Install globally from npm:
npm install -g cool-codeSet your Google AI API key:
export GOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here- Clone the repository:
git clone https://github.com/rushikeshg25/cool-code.git
cd cool-code- Install dependencies:
npm install- Set up environment variables:
cp .env.example .envEdit .env and add your Google AI API key:
GOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here
- Build the project:
npm run build- Link for local development:
npm linkNavigate to your project's directory and run:
cool-codeOn startup, the CLI will ask to initialize in the current directory before building context.
# Auto-initialize in current dir
cool-code --yes
# Exit without initializing
cool-code --no-init
# Reduce UI output for automation
cool-code --quiet
# Allow dangerous actions without prompts
cool-code --allow-dangerous
# Copy final response to clipboard
cool-code --copyCool-Code supports three distinct modes of operation:
- Planning Mode: Analyzes your request and generates a Task List (TODOs) without touching your code. Useful for architecting changes before execution.
- Agent Mode: The default mode. Executes tasks autonomously, applying code changes and running commands.
- Ask Mode: Read-only mode for questions and explanations. Mutating tools (like shell or write_file) are blocked.
Switch modes mid-session using the :mode command:
:mode planning:mode agent:mode ask
# Project summary and framework detection
cool-code scan
# Force refresh the scan cache
cool-code scan --refresh
# JSON output
cool-code scan --json
# Task planning
cool-code task "Add user authentication and password reset"
# Config management
cool-code config get llm.model
cool-code config set llm.model "gemini-2.5-flash"
cool-code config set llm.maxTokens 2048Inside the CLI prompt:
:helpShow interactive commands:modeShow or switch current mode:contextPreview the prompt context:clearClear the screen:exitor:quitExit
You 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.
The main entry point that initializes the CLI using Commander.js and starts the interactive session.
- Landing (
landing.ts): Displays a compact, professional welcome screen. - Query Handler (
query.ts): Manages the main input loop, status bar, and task rendering. - Spinner (
spinner.ts): Provides visual feedback with synchronized status messages.
- Processor (
processor.ts): Main orchestrator handling query turns, tool execution, and message queuing. - LLM (
llm.ts): Manages communication with Google's Gemini models. - Context Manager (
contextManager.ts): Maintains project state, file trees, and mode-specific prompt building. - Prompts (
prompts.ts): Contains high-level system logic, mode definitions, and tool instructions.
- File Operations:
readFileTool,editTool,newFileTool,deleteFileTool. - Search & Discovery:
globTool,grepTool. - System Operations:
shellTool,ignoreGitIgnoreFileTool.
GOOGLE_GENERATIVE_AI_API_KEY: Your Gemini API key.
{
"llm": {
"model": "gemini-2.5-flash",
"temperature": 0.2,
"maxTokens": 2048
},
"features": {
"scanCache": true,
"fileTreeMaxDepth": 4,
"allowDangerous": false,
"confirmEdits": false
},
"guardrails": {
"blockReadPatterns": [
".env",
"*.pem",
"*.key",
"id_rsa"
]
}
}- Path Validation: Operations are restricted to the project root.
- Git Integration: Automatically respects .gitignore patterns.
- Dangerous Action Prompts: Requires explicit confirmation for potentially destructive shell commands.
- Edit Confirmations: Configurable prompts for code edits.
- Ask Mode: Strict read-only enforcement for safer exploration.
cool-code/
├── src/
│ ├── core/ # Core engine
│ │ ├── tools/ # Tool implementations
│ │ ├── utils/ # Utility functions
│ │ ├── contextManager.ts
│ │ ├── llm.ts
│ │ ├── processor.ts
│ │ └── prompts.ts
│ ├── types/ # TypeScript definitions
│ ├── ui/ # UI components
│ └── index.ts # Entry point
├── dist/ # Compiled output
├── package.json
└── README.md