Get up and running with CodeTunner in 5 minutes!
Before you begin, ensure you have:
- macOS 13.0 or later
- Xcode 15.0+ (from Mac App Store)
- Rust 1.70+
- Python 3.x (usually pre-installed on macOS)
- Node.js (optional, for JavaScript execution)
If you don't have Rust installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envVerify installation:
rustc --version
cargo --versioncd SX/codetunner-nativeChoose one or more AI providers and set up your API keys:
Option A: Environment Variables (Recommended)
# Add to your ~/.zshrc or ~/.bash_profile
export GEMINI_API_KEY="your-gemini-api-key-here"
export OPENAI_API_KEY="your-openai-api-key-here"
export ANTHROPIC_API_KEY="your-anthropic-api-key-here"
# Reload your shell
source ~/.zshrc # or source ~/.bash_profileOption B: .env File
cd backend
cat > .env << EOF
GEMINI_API_KEY=your-gemini-api-key-here
OPENAI_API_KEY=your-openai-api-key-here
ANTHROPIC_API_KEY=your-anthropic-api-key-here
EOF
cd ..Getting API Keys:
- Gemini: https://makersuite.google.com/app/apikey
- OpenAI: https://platform.openai.com/api-keys
- Claude: https://console.anthropic.com/account/keys
cd backend
cargo build --releaseThis may take a few minutes on the first build as it downloads and compiles dependencies.
cargo run --releaseYou should see:
INFO CodeTunner Backend v2.0.0
INFO Backend listening on 127.0.0.1:8080
Keep this terminal open!
Open a new terminal and navigate to the project root:
cd SX/codetunner-nativeCreate Xcode Project:
-
Open Xcode
-
File → New → Project
-
Select macOS → App
-
Configure:
- Product Name:
CodeTunner - Interface:
SwiftUI - Language:
Swift - Save in:
SX/codetunner-native/(root of the project)
- Product Name:
-
Add Source Files:
- Right-click on
CodeTunnergroup in Xcode - Add Files to "CodeTunner"...
- Select all
.swiftfiles fromCodeTunner/directory - Check "Copy items if needed"
- Create groups
- Right-click on
-
Project Settings:
- Select CodeTunner project
- General → Minimum Deployments: macOS 13.0
- Signing & Capabilities → Enable "Outgoing Connections (Client)"
- In Xcode, select the CodeTunner scheme
- Press ⌘R to build and run
The app should launch! 🎉
- Click "New File" or press ⌘N
- Start typing your code
- Press ⌘S to save
- Click "Open Folder" or press ⌘⇧O
- Select a folder containing code
- Browse files in the sidebar
- Open a Python or JavaScript file
- Press ⌘R to run
- See output in the console (press ⌘⌥J if not visible)
- Write or paste some code
- Press ⌘⌥R to refactor with AI
- Enter instructions like "Add error handling" or "Optimize this code"
- Press ⌘⌥E to get an AI explanation of your code
- Open a Git repository folder
- Press ⌘⌥G to show Git panel
- View changes, commit, push, and pull
- Increase: ⌘+
- Decrease: ⌘-
- Reset: ⌘0
- Sidebar: ⌘⌥B
- Console: ⌘⌥J
- Git Panel: ⌘⌥G
- Open Settings (⌘,)
- Go to AI tab
- Select your preferred provider
- Enter API key if not already set
Problem: Port 8080 already in use
# Find what's using port 8080
lsof -i :8080
# Kill the process
kill -9 <PID>Problem: Compilation errors
# Clean and rebuild
cd backend
cargo clean
cargo build --releaseProblem: Missing files
- Ensure all
.swiftfiles are added to the Xcode project - Check Build Phases → Compile Sources
Problem: API connection failed
- Verify backend is running on port 8080
- Check Console logs in Xcode
Problem: "API key not found"
- Verify environment variables are set
- Restart the backend after setting keys
- Check .env file exists and is correct
Problem: "Connection refused"
- Ensure backend server is running
- Check firewall settings
Problem: "python3 not found"
# Install Python if needed
brew install python3Problem: "node not found"
# Install Node.js
brew install nodeNow that you're up and running, explore these features:
- Code Analysis: Open any file and see real-time analysis
- Format Code: Press ⌘⌥I to auto-format
- Git Integration: Full Git workflow built-in
- Multiple Tabs: Open multiple files in tabs
- AI Assistance: Use AI to explain, refactor, or complete code
| Action | Shortcut |
|---|---|
| New File | ⌘N |
| Open File | ⌘O |
| Open Folder | ⌘⇧O |
| Save | ⌘S |
| Save As | ⌘⇧S |
| Run Code | ⌘R |
| Stop Execution | ⌘. |
| Format Code | ⌘⌥I |
| Refactor with AI | ⌘⌥R |
| Explain Code | ⌘⌥E |
| Toggle Sidebar | ⌘⌥B |
| Toggle Console | ⌘⌥J |
| Toggle Git Panel | ⌘⌥G |
| Git Commit | ⌘K |
| Git Push | ⌘⇧P |
| Git Pull | ⌘⌥P |
| Increase Font | ⌘+ |
| Decrease Font | ⌘- |
| Reset Font | ⌘0 |
- Keep Backend Running: Always keep the backend server running while using the app
- Use .env Files: Store API keys in .env for easy management
- Git Integration: Work directly with Git - no terminal needed
- Multiple AI Providers: Try different providers for different tasks
- Keyboard Shortcuts: Learn shortcuts to boost productivity
- Documentation: See README.md for full documentation
- Issues: Report bugs on GitHub
- Email: contact@aipreneur.club
- Community: Join our Discord (coming soon)
Congratulations! You're ready to use CodeTunner.
Happy coding! 🚀
Made with ❤️ by SPU AI CLUB