├── .github ├── CodeEditCLI-Icon-128@2x.png └── workflows │ ├── CI-deploy.yml │ ├── CI-pull-request.yml │ ├── CI-push.yml │ ├── add-to-project.yml │ ├── build.yml │ ├── deploy.yml │ └── swiftlint.yml ├── .gitignore ├── .swiftlint.yml ├── Makefile ├── Package.resolved ├── Package.swift ├── README.md └── Sources └── CodeEditCLI ├── Open.swift ├── Version.swift └── main.swift /.github/CodeEditCLI-Icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeEditApp/CodeEditCLI/f557825656739b37375862f71c2e2bc73cba1ab6/.github/CodeEditCLI-Icon-128@2x.png -------------------------------------------------------------------------------- /.github/workflows/CI-deploy.yml: -------------------------------------------------------------------------------- 1 | name: CI - Deploy 2 | on: 3 | push: 4 | tags: 5 | - '*.*.*' 6 | workflow_dispatch: 7 | jobs: 8 | swiftlint: 9 | name: SwiftLint 10 | uses: ./.github/workflows/swiftlint.yml 11 | secrets: inherit 12 | test: 13 | name: Build CodeEdit CLI 14 | needs: swiftlint 15 | uses: ./.github/workflows/build.yml 16 | secrets: inherit 17 | deploy: 18 | name: Deploy CodeEdit CLI 19 | needs: [swiftlint, test] 20 | uses: ./.github/workflows/deploy.yml 21 | secrets: inherit 22 | -------------------------------------------------------------------------------- /.github/workflows/CI-pull-request.yml: -------------------------------------------------------------------------------- 1 | name: CI - Pull Request 2 | on: 3 | pull_request: 4 | branches: 5 | - 'main' 6 | workflow_dispatch: 7 | jobs: 8 | swiftlint: 9 | name: SwiftLint 10 | uses: ./.github/workflows/swiftlint.yml 11 | secrets: inherit 12 | test: 13 | name: Build CodeEdit CLI 14 | needs: swiftlint 15 | uses: ./.github/workflows/build.yml 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /.github/workflows/CI-push.yml: -------------------------------------------------------------------------------- 1 | name: CI - Push to main 2 | on: 3 | push: 4 | branches: 5 | - 'main' 6 | workflow_dispatch: 7 | jobs: 8 | swiftlint: 9 | name: SwiftLint 10 | uses: ./.github/workflows/swiftlint.yml 11 | secrets: inherit 12 | test: 13 | name: Build CodeEdit CLI 14 | needs: swiftlint 15 | uses: ./.github/workflows/build.yml 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /.github/workflows/add-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Add new issues to project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | name: Add new issues labeled with enhancement or bug to project 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/add-to-project@v0.4.0 14 | with: 15 | # You can target a repository in a different organization 16 | # to the issue 17 | project-url: https://github.com/orgs/CodeEditApp/projects/3 18 | github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} 19 | labeled: enhancement, bug 20 | label-operator: OR 21 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_dispatch: 4 | workflow_call: 5 | jobs: 6 | build-codeedit-cli: 7 | name: Building CodeEdit CLI 8 | runs-on: [self-hosted, macOS] 9 | steps: 10 | - name: Checkout Repository 11 | uses: actions/checkout@v3 12 | 13 | - name: Building 14 | run: swift build -c release --arch arm64 --arch x86_64 15 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy 2 | on: 3 | workflow_dispatch: 4 | workflow_call: 5 | 6 | jobs: 7 | deploy-codeedit-cli: 8 | name: Deploying CodeEdit CLI 9 | runs-on: [self-hosted, macOS] 10 | steps: 11 | - name: Checkout Repository 12 | uses: actions/checkout@v3 13 | 14 | - name: Install codesign certificate 15 | env: 16 | # DEV_CERT_B64: Base64-encoded developer certificate as .p12 17 | # DEV_CERT_PWD: Developer certificate .p12 password 18 | # KEYCHAIN_TIMEOUT: Lock keychain after timeout interval 19 | # https://docs.github.com/en/actions/deployment/deploying-xcode-applications/installing-an-apple-certificate-on-macos-runners-for-xcode-development 20 | DEV_CERT_B64: ${{ secrets.DEV_CERT_B64 }} 21 | DEV_CERT_PWD: ${{ secrets.DEV_CERT_PWD }} 22 | KEYCHAIN_TIMEOUT: 21600 23 | run: | 24 | DEV_CERT_P12="$RUNNER_TEMP/dev_cert.p12" 25 | KEYCHAIN_DB="$RUNNER_TEMP/keychain.keychain-db" 26 | KEYCHAIN_PWD=$(openssl rand -base64 24) 27 | security create-keychain -p "$KEYCHAIN_PWD" "$KEYCHAIN_DB" 28 | security set-keychain-settings -lut "$KEYCHAIN_TIMEOUT" "$KEYCHAIN_DB" 29 | security unlock-keychain -p "$KEYCHAIN_PWD" "$KEYCHAIN_DB" 30 | echo -n "$DEV_CERT_B64" | base64 --decode -o "$DEV_CERT_P12" 31 | security import "$DEV_CERT_P12" -P "$DEV_CERT_PWD" -A -t cert -f pkcs12 -k "$KEYCHAIN_DB" 32 | security list-keychain -d user -s "$KEYCHAIN_DB" 33 | 34 | - name: Building 35 | run: | 36 | swift build -c release --arch arm64 --arch x86_64 37 | 38 | - name: Sign 39 | env: 40 | CODESIGN_SIGN: ${{ secrets.CODESIGN_SIGN }} 41 | run: | 42 | security find-identity -p basic -v 43 | codesign --sign "$CODESIGN_SIGN" --prefix app.codeedit.CodeEdit. --options=runtime --verbose --timestamp .build/apple/Products/Release/codeedit 44 | 45 | - name: Zip 46 | run: | 47 | cd .build/apple/Products/Release 48 | zip -r codeedit-cli.zip codeedit 49 | cd ../../../../ 50 | 51 | - name: Notarize 52 | env: 53 | APPLE_ID: ${{ secrets.APPLE_ID }} 54 | APPLE_ID_PWD: ${{ secrets.APPLE_ID_PWD }} 55 | APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} 56 | run: | 57 | xcrun notarytool submit ".build/apple/Products/Release/codeedit-cli.zip" --apple-id "$APPLE_ID" --password "$APPLE_ID_PWD" --team-id "$APPLE_TEAM_ID" --verbose --wait --output-format plist > "NotarizationResponse.plist" 58 | status=`/usr/libexec/PlistBuddy -c "Print :status" "NotarizationResponse.plist"` 59 | if [[ $status != "Accepted" ]]; then 60 | exit 999 61 | fi 62 | 63 | - name: Create Release 64 | id: create_release 65 | uses: actions/create-release@v1 66 | env: 67 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 68 | with: 69 | tag_name: ${{ github.ref }} 70 | release_name: ${{ github.ref }} 71 | draft: false 72 | prerelease: false 73 | 74 | - name: Upload Release Asset 75 | uses: actions/upload-release-asset@v1 76 | env: 77 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 78 | with: 79 | upload_url: ${{ steps.create_release.outputs.upload_url }} 80 | asset_path: .build/apple/Products/Release/codeedit-cli.zip 81 | asset_name: codeedit-cli-universal-binary.zip 82 | asset_content_type: application/zip 83 | 84 | - name: Clean up keychain 85 | if: ${{ always() }} 86 | run: | 87 | security delete-keychain "$RUNNER_TEMP/keychain.keychain-db" 88 | -------------------------------------------------------------------------------- /.github/workflows/swiftlint.yml: -------------------------------------------------------------------------------- 1 | name: SwiftLint 2 | on: 3 | workflow_dispatch: 4 | workflow_call: 5 | jobs: 6 | SwiftLint: 7 | runs-on: [self-hosted, macOS] 8 | steps: 9 | - uses: actions/checkout@v3 10 | - name: GitHub Action for SwiftLint with --strict 11 | run: swiftlint --strict 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /.build 3 | /Packages 4 | /*.xcodeproj 5 | xcuserdata/ 6 | DerivedData/ 7 | .swiftpm/config/registries.json 8 | .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata 9 | .netrc 10 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | 2 | identifier_name: 3 | allowed_symbols: ['_'] 4 | 5 | large_tuple: 6 | warning: 5 7 | 8 | excluded: 9 | - .build 10 | - .git 11 | - .swiftpm 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | prefix ?= /usr/local 2 | bindir = $(prefix)/bin 3 | binname = "codeedit" 4 | 5 | build: 6 | swift build -c release --disable-sandbox 7 | 8 | install: build 9 | install -d "$(bindir)" 10 | install ".build/release/$(binname)" "$(bindir)" 11 | 12 | uninstall: 13 | rm -rf "$(bindir)/$(binname)" 14 | 15 | clean: 16 | rm -rf .build 17 | 18 | .PHONY: build install uninstall clean 19 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "pins" : [ 3 | { 4 | "identity" : "swift-argument-parser", 5 | "kind" : "remoteSourceControl", 6 | "location" : "https://github.com/apple/swift-argument-parser", 7 | "state" : { 8 | "revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", 9 | "version" : "1.2.0" 10 | } 11 | } 12 | ], 13 | "version" : 2 14 | } 15 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.7 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "CodeEditCLI", 8 | products: [ 9 | .executable(name: "codeedit", targets: ["CodeEditCLI"]) 10 | ], 11 | dependencies: [ 12 | .package(url: "https://github.com/apple/swift-argument-parser", from: "1.2.0") 13 | ], 14 | targets: [ 15 | .executableTarget( 16 | name: "CodeEditCLI", 17 | dependencies: [ 18 | .product(name: "ArgumentParser", package: "swift-argument-parser") 19 | ]) 20 | ] 21 | ) 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
129 |
130 | ![]() CodeEdit 132 | 133 | |
134 |
135 |
136 | ![]() CodeEditSourceEditor 138 | 139 | |
140 |
141 |
142 | ![]() CodeEditTextView 144 | 145 | |
146 |
147 |
148 | ![]() CodeEditLanguages 150 | 151 | |
152 |
153 |
154 | ![]() CodeEditKit 156 | 157 | |
158 |