Prerequisites
Install Node.js
Choose an AI Provider
You’ll need either:Option A: Google Gemini (Cloud AI)
- Get API key from Google AI Studio
- Fast, powerful, works immediately
- Sends data to Google servers
- Install from ollama.ai
- 100% private, runs on your machine
- Requires ~4GB+ RAM
Clone and Install
Sharp Build Issues: Sharp is an image processing library that sometimes fails to build. The
--ignore-scripts approach uses prebuilt binaries instead of compiling from source.Environment Configuration
Create a.env file in the project root:
Setting Up Ollama (Optional)
If using Ollama for private, local AI:Install Ollama
Download and install from ollama.ai
Start Ollama Server
http://localhost:11434 by default.Development Workflow
Running in Development Mode
The recommended way to run Cluely during development:- Starts Vite dev server on
http://localhost:5180 - Waits for the server to be ready
- Compiles Electron TypeScript code
- Launches the Electron app with hot reload
How it works: The
npm start script is an alias for npm run app:dev, which uses concurrently to run multiple processes:Manual Development Steps
If you prefer to run processes separately:Step-by-Step Manual Development
Step-by-Step Manual Development
Development Features
Hot Reload
React components reload instantly without restarting Electron.
DevTools
Uncomment in
electron/WindowHelper.ts:105:Live Logs
All
console.log statements from main process appear in your terminal.URL Loading
Dev mode loads from
http://localhost:5180 instead of file system.Build Scripts Reference
Script Breakdown
| Script | Description | When to Use |
|---|---|---|
npm start | Full dev environment | Primary development command |
npm run dev | Vite server only | Testing React components |
npm run electron:dev | Electron only | Testing main process changes |
npm run watch | Compile Electron on save | Advanced development |
npm run build | Build React app | Before packaging |
npm run dist | Full production build | Creating distributable app |
npm run clean | Remove build artifacts | Clean slate before rebuild |
Building for Production
Build the Application
- Runs
npm run clean - Compiles TypeScript (
tsc) - Builds React with Vite (
vite build) - Compiles Electron TypeScript
- Packages with electron-builder
electron-builder Configuration
The build configuration inpackage.json controls how the app is packaged:
Build Customization
Change App Name
Change App Name
Edit
productName in the build section of package.json:Add/Remove Build Targets
Add/Remove Build Targets
Modify the
target arrays for each platform:Update App Icons
Update App Icons
Place icons in
assets/icons/:- macOS:
assets/icons/mac/icon.icns(512x512 PNG converted to ICNS) - Windows:
assets/icons/win/icon.ico(256x256 ICO format) - Linux:
assets/icons/png/(multiple PNG sizes)
Troubleshooting
Port Already in Use
Error: Port 5180 is already in use
Error: Port 5180 is already in use
Problem: Another instance of Vite is running.Solution:Or change the port in
package.json:Electron Won’t Start
White screen or blank window
White screen or blank window
Causes:
- Vite server not running
- Port mismatch between Vite and Electron
- TypeScript compilation errors
Build Failures
TypeScript errors during build
TypeScript errors during build
Problem: Type errors prevent compilation.Solution:
electron-builder fails
electron-builder fails
Common issues:
-
Missing files: Ensure
dist/anddist-electron/exist - Permission errors: Run without sudo/admin
- Disk space: electron-builder needs ~1GB+ free space
-
macOS code signing: Disable if not publishing
Platform-Specific Issues
Windows: UI not loading
Windows: UI not loading
Problem: Renderer process can’t connect to main process.Solution: Ensure
main field in package.json points to the correct file:Linux: Window interaction problems
Linux: Window interaction problems
Problem: Can’t click or focus the window.Solution: Check window settings in
electron/WindowHelper.ts:115-122:macOS: App won't quit
macOS: App won't quit
Problem: Pressing Cmd+Q doesn’t quit.Workaround:
- Use Activity Monitor to force quit
- Or add proper quit handler:
Ollama Issues
Ollama connection failed
Ollama connection failed
Problem: Can’t connect to Ollama server.Debug Steps:
Environment Variables Reference
| Variable | Default | Description |
|---|---|---|
GEMINI_API_KEY | - | Primary Google Gemini API key |
GEMINI_FALLBACK_API_KEY | - | Backup API key for rate limits |
USE_OLLAMA | false | Enable Ollama local AI |
OLLAMA_MODEL | llama3.2 | Ollama model to use |
OLLAMA_URL | http://localhost:11434 | Ollama server URL |
OPENROUTER_API_KEY | - | OpenRouter API key |
OPENROUTER_MODEL | google/gemini-2.5-flash | OpenRouter model |
K2_THINK_API_KEY | - | K2 Think V2 API key |
USE_K2_THINK | false | Enable K2 Think V2 |
NODE_ENV | development | Set to production for builds |
Development Tips
Fast Iteration
Changes to React components reload instantly. For Electron changes, restart with
npm run electron:dev.Debug Main Process
Use
console.log() in Electron code - output appears in the terminal where you ran npm start.Debug Renderer
Enable DevTools in
WindowHelper.ts or press Cmd+Option+I (may not work due to global shortcuts).Test Multiple Platforms
Use VMs or dual-boot to test Windows/Linux builds if developing on macOS.
Next Steps
Contributing Guidelines
Ready to contribute? Read our contribution guidelines for code style, PR process, and more.