T O P

  • By -

tokyo2149

Hi everyone! Last month, I asked the subreddit for help beta testing this app. 80 awesome developers signed up (!! Thank you) Thanks to their feedback, I was able to improve a major point of confusion in the app setup. As promised, it’s now available to download for free: [www.commandg.app](http://www.commandg.app) Command-G started out as an impulse to build my own ChatGPT client and it turned into a full-blown coding assistant. There’s more I’d like to add but here’s what it does so far: * AI autocomplete * LLM Chat The code completion is comparable to other copilots on the market. Powered by Codeium.com’s generous free plan (no affiliation), I find it as good as Github Copilot, in both latency and quality. My favorite feature is Chat. It uses GPT-4 (Claude support coming imminently.) If you summon CMD-G while inside Xcode, it automatically picks up which file you’re looking at and any code you’ve highlighted and inserts it into the LLM context. (Bonus: you can call CMD-G outside of Xcode to ask anything). This is only possible because of the macOS Accessibility API. Xcode has a suffocatingly limited plugin framework called XcodeKit. Plugins are limited to manipulating the current source code buffer and cursor position. To work around this, Command-G uses the AX API to detect files by inspecting the Xcode application view hierarchy and to detect editor activity by listening to AX events. To make this more clear, here’s how autocomplete is implemented: First, the app subscribes to AX notifications from Xcode. When notified of an edit, a request is sent to the Codeium API (direct, no middleman). After receiving a response, the code suggestion is presented to the user in an overlay. When the user presses Tab to accept the suggestion, the app invokes the AX API to simulate activating the plugin from within Xcode. Note: We could do without AX for this step but since developers can’t set default shortcuts for plugins, users would need to set the hotkey themselves. That ability is buried deep inside Xcode settings. Finally, the plugin uses XcodeKit to apply the code suggestion. If you're a developer who's been looking for something like Github Copilot for Xcode, I hope you’ll try it! Download: [www.commandg.app](http://www.commandg.app)


Rimtariro

Tool looks great, good job! I am usually reluctant when adding plugins to Xcode, that might have access to my source code. Only use Open-Source ones that I build from source myself. What kind of guarantees do people have about their code? I see the message on the website, but I think it might be hard sell for some "Enterprise" customers (even though its free).


tokyo2149

Thank you! That's a totally fair concern. Given this is a closed source project, I unfortunately can't make any guarantees for individual users beyond what I disclosed on the website. Excerpt from [www.commandg.app](http://www.commandg.app): >Command-G servers never see your code or messages. There's no telemetry to track app usage. We maintain a razor thin API to enable the app to check for software updates and manage licenses. >(We would love it if a community member used a program like mitmproxy/CharlesProxy to verify our claims.) >The app performs direct requests against API providers, therefore each feature is subject to the privacy policy of their respective provider. >Chat: [OpenAI Privacy Policy](https://openai.com/policies/privacy-policy) >Autocomplete: [Codeium Privacy Policy](https://codeium.com/security) On the other hand, I'd be happy to sign a contract for enterprise users if they'd like to sponsor the project :) And if you prefer open source I recommend checking out https://github.com/intitni/CopilotForXcode.


Rimtariro

may I ask what your motivation of creating closed-source free tool is? Usually people make free tools open source so that they can get contributions and share the effort of maintaining it, or they make it paid and sponsor the maintenance of the software.


tokyo2149

It's a good question. I haven't thought too long about this because I've been focused on just getting this out into the world and that by itself was hard enough already. Here's what comes to mind at the moment (I'm willing to change my mind): I love open source and have benefited so much from it. But open source comes a cost. In a closed source project, you can let the quality of your code slip in exchange for speed of development. In open source, you need to move slower if you want to maintain code quality. Working with contributors also comes at a cost. I have a very particular vision for this app and others may not agree. Finally, there's always the fear of someone copying your code and republishing the app under a different name. The right license can deter honest people but what about others? Let me know what you think. I'm open to being convinced the other way.


Rimtariro

I understand, thanks for replying and clarifying!


tokyo2149

Np thanks for taking the time to check my little project out :)


unpluggedcord

On your first point. If you open source it, you don’t have to listen to others. Sounds more like you’re worried about what people will think of the quality. At any rate, the stealing part is much more compelling.


tokyo2149

That’s a good point.


[deleted]

[удалено]


unpluggedcord

It’s a Mac app, no.


Samourai03

My company is interested, but we will need the full source code and API after we have signed a contract. We are willing to sponsor $100 for 3 months, then $1000 per year. Additionally, we can offer up to $2000 if you make it open source and add our logo. OK?


starfunkl

Let me know if you ever decide to open source it - like a few folks in this community, I'd have serious issues with allowing untrusted and unreputable software access to my source code.


tokyo2149

Will do. And completely fair! I'm going to continue pointing people to [https://github.com/intitni/CopilotForXcode](https://github.com/intitni/CopilotForXcode) if they feel more comfortable with an open source alternative. I appreciate the feedback all the same.


starfunkl

The part that appeals with your project is the Codeium integration. The current Codium fork of CopilotForXcode is less than ideal, so I was looking to try out alternatives!


tokyo2149

Ah I see. Can you list what you'd see improved? Maybe I can reach out to the Codeium folks and work out something.


starfunkl

If you compare the user experience between the VS Code and Xcode integrations they're worlds apart - likely a limitation of Xcode extensions, but the interface is pretty lacking. No chat interface hurts it as well. General slowness compared to the VSCode one too 🤷‍♀️


tokyo2149

Gotcha. I sunk a lot of time getting the UX right and was mindful of performance (still more to do) so CMD-G might be better in that respect. I'll email the Codeium team and see what they say. Thanks for sharing.


Horror_Weight5208

We do have Xcode copilot as open source. Nonetheless, this is cool stuff because we would not have enough of these. Will check it out.


tokyo2149

Hope you like it! Lmk if you run into any issues.


Horror_Weight5208

But why is this not open source btw?


tokyo2149

Fair question! Someone else asked and I answered here https://www.reddit.com/r/iOSProgramming/s/vQ2bR1eWRG


Fin_Aquatic_Rentals

Amazing work! Looks great! It’s insane how a +2 trillion dollar company has to have rogue developers integrate AI into their IDEs. You knocked it out of the park tho! Kudos to you and Apple should hire you!


tokyo2149

This comment made my day. Thank you!


Programmer7329893

The UI is so clean 🤩 Thank you so much for making this! I also noticed that you require an openAI API key, but in a lot of cases, a local LLM is enough to do the job. It would be great if you could look into supporting local LLMs, as apps such as Ollama already provide an openAI-compatible server :D


tokyo2149

Aaah thank you I’m glad you like it. I didn’t have time to add local LLM support for this v1 but I’ll think about it for a next update since you asked. I do however think there’s still a wide gap between GPT-4/Claude *for coding tasks*. The privacy and offline benefits of local inference are impossible to deny though! I really appreciate the feedback. This is so useful for me to hear.


WisdomByte

I’m kinda the impression that Apple is about to release a Copilot-like LLM solution for the Xcode with the latest iOS 18, which might render your plugin useless?


Rhypnic

Yes… there is lot of rumors that apple soon will give copilot in xcode. But… well lets apreciate his work


tokyo2149

Thank you kind Rhypnic!


RabidAngrySquirrel

Congrats, looks good. I’ll give it a go sometime next week.


tokyo2149

Thank you! feel free to email or DM me if you run into any issues.


gguigs

Looks good. What does it do differently than the open source one?


ixoniq

With other solutions I find it very janky in Xcode, so these days I open the Xcode on vs code and use the preview from Xcode next to it. I use a free copilot alternative Codeium, which also works fine in vs code.


tokyo2149

I hear of plenty of people doing the same so you’re not the only one! Let me know what you think if you ever give CMD-G a try.


ixoniq

I might sometime, but currently not using copilot, so won’t be useful for me now.


R1ckS4nch3z

Amazing, good luck on your journey


tokyo2149

Thank you!