{"id":13643321,"url":"https://github.com/intitni/copilotforxcode","last_synced_at":"2025-05-13T00:30:21.662Z","repository":{"id":64508130,"uuid":"574578825","full_name":"intitni/CopilotForXcode","owner":"intitni","description":"The missing GitHub Copilot, Codeium and ChatGPT Xcode Source Editor Extension","archived":false,"fork":false,"pushed_at":"2024-10-28T13:48:59.000Z","size":14219,"stargazers_count":7698,"open_issues_count":35,"forks_count":377,"subscribers_count":78,"default_branch":"main","last_synced_at":"2024-10-29T09:18:26.628Z","etag":null,"topics":["chat","chatgpt","code-completion","code-generation","codeium","copilot","github-copilot","githubcopilot","macos","openai","tabby","xcode","xcode-extension","xcode-extensions"],"latest_commit_sha":null,"homepage":"https://copilotforxcode.intii.com","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intitni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://intii.lemonsqueezy.com","https://www.buymeacoffee.com/intitni"]}},"created_at":"2022-12-05T16:08:32.000Z","updated_at":"2024-10-29T04:14:49.000Z","dependencies_parsed_at":"2023-10-04T13:22:28.295Z","dependency_job_id":"b02b66ee-ad71-4f5d-ad03-9cbb86248f86","html_url":"https://github.com/intitni/CopilotForXcode","commit_stats":{"total_commits":2536,"total_committers":11,"mean_commits":"230.54545454545453","dds":"0.016955835962145116","last_synced_commit":"41913616673f7b4d2043c2e42a40aa77519f53af"},"previous_names":[],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intitni%2FCopilotForXcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intitni%2FCopilotForXcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intitni%2FCopilotForXcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intitni%2FCopilotForXcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intitni","download_url":"https://codeload.github.com/intitni/CopilotForXcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250494456,"owners_count":21439996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","chatgpt","code-completion","code-generation","codeium","copilot","github-copilot","githubcopilot","macos","openai","tabby","xcode","xcode-extension","xcode-extensions"],"created_at":"2024-08-02T01:01:45.816Z","updated_at":"2025-04-23T18:44:18.846Z","avatar_url":"https://github.com/intitni.png","language":"Swift","readme":"# Copilot for Xcode \u003cimg alt=\"Logo\" src=\"/AppIcon.png\" align=\"right\" height=\"50\"\u003e\n\n![Screenshot](/Screenshot.png)\n\nCopilot for Xcode is an Xcode Source Editor Extension that provides GitHub Copilot, Codeium and ChatGPT support for Xcode.\n\n\u003ca href=\"https://www.buymeacoffee.com/intitni\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n## Features\n\n- Code Suggestions\n- Chat\n- Modification\n- Custom Commands to extend Chat and Modification.\n\n## Table of Contents\n\n- [Copilot for Xcode ](#copilot-for-xcode-)\n  - [Features](#features)\n  - [Table of Contents](#table-of-contents)\n  - [Prerequisites](#prerequisites)\n  - [Permissions Required](#permissions-required)\n  - [Installation and Setup](#installation-and-setup)\n    - [Install](#install)\n    - [Enable the Extension](#enable-the-extension)\n      - [macOS 15](#macos-15)\n      - [MacOS 14](#macos-14)\n      - [Older Versions](#older-versions)\n    - [Granting Permissions to the App](#granting-permissions-to-the-app)\n    - [Setting Up Key Bindings](#setting-up-key-bindings)\n      - [Setting Up Global Hotkeys](#setting-up-global-hotkeys)\n    - [Setting Up Suggestion Feature](#setting-up-suggestion-feature)\n      - [Setting Up GitHub Copilot](#setting-up-github-copilot)\n      - [Setting Up Codeium](#setting-up-codeium)\n    - [Setting Up Chat Feature](#setting-up-chat-feature)\n    - [Managing `CopilotForXcodeExtensionService.app`](#managing-copilotforxcodeextensionserviceapp)\n  - [Update](#update)\n  - [Feature](#feature)\n    - [Suggestion](#suggestion)\n      - [Commands](#commands)\n    - [Chat](#chat)\n      - [Commands](#commands-1)\n      - [Keyboard Shortcuts](#keyboard-shortcuts)\n      - [Chat Commands](#chat-commands)\n    - [Prompt to Code](#prompt-to-code)\n      - [Commands](#commands-2)\n    - [Custom Commands](#custom-commands)\n  - [Limitations](#limitations)\n  - [License](#license)\n\nFor development instruction, check [Development.md](DEVELOPMENT.md).\n\nFor more information, check the [Wiki Page](https://copilotforxcode.intii.com/wiki).\n\n## Prerequisites\n\n- Public network connection.\n\nFor suggestion features:\n\n- For GitHub Copilot users:\n  - [Node](https://nodejs.org/) installed to run the Copilot LSP.\n  - Active GitHub Copilot subscription.\n- For Codeium users:\n  - Active Codeium account.\n- Access to other LLMs.\n\nFor chat and prompt to code features:\n\n- A valid OpenAI API key.\n- Access to other LLMs.\n\n## Permissions Required\n\n- Folder Access\n- Accessibility API\n\n\u003e If you are concerned about key logging and cannot trust the binary, we recommend examining the code and [building it yourself](DEVELOPMENT.md). To address any concerns, you can specifically search for `CGEvent.tapCreate`, `AXObserver`, `AX___` within the code.\n\n## Installation and Setup\n\n\u003e The installation process is a bit complicated. Here is a quick overview:\n\u003e \n\u003e 1. Install the app into the Applications folder, open it once.\n\u003e 2. Enable the source editor extension.\n\u003e 3. Grant Accessibility API permission to the extension app.\n\u003e 4. Setup accounts and models in the host app.\n\u003e 5. Optionally, update the settings of each feature in the host app, and setup keybindings.\n\n### Install\n\nYou can install it via [Homebrew](http://brew.sh/):\n\n```bash\nbrew install --cask copilot-for-xcode\n```\n\nOr install it manually, by downloading the `Copilot for Xcode.app` from the latest [release](https://github.com/intitni/CopilotForXcode/releases).\n\nPlease make sure the app is inside the Applications folder.\n\nOpen the app, the app will create a launch agent to setup a background running Service that does the real job.\n\n### Enable the Extension\n\nEnable the extension in `System Settings.app`.\n\n#### macOS 15\nFrom the Apple menu located in the top-left corner of your screen click `System Settings`. Navigate to `General` then `Login Items \u0026 Extensions`. Click `Xcode Source Editor` and tick `Copilot for Xcode`.\n\n#### MacOS 14\nFrom the Apple menu located in the top-left corner of your screen click `System Settings`. Navigate to `Privacy \u0026 Security` then toward the bottom click `Extensions`. Click `Xcode Source Editor` and tick `Copilot`.\n\n#### Older Versions\nIf you are using macOS Monterey, enter the `Extensions` menu in `System Preferences.app` with its dedicated icon.\n\n### Granting Permissions to the App\n\nThe first time the app is open and command run, the extension will ask for the necessary permissions.\n\nAlternatively, you may manually grant the required permissions by navigating to the `Privacy \u0026 Security` tab in the `System Settings.app`.\n\n- To grant permissions for the Accessibility API, click `Accessibility`, and drag `CopilotForXcodeExtensionService.app` to the list. You can locate the extension app by clicking `Reveal Extension App in Finder` in the host app.\n\n\u003cimg alt=\"Accessibility API\" src=\"/accessibility_api_permission.png\" width=\"500px\"\u003e\n\nIf 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.\n\n### Setting Up Key Bindings\n\nThe extension will work better if you use key bindings.\n\nIt looks like there is no way to add default key bindings to commands, but you can set them up in `Xcode settings \u003e Key Bindings`. You can filter the list by typing `copilot` in the search bar.\n\nA [recommended setup](https://github.com/intitni/CopilotForXcode/issues/14) that should cause no conflict is\n\n| Command             | Key Binding                                            |\n| ------------------- | ------------------------------------------------------ |\n| Accept Suggestions  | `⌥}` or Tab                                            |\n| Dismiss Suggestions | Esc                                                    |\n| Reject Suggestion   | `⌥{`                                                   |\n| Next Suggestion     | `⌥\u003e`                                                   |\n| Previous Suggestion | `⌥\u003c`                                                   |\n| Open Chat           | `⌥\"`                                                   |\n| Explain Selection   | `⌥\\|`                                                  |\n\nEssentially using `⌥⇧` as the \"access\" key combination for all bindings.\n\nAnother convenient method to access commands is by using the `⇧⌘/` shortcut to search for a command in the menu bar.\n\n#### Setting Up Global Hotkeys\n\nCurrently, there is only one global hotkey you can set to show/hide the widgets under the General tab from the host app.\n\nWhen this hotkey is not set to enabled globally, it will only work when the service app or Xcode is active.\n\n### Setting Up Suggestion Feature\n\n#### Setting Up GitHub Copilot\n\n1. In the host app, navigate to \"Service - GitHub Copilot\" to access your GitHub Copilot account settings.\n2. Click on \"Install\" to install the language server.\n3. 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`.\n\n   If your Node installation is located elsewhere, you can run `which node` from the terminal to obtain the correct path.\n\n   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.\n\n4. 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.\n5. After signing in, return to the app and click on \"Confirm Sign-in\" to complete the process.\n6. Go to \"Feature - Suggestion\" and update the feature provider to \"GitHub Copilot\".\n\nThe installed language server is located at `~/Library/Application Support/com.intii.CopilotForXcode/GitHub Copilot/executable/`.\n\n#### Setting Up Codeium\n\n1. In the host app, navigate to \"Service - Codeium\" to access the Codeium account settings.\n2. Click on \"Install\" to install the language server.\n3. 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.\n4. Go to \"Feature - Suggestion\" and update the feature provider to \"Codeium\".\n\n\u003e 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.\n\nThe installed language server is located at `~/Library/Application Support/com.intii.CopilotForXcode/Codeium/executable/`.\n\n### Setting Up Chat Feature\n\n1. In the host app, navigate to \"Service - Chat Model\".\n2. Update the OpenAI model or create a new one if necessary. Use the test button to verify the model.\n3. Optionally, set up the embedding model in \"Service - Embedding Model\", which is required for a subset of the chat feature.\n4. Go to \"Feature - Chat\" and update the chat/embedding feature provider with the one you just updated/created.\n\n### Managing `CopilotForXcodeExtensionService.app`\n\nThis 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.\n\nYou can also set it to quit automatically when the above 2 apps are closed.\n\n## Update\n\nYou can use the in-app updater or download the latest version manually from the latest [release](https://github.com/intitni/CopilotForXcode/releases).\n\nAfter updating, please open Copilot for Xcode.app once and restart Xcode to allow the extension to reload.\n\nIf you find that some of the features are no longer working, please first try regranting permissions to the app.\n\n## Feature\n\n\u003e 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.\n\n### Suggestion\n\nThe app can provide real-time code suggestions based on the files you have opened. It's powered by GitHub Copilot and Codeium.\n\nThe feature provides two presentation modes:\n\n- Nearby Text Cursor: This mode shows suggestions based on the position of the text cursor.\n- Floating Widget: This mode shows suggestions next to the circular widget.\n\nWhen using the \"Nearby Text Cursor\" mode, it is recommended to set the real-time suggestion debounce to 0.1.\n\nIf you're working on a company project and don't want the suggestion feature to be triggered, you can globally disable it and choose to enable it only for specific projects.\n\nWhenever your code is updated, the app will automatically fetch suggestions for you, you can cancel this by pressing **Escape**.\n\n\\*: If a file is already open before the helper app launches, you will need to switch to those files in order to send the open file notification.\n\n#### Commands\n\n- Get Suggestions: Get suggestions for the editing file at the current cursor position.\n- Next Suggestion: If there is more than one suggestion, switch to the next one.\n- Previous Suggestion: If there is more than one suggestion, switch to the previous one.\n- Accept Suggestion: Add the suggestion to the code.\n- Reject Suggestion: Remove the suggestion comments.\n\nCommands called by the app:\n\n- Prepare for Real-time Suggestions: Call only by Copilot for Xcode. When suggestions are successfully fetched, Copilot for Xcode will run this command to present the suggestions.\n- Prefetch Suggestions: Call only by Copilot for Xcode. In the background, Copilot for Xcode will occasionally run this command to prefetch real-time suggestions.\n\n### Chat\n\nThis feature is powered by ChatGPT. Please ensure that you have set up your OpenAI account before using it.\n\nThe chat knows the following information:\n\n- The selected code in the active editor.\n- The relative path of the file.\n- The error and warning labels in the active editor.\n- The text cursor location.\n\nThere are currently two tabs in the chat panel: one is available shared across Xcode, and the other is only available in the current file.\n\nYou can detach the chat panel by simply dragging it away. Once detached, the chat panel will remain visible even if Xcode is inactive. To re-attach it to the widget, click the message bubble button located next to the circular widget.\n\n#### Commands\n\n- Open Chat: Open a chat tab.\n\n#### Keyboard Shortcuts\n\n| Shortcut | Description                                                                                         |\n| :------: | --------------------------------------------------------------------------------------------------- |\n|   `⌘W`   | Close the chat tab.                                                                                 |\n|   `⌘M`   | Minimize the chat, you can bring it back with any chat commands or by clicking the circular widget. |\n|  `⇧↩︎`    | Add new line.                                                                                       |\n|  `⇧⌘]`   | Move to next tab                                                                                    |\n|  `⇧⌘[`   | Move to previous tab                                                                                |\n\n#### Chat Commands\n\nThe chat panel supports chat plugins that may not require an OpenAI API key. For example, if you need to use the `/run` plugin, you just type\n\n```\n/run echo hello\n```\n\nIf you need to end a plugin, you can just type\n\n```\n/exit\n```\n\n|        Command         | Description                                                                                                                               |\n| :--------------------: | ----------------------------------------------------------------------------------------------------------------------------------------- |\n|         `/run`         | Runs the command under the project root.                                                                                                  |\n|                        | Environment variable: \u003cbr\u003e- `PROJECT_ROOT` to get the project root. \u003cbr\u003e- `FILE_PATH` to get the editing file path.                       |\n|   `/shortcut(name)`    | Run a shortcut from the Shortcuts.app, and use the following message as the input.                                                        |\n|                        | If the message is empty, it will use the previous message as input. The output of the shortcut will be printed as a reply from the bot.   |\n\n### Prompt to Code\n\nRefactor existing code or write new code using natural language.\n\nThis feature is recommended when you need to update a specific piece of code. Some example use cases include:\n\n- Improving the code's readability.\n- Correcting bugs in the code.\n- Adding documentation to the code.\n- Breaking a large function into smaller functions.\n- Generating code with a specific template through custom commands.\n- Polishing and correcting grammar and spelling errors in the documentation.\n- Translating a localizable strings file.\n\n#### Commands\n\n- Write or Modify Code: Open a modification window, where you can use natural language to write or edit selected code.\n- Accept Modification: Accept the result of modification.\n\n### Custom Commands\n\nYou can create custom commands that run Chat and Modification with personalized prompts. These commands are easily accessible from both the Xcode menu bar and the context menu of the circular widget. There are 3 types of custom commands:\n\n- Modification: Run Modification with the selected code, and update or write the code using the given prompt, if provided. You can provide additional information through the extra system prompt field.\n- Send Message: Open the chat window and immediately send a message, if provided. You can provide more information through the extra system prompt field.\n- Custom Chat: Open the chat window and immediately send a message, if provided. You can overwrite the entire system prompt through the system prompt field.\n- Single Round Dialog: Send a message to a temporary chat. Useful when you want to run a terminal command with `/run`.\n\nYou can use the following template arguments in custom commands:\n\n| Argument                      | Description                                    |\n| ----------------------------- | ---------------------------------------------- |\n| `{{selected_code}}`           | The currently selected code in the editor.     |\n| `{{active_editor_language}}`  | The programming language of the active editor. |\n| `{{active_editor_file_url}}`  | The URL of the active file in the editor.      |\n| `{{active_editor_file_name}}` | The name of the active file in the editor.     |\n| `{{clipboard}}`               | The content in clipboard.                      |\n\n## Limitations\n\n- The extension utilizes various tricks to monitor the state of Xcode. It may fail, it may be incorrect, especially when you have multiple Xcode windows running, and maybe even worse when they are in different displays. I am not sure about that though.\n\n## License\n\nPlease check [LICENSE](LICENSE) for details.\n\n","funding_links":["https://intii.lemonsqueezy.com","https://www.buymeacoffee.com/intitni"],"categories":["Browser-extensions"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintitni%2Fcopilotforxcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintitni%2Fcopilotforxcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintitni%2Fcopilotforxcode/lists"}