CopilotForXcode
The first GitHub Copilot, Codeium and ChatGPT Xcode Source Editor Extension
Install / Use
/learn @intitni/CopilotForXcodeQuality Score
Category
Development & EngineeringSupported Platforms
README
Copilot for Xcode <img alt="Logo" src="/AppIcon.png" align="right" height="50">

Copilot for Xcode is an Xcode Source Editor Extension that provides GitHub Copilot, Codeium and ChatGPT support for Xcode.
<a href="https://www.buymeacoffee.com/intitni" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
Features
- Code Suggestions
- Chat
- Modification
- Custom Commands to extend Chat and Modification.
Table of Contents
- Copilot for Xcode
For development instruction, check Development.md.
For more information, check the Wiki Page.
Prerequisites
- Public network connection.
For suggestion features:
- For GitHub Copilot users:
- Node installed to run the Copilot LSP.
- Active GitHub Copilot subscription.
- For Codeium users:
- Active Codeium account.
- Access to other LLMs.
For chat and prompt to code features:
- A valid OpenAI API key.
- Access to other LLMs.
Permissions Required
- Folder Access
- Accessibility API
If you are concerned about key logging and cannot trust the binary, we recommend examining the code and building it yourself. To address any concerns, you can specifically search for
CGEvent.tapCreate,AXObserver,AX___within the code.
Installation and Setup
The installation process is a bit complicated. Here is a quick overview:
- Install the app into the Applications folder, open it once.
- Enable the source editor extension.
- Grant Accessibility API permission to the extension app.
- Setup accounts and models in the host app.
- Optionally, update the settings of each feature in the host app, and setup keybindings.
Install
You can install it via Homebrew:
brew install --cask copilot-for-xcode
Or install it manually, by downloading the Copilot for Xcode.app from the latest release.
Please make sure the app is inside the Applications folder.
Open the app, the app will create a launch agent to setup a background running Service that does the real job.
Enable the Extension
Enable the extension in System Settings.app.
macOS 15
From the Apple menu located in the top-left corner of your screen click System Settings. Navigate to General then Login Items & Extensions. Click Xcode Source Editor and tick Copilot for Xcode.
MacOS 14
From the Apple menu located in the top-left corner of your screen click System Settings. Navigate to Privacy & Security then toward the bottom click Extensions. Click Xcode Source Editor and tick Copilot.
Older Versions
If you are using macOS Monterey, enter the Extensions menu in System Preferences.app with its dedicated icon.
Granting Permissions to the App
The first time the app is open and command run, the extension will ask for the necessary permissions.
Alternatively, you may manually grant the required permissions by navigating to the Privacy & Security tab in the System Settings.app.
- To grant permissions for the Accessibility API, click
Accessibility, and dragCopilotForXcodeExtensionService.appto the list. You can locate the extension app by clickingReveal Extension App in Finderin the host app.
If you encounter an alert requesting permission that you have previously granted, please remove the permission from the list and add it again to re-grant the necessary permissions.
Setting Up Key Bindings
The extension will work better if you use key bindings.
It looks like there is no way to add default key bindings to commands, but you can set them up in Xcode settings > Key Bindings. You can filter the list by typing copilot in the search bar.
A recommended setup that should cause no conflict is
| Command | Key Binding |
| ------------------- | ------------------------------------------------------ |
| Accept Suggestions | ⌥} or Tab |
| Dismiss Suggestions | Esc |
| Reject Suggestion | ⌥{ |
| Next Suggestion | ⌥> |
| Previous Suggestion | ⌥< |
| Open Chat | ⌥" |
| Explain Selection | ⌥\| |
Essentially using ⌥⇧ as the "access" key combination for all bindings.
Another convenient method to access commands is by using the ⇧⌘/ shortcut to search for a command in the menu bar.
Setting Up Global Hotkeys
Currently, there is only one global hotkey you can set to show/hide the widgets under the General tab from the host app.
When this hotkey is not set to enabled globally, it will only work when the service app or Xcode is active.
Setting Up Suggestion Feature
Setting Up GitHub Copilot
-
In the host app, navigate to "Service - GitHub Copilot" to access your GitHub Copilot account settings.
-
Click on "Install" to install the language server.
-
Optionally, set up the path to Node. The default value is simply
node. Copilot for Xcode.app will attempt to locate Node from the following directories:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.If your Node installation is located elsewhere, you can run
which nodefrom the terminal to obtain the correct path.If you are using a node version manager that provides a shim executable, you will need to find the path to the actual executable. Please refer to the FAQ for more information.
-
Click on "Sign In", and you will be redirected to a verification website provided by GitHub. A user code will be copied to your clipboard.
-
After signing in, return to the app and click on "Confirm Sign-in" to complete the process.
-
Go to "Feature - Suggestion" and update the feature provider to "GitHub Copilot".
The installed language server is located at ~/Library/Application Support/com.intii.CopilotForXcode/GitHub Copilot/executable/.
Setting Up Codeium
- In the host app, navigate to "Service - Codeium" to access the Codeium account settings.
- Click on "Install" to install the language server.
- Click on "Sign In" and you will be redirected to codeium.com. After signing in, a token will be provided. You need to copy and paste this token back into the app to complete the sign-in process.
- Go to "Feature - Suggestion" and update the feature provider to "Codeium".
The key is stored in the keychain. When the helper app tries to access the key for the first time, it will prompt you to enter the password to access the keychain. Please select "Always Allow" to let the helper app access the key.
The installed language server is located at ~/Library/Application Support/com.intii.CopilotForXcode/Codeium/executable/.
Setting Up Chat Feature
- In the host app, navigate to "Service - Chat Model".
- Update the OpenAI model or create a new one if necessary. Use the test button to verify the model.
- Optionally, set up the embedding model in "Service - Embedding Model", which is required for a subset of the chat feature.
- Go to "Feature - Chat" and update the chat/embedding feature provider with the one you just updated/created.
Managing CopilotForXcodeExtensionService.app
This app runs whenever you open Copilot for Xcode.app or Xcode.app. You can quit it with its menu bar item that looks like a tentacle.
You can also set it to quit automatically when the above 2 apps are closed.
Update
You can use the in-app updater or download the latest version manually from the latest release.
After updating, please open Copilot for Xcode.app once and restart Xcode to allow the extension to reload.
If you find that some of the features are no longer working, please first try regranting permissions to the app.
Feature
Files in gitignore will not receive suggestion. Both chat and prompt to code feature will not have access to them unless you manually select code from them.
