GeminiForMac is a macOS desktop client based on gemini-cli, providing a user-friendly graphical interface for interacting with Google Gemini AI.
- Add Chat History feature
- Implement Tool Execution Whitelist, similar to Cursor
- Support Custom Directory AI Context Markdown files (e.g.,
gemini.md,claude.md)
- Intuitive GUI: Modern native macOS interface design
- File Management: Built-in file browser for easy project file management
- Proxy Support: Built-in proxy settings with network proxy configuration
- Project Management: Support for switching and managing multiple projects
The application includes the following main interfaces:
- Chat Interface: Main conversation interaction area with Markdown rendering support
- File Explorer: Left sidebar file tree for browsing and selecting project files
- Settings Panel: Proxy settings, project configuration, etc.
- Login Interface: Support for Google account login and API Key configuration
- macOS 14.0 or higher
- Network connection (for AI services)
- Download and install the PKG installer
- Double-click the PKG file to install
- Launch the GeminiForMac application
- Server will start automatically (handled by postinstall script)
- Follow the interface prompts to complete login and configuration
If you need to use a proxy to access the network:
- Open "Proxy Settings" in the application
- Configure proxy server address and port
- Save settings and restart the service
The system will automatically detect http://127.0.0.1:7890 proxy by default.
# Navigate to the iOS/macOS project directory
cd GeminiForMac
# Build using Xcode
xcodebuild build -project GeminiForMac.xcodeproj -scheme GeminiForMac -configuration Release# Run the packaging script
./macPackage/scripts/package-macos-pkg.shAfter packaging is complete, the PKG file will be generated in the macPackage/dist/ directory.
Application logs are stored in the following locations:
- Application Logs:
~/Library/Logs/GeminiForMac/ - Server Logs:
~/Library/Logs/GeminiForMac/gemini-server.log - Error Logs:
~/Library/Logs/GeminiForMac/gemini-server-error.log
# View real-time logs
tail -f ~/Library/Logs/GeminiForMac/gemini-server.log
# View error logs
tail -f ~/Library/Logs/GeminiForMac/gemini-server-error.log# Stop service
launchctl unload ~/Library/LaunchAgents/com.gemini.cli.server.plist
# Start service
launchctl load ~/Library/LaunchAgents/com.gemini.cli.server.plist
# Check service status
launchctl list | grep com.gemini.cli.server
# Verify service port
curl http://localhost:18080/health-
Stop background service:
launchctl unload ~/Library/LaunchAgents/com.gemini.cli.server.plist -
Delete application:
rm -rf /Applications/GeminiForMac.app
-
Clean user data:
# Delete server files rm -rf ~/.gemini-server # Delete Launch Agent configuration rm -f ~/Library/LaunchAgents/com.gemini.cli.server.plist # Delete log files rm -rf ~/Library/Logs/GeminiForMac
-
Clean configuration files (optional):
# Delete application configuration (if complete cleanup needed) rm -rf ~/Library/Preferences/com.gemini.cli.* rm -rf ~/Library/Application\ Support/GeminiForMac
┌─────────────────┐ HTTP/WebSocket ┌─────────────────┐
│ │ ──────────────────→ │ │
│ macOS Client │ │ Background │
│ (SwiftUI) │ ←────────────────── │ Server (Node.js)│
│ │ │ │
└─────────────────┘ └─────────────────┘
│ │
│ │
┌────▼────┐ ┌────▼────┐
│ Local UI│ │ Gemini │
│Components│ │ API │
└─────────┘ └─────────┘
Native macOS application built with SwiftUI:
- Main Modules:
MainView.swift: Main interface containerModules/Input/: Input components with dynamic height adjustmentModules/FileExplorer/: File browserModules/Login/: Login and authenticationModules/Proxy/: Proxy settingsServices/: Network services and data management
Node.js background service providing API endpoints:
- Core Services:
core/GeminiService.ts: Gemini API integrationauth/AuthService.ts: Authentication managementchat/ChatHandler.ts: Chat processingfiles/FileService.ts: File operationsproject/ProjectService.ts: Project managementutils/ProxyConfigManager.ts: Proxy configuration
- HTTP API: Standard REST interfaces for basic operations
- WebSocket: For real-time chat and streaming responses
- Port: Uses port
18080by default
- User inputs message in macOS client
- Client sends to background server via HTTP/WebSocket
- Server calls Gemini API to process request
- Response streams back to client via WebSocket
- Client renders response content in real-time
- Server Configuration:
~/.gemini-server/directory - Launch Agent:
~/Library/LaunchAgents/com.gemini.cli.server.plist - Proxy Configuration: Auto-detection or manual configuration
-
Server fails to start:
- Check if port 18080 is occupied
- View error logs:
~/Library/Logs/GeminiForMac/gemini-server-error.log
-
Cannot connect to Gemini API:
- Check network connection
- Verify proxy settings are correct
- Validate API Key or login status
-
Interface anomalies:
- Restart the application
- Check macOS version compatibility
- View original project documentation: README_ORIGINAL.md
- Check log files for detailed error information
- Restart server service
This project is based on the original gemini-cli project. Please refer to the relevant license terms.

