CodeEdit
CodeEdit copied to clipboard
🧹 Refactor CodeEditCli
Current Situation
~~At the moment~~ [Previously] the CodeEditCli
is just a standalone SPM package in our main repo:
https://github.com/CodeEditApp/CodeEdit/tree/main/CodeEditTests
Edit: Now it is in the CodeEditCLI repo.
The built binary is then included as a resource in our main workspace:

The Problem
The problem with this approach apart from having a binary in our sources, which technically isn't needed, is that it prevents our app from notarizing.
Proposed Solution
~~I suggest moving the CodeEditCli
package to a new repo (like CodeEditTextView
) and then attach the binary to a tagged release as an artifact.~~
I may also suggest renaming the artifact to codeedit-cli
in order to make clear what the binary really is. An alias codeedit
can always be created by the user if needed.
This would mean the main app needs to download the latest artifact and move it to the according location in GeneralPreferencesView.swift:215
. The location should be /usr/local/bin/codeedit
.
Additionally we could also add it to homebrew
as a formula codeedit-cli
.
Please let me know what you think about that approach and let's discuss what could be improved further in this regard. I then will create the repo in the organization.
I like this idea. As long as we can properly do all that we need to do to communicate with the main app.
I like this idea. As long as we can properly do all that we need to do to communicate with the main app.
Shouldn't be a problem since it only executes a shell command anyway (open -a CodeEdit.app
) with some arguments. And the Package itself currently isn't related to the main app in any way it just lives in the main repo.
Also I'm already working on a more scalable approach using https://github.com/apple/swift-argument-parser
Perfect. Then let’s do it!
I just created the repo here.
It builds and deploys the artifact correctly in GH actions.
The only thing missing is notarizing the cli binary:
- https://github.com/CodeEditApp/CodeEditCLI/issues/1
Until then the binary cannot be executed once downloaded.
Since the implementation in CodeEdit
itself is still missing I think this should be moved back to the main repo.
@lukepistrol What is the status of this?
Update on this
What was holding this back?
Just downloading the binary and trying to move it to /usr/local/bin/
was not possible since sudo
privileges are needed to access /usr/local/bin
.
New Proposal
Since it is now possible to install the cli using brew
brew install codeeditapp/formulae/codeedit-cli
we can now simply call this command from inside the app and also handle updating by calling brew upgrade codeedit-cli
when there is a new version available. This info could be obtained from the CodeEditApp/homebrew-formulae
repo.
Wouldn’t that require that the user have homebrew installed? Even if they did, wouldn’t it need user input during the update process?
Could we not just ask for a password?
@lukepistrol Has this been completed?