A free, open-source, lightning-fast native Mac app for chatting with Grok AI
Download Β· Features Β· Getting Started Β· Build from Source Β· Contributing
π¬ Watch the Full Demo on YouTube β See Grok for Mac in action!
Grok for Mac is a native macOS application that gives you direct access to xAI's powerful Grok AI models right from your desktop. No browser needed β just pure, fast, native performance.
Unlike web-based alternatives, this app is built entirely in Swift and SwiftUI, optimized specifically for macOS. It's lightweight (~15MB), blazing fast, and integrates seamlessly with your Mac workflow.
- β‘ Lightning-fast performance β Native SwiftUI rendering, no browser overhead
- π― Instant access β Summon Grok from anywhere with a global hotkey (ββ§G)
- π Deep Mac integration β Works with your existing Mac apps and workflows
- πΎ Local data β Your conversations stay on your machine, not in the cloud
- π¨ Native experience β Feels like a Mac app because it is a Mac app
- βοΈ System-level features β Menu bar icon, keyboard shortcuts, Spotlight-style access
β οΈ Note: This is an unofficial, community-built app. Grok is a product of xAI. You'll need your own xAI API key to use this app.
Access all available Grok models through the xAI API:
| Model | Best For | Context Window |
|---|---|---|
| Grok 4 | Complex reasoning, analysis | 256K tokens |
| Grok 4.1 Fast | Speed + quality balance | 2M tokens |
| Grok 3 | General purpose | 131K tokens |
| Grok 3 Mini | Quick responses, cost-effective | 131K tokens |
| Grok 2 Vision | Image analysis | 128K tokens |
| Grok Code | Programming assistance | 128K tokens |
Summon Grok from anywhere on your Mac instantly:
- ββ§G (Command+Shift+G) β Default hotkey
- Fully customizable β Set your own: Option+Space, Control+Space, Option+G, or any combination
- Works from any app β Summon Grok without switching windows
- Spotlight-style access β Quick input window appears instantly
| Mode | Description | Best For |
|---|---|---|
| π Mode | Dedicated X/Twitter integration | Your profile, feed interaction, and social media workflows |
| Grok Mode | Native SuperGrok access | General AI assistance without browser overhead |
| π¨βπ» Code Mode | Agentic coding assistant | Creating files, writing code, modifying files locally on your Mac |
| π Grokipedia | Research & knowledge base | Deep research, fact-checking, and knowledge exploration |
Unique workflow feature β Seamlessly move content between modes:
- Transfer to Code button β Located to the right of the refresh button
- Select text from Chat/Grok modes and transfer to Code mode
- Use cases:
- Clone repositories and work with local files
- Feed research content into local development workflows
- Create and modify files directly on your Mac
- Combine AI reasoning with local file operations
A powerful chat interface designed for developers:
- Markdown rendering with full syntax highlighting
- Code blocks with copy button and language detection
- Conversation history β saved locally, searchable, exportable
- Multi-turn conversations with full context preservation
- Transfer to Code β Move content to Code mode for local file operations
Your data stays on your machine:
- API key stored in macOS Keychain β Not in plain text
- No telemetry or tracking β We don't collect any data
- Local conversation history β Nothing leaves your Mac
- Safety Mode β Optional protection against destructive commands
Stay on top of your API usage:
- Real-time token counting β Input and output tokens
- Cost estimation β Based on current xAI pricing
- Context window indicator β Know when you're approaching limits
- Per-model pricing β Automatically calculated
Built for Mac, not ported:
- Native SwiftUI interface β Feels right at home on macOS
- Dark/Light mode β Follows system appearance
- Menu bar icon β Quick access without opening the full app
- Auto-updates β Sparkle framework keeps you current
- Keyboard shortcuts β Full macOS keyboard navigation
- Download the latest
Grok-X.X.X.dmgfrom Releases - Open the DMG file
- Drag Grok.app to your Applications folder
- Launch Grok from Applications
First Launch: macOS may show a security warning. Right-click the app β Open β Open to bypass Gatekeeper.
See Build from Source below.
- Go to console.x.ai
- Sign in with your xAI/X account
- Create a new API key
- Copy the key (starts with
xai-...)
- Launch Grok for Mac
- Open Settings (β,)
- Go to the Grok Code tab
- Paste your API key
- (Optional) Customize your global hotkey
- Close Settings β you're ready!
Choose your mode based on your workflow:
- π― Quick Access β Press ββ§G to summon Grok from anywhere
- π Mode β Access your X/Twitter profile and feed
- Grok Mode β General AI assistance and SuperGrok features
- π¨βπ» Code Mode β Agentic coding with local file operations
- π Grokipedia β Research and knowledge base queries
Pro Tip: Use the Transfer to Code button to move content between modes and work with local files!
| Action | Shortcut |
|---|---|
| Global Hotkey | ββ§G (customizable) |
| Settings | β, |
| New Chat | βN |
| Close Window | βW |
| Minimize | βM |
| Quit | βQ |
| Copy | βC |
| Paste | βV |
| Select All | βA |
| Back | β[ |
| Forward | β] |
| Reload | βR |
Access Settings via β, or the menu bar.
| Setting | Description |
|---|---|
| Launch at Login | Start Grok when you log in |
| Show in Menu Bar | Display icon in menu bar for quick access |
| Auto-check for Updates | Keep the app up to date automatically |
| Global Shortcut | Choose your preferred hotkey |
| Setting | Description |
|---|---|
| API Key | Your xAI API key (stored in Keychain) |
| Safety Mode | Block potentially destructive commands |
| Chat Retention | How long to keep chat history (Forever/7 days/30 days) |
| Model Selection | Choose your preferred Grok model for Code mode |
- macOS 14.0 (Sonoma) or later
- Xcode 15.0 or later
- Swift 5.9 or later
- An xAI API key
# Clone the repository
git clone https://github.com/bcharleson/xai-grok.git
cd xai-grok
# Open in Xcode
cd GrokChat
open GrokApp.xcodeprojThen in Xcode:
- Select the Grok scheme
- Choose My Mac as the destination
- Press βR to build and run
cd GrokChat
# Build release version
xcodebuild -project GrokApp.xcodeproj \
-scheme Grok \
-configuration Release \
build
# Find the built app
open ~/Library/Developer/Xcode/DerivedData/*/Build/Products/Release/# Use the included build script
./build-dmg.shxai-grok/
βββ GrokChat/ # Main app directory
β βββ Sources/
β β βββ AppDelegate.swift # App lifecycle, window management
β β βββ DeveloperRootView.swift # Developer chat UI (SwiftUI)
β β βββ SettingsWindow.swift # Settings panel
β β βββ InputWindow.swift # Quick input window
β β βββ Managers/
β β β βββ HotKeyManager.swift # Global hotkey handling
β β β βββ UpdateManager.swift # Sparkle auto-updates
β β βββ Utils/
β β βββ KeychainHelper.swift # Secure credential storage
β βββ Tests/
β β βββ GrokChatTests.swift # Unit tests
β βββ GrokApp.xcodeproj/ # Xcode project
β βββ Package.swift # Swift Package Manager
β βββ Info.plist # App configuration
β βββ appcast.xml # Sparkle update feed
β βββ bin/ # Sparkle tools
β βββ build.sh # Build script
β βββ build-dmg.sh # DMG creation script
β βββ release.sh # Release automation
βββ .github/
β βββ PULL_REQUEST_TEMPLATE.md
βββ logo/ # App icons and branding
βββ LICENSE # MIT License
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guidelines
| Component | Technology |
|---|---|
| Language | Swift 5.9+ |
| UI Framework | SwiftUI + AppKit |
| Minimum macOS | 14.0 (Sonoma) |
| API Communication | URLSession with streaming support (SSE) |
| Credential Storage | macOS Keychain |
| Preferences | UserDefaults |
| Auto-Updates | Sparkle 2.x |
| Markdown Rendering | AttributedString + custom parser |
| Code Highlighting | Custom Swift syntax highlighter |
| Global Hotkeys | HotKey framework |
The Code Mode is a powerful agentic assistant designed for developers:
- Create files β Generate new files directly on your Mac
- Write code β Full code generation with syntax highlighting
- Modify files β Edit existing files with AI assistance
- Local operations β All file operations happen on your machine
- Repository integration β Clone repos and work with local projects
- Transfer content β Move research from other modes into Code mode
The app communicates directly with the xAI API:
- Endpoint:
https://api.x.ai/v1/chat/completions - Streaming: Server-Sent Events (SSE) for real-time responses
- Models: Fetched dynamically from
/v1/models - Pricing: Automatically calculated per model
- Authentication: API key stored securely in macOS Keychain
We welcome contributions! Whether it's bug fixes, new features, or documentation improvements.
- Fork the repository
- Clone your fork locally
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test thoroughly
- Commit (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Swift style conventions
- Add tests for new functionality
- Update documentation as needed
- Keep commits focused and atomic
See CONTRIBUTING.md for detailed guidelines.
Right-click the app β Open β Open. This bypasses Gatekeeper for this app.
- Ensure your key starts with
xai- - Check that you have API credits at console.x.ai
- Try regenerating your API key
- Check System Settings β Privacy & Security β Accessibility
- Ensure Grok has permission to control your computer
- Try a different hotkey combination in Settings
- Use "Clear All Chats" in Settings to remove old conversations
- Set a retention policy (7 or 30 days) to auto-delete old chats
This project is licensed under the MIT License β see LICENSE for details.
MIT License
Copyright (c) 2025 Brandon Charleson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...
Brandon Charleson β Creator & Maintainer
- xAI β For creating Grok and providing the API
- Sparkle β For the excellent auto-update framework
- HotKey β For global hotkey support
- Community Contributors β Thank you for making this project better!
This is an unofficial, community-built application.
- Grok is a product of xAI
- This project is not affiliated with, endorsed by, or sponsored by xAI
- You are responsible for your own API usage and costs
- Use at your own risk
β Star Β· π Report Bug Β· π‘ Request Feature Β· π΄ Fork
Made with β€οΈ for the Mac community