Skip to content

Latest commit

 

History

History
202 lines (128 loc) · 6.83 KB

File metadata and controls

202 lines (128 loc) · 6.83 KB

GitHub Copilot for Xcode

GitHub Copilot is an AI pair programmer that helps you write code faster and smarter. Copilot for Xcode is an Xcode extension that provides inline coding suggestions as you type and a chat assistant to answer your coding questions.


Table of Contents


Features

Chat

GitHub Copilot Chat provides suggestions for your specific coding tasks via a conversational interface.

Animated screenshot showing Copilot Chat in Xcode

Code Completion

Receive AI-powered auto-complete suggestions from GitHub Copilot by starting to write code or by describing your intent in a natural language comment.

Animated screenshot showing code completion suggestions


Requirements


Quick Start

  1. Install via Homebrew:

    brew install --cask github-copilot-for-xcode

    Or download the .dmg from the latest release and drag GitHub Copilot for Xcode into your Applications folder.

  2. Open the app and accept any security warnings.

  3. Grant permissions (Background, Accessibility, and Xcode Source Editor Extension) when prompted.

  4. Enable the extension in System Preferences > Extensions > Xcode Source Editor.

  5. Open Xcode and verify the GitHub Copilot menu under the Xcode Editor menu.

  6. Sign in to GitHub Copilot via the app settings.


Getting Started

1. Installation

  • Install via Homebrew, or

  • Download the .dmg from the latest release and drag it into your Applications folder.

    Screenshot: Opened dmg

  • Updates can be downloaded and installed by the app.

2. Running the Application

  • Open GitHub Copilot for Xcode from Applications.

  • Accept the security warning. Screenshot: macOS download permission request

  • A background item will be added automatically. Screenshot: Background item

3. Permissions

  • Three permissions are required: Background, Accessibility, and Xcode Source Editor Extension.

  • The first time the app runs, you will be prompted for Accessibility permission: Screenshot: Accessibility permission request

  • Enable the Xcode Source Editor Extension manually:

    • Click Extension Permission from the app settings.
    • Go to System Preferences > Extensions > Xcode Source Editor, and enable GitHub Copilot. Screenshot: Extension permission

4. Enabling in Xcode

  • Open Xcode and make sure the GitHub Copilot menu is available and enabled under the Xcode Editor menu. Screenshot: Xcode Editor GitHub Copilot menu item

  • Keyboard shortcuts can be set for all menu items in Xcode preferences under Key Bindings.

5. Signing In

  • Click Sign in in the app settings.
  • A browser window will open and a code will be copied to your clipboard. Paste the code into the GitHub login page. Screenshot: Sign-in popup

6. Updating

  • To install updates, click Check for Updates in the menu or app settings.
  • After updating, restart Xcode for the changes to take effect.
  • New versions can also be installed via .dmg from the releases page.

7. Xcode Preferences

Note: To avoid conflicts, disable Predictive code completion: Xcode > Preferences > Text Editing > Editing

8. Using Suggestions

  • Press Tab to accept the first line of a suggestion.
  • Hold Option to view the full suggestion.
  • Press Option + Tab to accept the full suggestion. Screenshot: Welcome screen

How to Use Chat

  • Open Copilot Chat in Xcode via:
    • Xcode → Editor → GitHub Copilot → Open Chat Screenshot: Xcode Editor GitHub Copilot menu item
    • Or via the GitHub Copilot app menu → Open Chat Screenshot: GitHub Copilot menu item

How to Use Code Completion

  • Press Tab to accept the first line of a suggestion.
  • Hold Option to view the full suggestion.
  • Press Option + Tab to accept the full suggestion.

Keyboard Shortcuts

Action Shortcut
Accept first line of suggestion Tab
View full suggestion Option
Accept full suggestion Option + Tab
Open Copilot Chat Customize in Xcode

Set your own shortcuts in Xcode > Preferences > Key Bindings.


Troubleshooting

  • Copilot menu not showing in Xcode?

    • Make sure the Source Editor Extension is enabled in System Preferences > Extensions.
    • Restart Xcode after enabling the extension.
  • Permission issues?

    • Confirm that Accessibility and Background permissions are enabled in System Preferences.
  • Problems signing in?

    • Ensure you’re using the latest version of the app.
    • Try re-signing in via the app settings.

For more help, visit our Feedback forum.


License

This project is licensed under the MIT open source license. See LICENSE.txt for details.


Privacy

We follow responsible practices in accordance with our Privacy Statement.

To get the latest security fixes, please use the latest version of GitHub Copilot for Xcode.


Support

We welcome your feedback to make GitHub Copilot better! If you have feedback or encounter problems, please reach out on our Feedback forum.


Acknowledgements

Thank you to @intitni for creating the original project this is based on.

Attributions can be found under "About" in the app or in Credits.rtf.