An intelligent AI agent powered by Google's Gemini API that can build complete websites based on natural language descriptions.
Created by Sanjay Sikdar.
- Natural Language Interface — Just describe what you want, and the agent builds it.
- Command Execution System (⚙️) — Secure shell/terminal command execution with safety filters, validation and a 30-second timeout. (Exposed via the executeCommand tool.)
- File Operations (📁) — Read, write, and list files using modern
fs/promisesAPIs (readFile, writeFile, listFiles). - Persistent Chat Memory (📚) — Keeps conversational context for up to 20 messages with automatic trimming to stay within token limits.
- Modify Existing Components (🧱) — Edit HTML, CSS, or JS parts dynamically without breaking the overall document structure.
- Smart Code Generation — Produces clean, modern, responsive website scaffolds and component code.
- Rate Limiting + Retry Logic (⏳) — Built-in 2s delay between API calls plus automatic retries with exponential backoff (e.g., 5s, 15s, 30s), up to 3 retries for quota errors.
- Error Handling (🔒) — Robust handling with smart fallbacks for timeouts, authentication issues and other common failures.
- Image Placeholder Management (🖼️) — Uses services like
picsum.photosanddummyimage.comfor image placeholders during scaffolding. - Cross-Platform Support (🖥️) — Works on Windows, macOS, and Linux (handles path and shell differences).
- Enhanced UX — Beautiful console output with emojis, progress indicators and clear retry/error messages.
- Security Features — Blocks dangerous commands and enforces command validation policies.
# Install dependencies
npm install-
Get your Google Gemini API key from Google AI Studio
-
Set as environment variable (recommended):
# Linux/Mac export GEMINI_API_KEY=your_key_here # Windows PowerShell $env:GEMINI_API_KEY="your_key_here" # Windows CMD set GEMINI_API_KEY=your_key_here
npm start- "Create a personal portfolio website with a hero section and contact form"
- "Build a landing page for a restaurant with a menu section"
- "Make a simple blog layout with header, main content area, and footer"
- "Create a modern website for a tech startup"
- Type your request to create a website
- Type
exitorquitto close the agent - Type
clearorresetto clear conversation history
The agent includes automatic rate limiting to prevent API quota issues:
- 2-second delay between API calls
- Automatic retry with exponential backoff (5s, 15s, 30s)
- Up to 3 retries on rate limit errors
- Wait 5-10 minutes and try again
- Get a fresh API key from Google AI Studio
- Switch to Gemini 1.5 Flash (more stable, higher limits)
- Clear history frequently with
clearcommand
See TROUBLESHOOTING.md for detailed solutions.
The agent has access to these tools:
- executeCommand: Run terminal/shell commands
- readFile: Read file contents
- writeFile: Create or update files (preferred for multi-line content)
- listFiles: Explore directory structures
The agent includes basic security features:
- Blocks dangerous commands (rm -rf /, format, shutdown, etc.)
- 30-second timeout for commands
- Command validation
- Model: Google Gemini 2.5 Flash - can be changed to 1.5 Flash
- Function Calling: Uses Gemini's function calling for tool execution
- History Management: Maintains conversation context with automatic trimming
- Iteration Limit: Maximum 15 tool calls per request to prevent infinite loops
- Rate Limiting: 2s delay between calls with retry logic
- Gemini 1.5 Flash: 15 requests/min, 1,500 requests/day
- Gemini 2.5 Flash: More restrictive (experimental)
- Use
gemini-1.5-flashfor stability - Clear history after each project
- Wait between requests
- Consider paid tier for heavy usage
- New Tools: Added
readFile,writeFile, andlistFilesfor better file management - Better Code Generation: Uses
writeFileinstead ofechofor cleaner multi-line content - Enhanced System Prompt: More detailed instructions and best practices
- Security: Command validation and dangerous command blocking
- UX: Beautiful console output with emojis and clear formatting
- Error Handling: Specific error messages for different error types
- API Key Management: Uses environment variables
- Conversation Management: History trimming and reset capability
- Iteration Limits: Prevents infinite loops
- Rate Limiting: Automatic retry with exponential backoff to handle quota limits
- Be specific about what you want in your website
- The agent works step-by-step, executing one action at a time
- You can ask for modifications after the initial build
- The agent follows modern web development best practices
- If you hit rate limits, switch to
gemini-1.5-flashmodel
See TROUBLESHOOTING.md for detailed solutions to common issues:
- Error 429: Resource Exhausted
- Invalid API Key
- Maximum Iterations Reached
- Rate limiting configuration
MIT