Giter Club home page Giter Club logo

codeiumforxcode's Introduction

Codeium for Xcode Logo

Codeium for Xcode is a fork of Copilot for Xcode that exposes only the features supported by Codeium.

If you have any trouble using the app, please open an issue at https://github.com/intitni/CopilotForXcode/issues.

Buy Me A Coffee

Features

  • Code Suggestions.

Table of Contents

For frequently asked questions, check FAQ.

For development instruction, check Development.md.

For more information, check the wiki

Prerequisites

  • Public network connection.
  • Active Codeium account.

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

Install

You can install it manually, by downloading the Codeium for Xcode.app from the latest release, and extract it to 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.

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.

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 drag CopilotForXcodeExtensionService.app to the list. You can locate the extension app by clicking Reveal Extension App in Finder in the host app.

Accessibility API

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 ⌥}
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 Codeium

  1. In the host app, switch to the service tab and click Codeium to access the Codeium account settings.
  2. Click "Install" to install the language server.
  3. Click "Sign In", and you will be directed to codeium.com. After signing in, a token will be presented. You will need to paste the token back to the app to finish signing in.
  4. 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.CodeiumForXcode/Codeium/executable/.

Managing CopilotForXcodeExtensionService.app

This app runs whenever you open Codeium for Xcode.app or Xcode.app. You can quit it with its menu bar item that looks like a steering wheel.

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 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

Suggestion

The app can provide real-time code suggestions based on the files you have opened.

The feature provides two presentation modes:

  • Nearby Text Cursor: This mode shows suggestions based on the position of the text cursor.
  • Floating Widget: This mode shows suggestions next to the circular widget.

When using the "Nearby Text Cursor" mode, it is recommended to set the real-time suggestion debounce to 0.1.

If 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.

Whenever your code is updated, the app will automatically fetch suggestions for you, you can cancel this by pressing Escape.

*: 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.

Commands

  • Get Suggestions: Get suggestions for the editing file at the current cursor position.
  • Next Suggestion: If there is more than one suggestion, switch to the next one.
  • Previous Suggestion: If there is more than one suggestion, switch to the previous one.
  • Accept Suggestion: Add the suggestion to the code.
  • Reject Suggestion: Remove the suggestion comments.
  • Prefetch Suggestions: Call only by Codeium for Xcode. In the background, Codeium for Xcode will occasionally run this command to prefetch real-time suggestions.
  • Real-time Suggestions: Call only by Codeium for Xcode. When suggestions are successfully fetched, Copilot for Xcode will run this command to present the suggestions.

Limitations

  • The extension uses some dirty tricks to get the file and project/workspace paths. 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.

License

Please check LICENSE for details.

codeiumforxcode's People

Contributors

ast3150 avatar eltociear avatar intitni avatar snq-2001 avatar ss18 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.