Skip to content

bookingcom/xcody

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Xcody Logo

AI-powered coding assistant for Xcode, powered by Sourcegraph Cody.

Xcody brings real-time code suggestions, AI chat, and prompt-based code commands to the Xcode IDE, making Swift development faster, smarter, and more intuitive.

🚧 Xcody is under active development.


✨ Features

  • 🧠 AI Code Completions – Powered by Sourcegraph Cody
  • πŸ’¬ In-Editor Chat – Ask questions about your code without leaving Xcode
  • ⚑ Prompt Commands – Generate docs, explain code, or run custom tasks on selected text
  • πŸ› οΈ Native Integration – Built using Swift + XcodeKit for a seamless IDE experience

πŸš€ Getting Started

πŸ“Œ Note: Xcody requires access to a Cody-compatible API. This typically requires an enterprise contract with Sourcegraph.

Prerequisites

Installation

Installation and Setup

  1. Download the latest release or export from code
  2. Drag Xcody to your Applications folder
  3. Launch Xcody and follow the setup instructions
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.

Install

Install it manually, by downloading the Xcody.app from the latest release.

Unzip and move the app to the Applications folder BEFORE running it.

Open the app, the app will create a launch agent to setup a background running Service that does the real job.

Granting Permissions

The first time the app is open and command run, the extension will ask for the Accessibility permission.

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

You may also need to give permissions for Allow in Background and Xcode Source Editor. Check these under Settings > General > Login Items & Extensions, under Allow in Background and Extensions > Xcode Source Editorrespectively. You can use the Extensions Settings button in the Xcody app to open Settings.

Allow in Background

Xcode Source Editor

Setting Up Xcody
  1. Go to Service > Chat Models > Add Model. Fill a custom name and select a Model Name from the dropdown. Then input your Cody API Key. Select the API Key you input. Tap Test button to validate integration.
  2. Go to Service > Cody > Cody Language Server and tap Install.
  3. Go to Features > Suggestion and check Real-time suggestion
  4. Feel free to explore XCody's settings
  5. You can now boot Xcode and use the extension.
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 Xcody 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.

Uninstalling
  1. Get admin privileges (e.g., sudo or Privileges app)
  2. Delete Xcody.app from the Applications folder;
  3. Remove XcodyExtensionService.app from Accessibility settings;
  4. Run sfltool resetbtm in Terminal;
  5. Reboot.

Features

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.

Chat

The chat knows the following information:

  • The selected code in the active editor.
  • The relative path of the file.
  • The error and warning labels in the active editor.
  • The text cursor location.
Commands
  • Open Chat: Open a chat tab.
Keyboard Shortcuts
Shortcut Description
⌘W Close the chat tab.
⌘M Minimize the chat, you can bring it back with any chat commands or by clicking the circular widget.
β‡§β†©οΈŽ Add new line.
β‡§βŒ˜] Move to next tab
β‡§βŒ˜[ Move to previous tab

Prompt to Code

Refactor existing code or write new code using natural language.

This feature is recommended when you need to update a specific piece of code. Some example use cases include:

  • Improving the code's readability.
  • Correcting bugs in the code.
  • Adding documentation to the code.
  • Breaking a large function into smaller functions.
  • Generating code with a specific template through custom commands.
  • Polishing and correcting grammar and spelling errors in the documentation.
  • Translating a localizable strings file.
Commands
  • Write or Modify Code: Open a modification window, where you can use natural language to write or edit selected code.
  • Accept Modification: Accept the result of modification.

Custom Commands

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

  • 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.
  • Send Message: Open the chat window and immediately send a message, if provided. You can provide more information through the extra system prompt field.
  • 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.
  • Single Round Dialog: Send a message to a temporary chat. Useful when you want to run a terminal command with /run.

You can use the following template arguments in custom commands:

Argument Description
{{selected_code}} The currently selected code in the editor.
{{active_editor_language}} The programming language of the active editor.
{{active_editor_file_url}} The URL of the active file in the editor.
{{active_editor_file_name}} The name of the active file in the editor.
{{clipboard}} The content in clipboard.

🧭 Project Vision

Our long-term vision is for Xcody to become a fully agentic assistant for Xcodeβ€”able to intelligently and autonomously assist with software development under your guidance.

Read more in VISION.md.

πŸ§‘β€πŸ’» Contributing

We welcome contributions from the community!

πŸ“Œ Limitations

Xcody currently does not support:

  • Remote codebase indexing
  • Chat history or persistent memory
  • Saving custom prompts to the cloud
  • Public API use (enterprise Cody backend required)

πŸ“… Roadmap

See our current plans in VISION.md. Major upcoming features:

  • 🚧 Replace custom chat with Cody Agent
  • 🧠 Support multi-step autonomous workflows
  • βš™οΈ Add prompt workflow editor
  • πŸ“Ž Deep integrations with Instruments, Simulator, etc.

πŸ“„ License

Xcody is released under the MIT License.

Acknowledgements

  • Xcody is a fork of Copilot for Xcode. We are thankful to the source project for enabling us to hit the ground running.
  • This software was originally developed at Booking.com. With approval from Booking.com, this software was released as open source, for which the authors would like to express their gratitude.
  • The Swift logo is a trademark of Apple Inc.

Built with ❀️ by developers who want Cody in Xcode.

About

Xcode Extension that enables Cody AI Agent in Xcode

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages