Skip to content

Finally, a CLI for beloved CodeRunner 2 πŸ™Œ

License

Notifications You must be signed in to change notification settings

cojoj/CodeRunnerCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeRunnerCLI

Swift SPM OS GitHub release

I won't be advertising here for CodeRunner 2, but it's a great app! πŸ˜… It's a compromise between bloated IDEs and simple text editors. What's the biggest advantage is that it supports a lot of different programming languages out of the box, so you can jump in and make something useful without fighting with additional dependencies etc. Don't forget it's a native app, so no more struggle with Electron 😜

I was willing to move all my non serious development stuff to Code Runner 2, but I've discovered it lacks a really important feature (at least for me...) - Command Line Interface. If you've been missing it as well and waiting for creators to add it... Wait no more! It's here and written in nothing else, but Swift! πŸ™Œ

Requirements

This tool is for macOS only. To run it, make sure you have:

  • Swift 4.0 (SPM v4)
  • macOS 10.11 or higher
  • Git

Installing

To make it work you simply have to

$ git clone https://github.com/cojoj/CodeRunnerCLI.git
$ cd CodeRunnerCLI
$ swift build -c release -Xswiftc -static-stdlib
$ cp -f .build/release/CodeRunnerCLI /usr/local/bin/cr

Form now on you have a cr command line tool available for your user.

Usage

The most important feature of good code editing tool is possibility to open specific file or directory straight from you command line, because we're all working with git and maybe some other tools accessible via terminal. CodeRunnerCLI allow you to do so without any problem.

If you want to open Code Runner with file named script.swift, run:

$ cr swift.script

If you want to open Code Runner in newly created directory, simply run:

$ cr ~/path/to/some/dir/

CodeRunnerCLI is able to resolve paths correctly, so you can use things like ~/, . or ... We're also taking care of existing files, so if you already have a file with this name in your file system, CodeRunnerCLI won't override it, but will just open it for you πŸ˜‰

Developing βš’

As mentioned here and there, this project is a Swift application which uses SPM, so everything you'd normaly do with SPM project you can do with CodeRunnerCLI as well ✌️

If you've decided you want to contribute there are actually two ways of doing it:

  1. Text Editor Terminal
  2. Xcode (or anythig else supporting .xcodeproj files)

If you're planning to use the first option, just use command like swift build and swift test. Second option is more complicated as I've decided not to push .xcodeproj to this repository, so before you start anyting you'll have to run swift package generate-xcodeproj and you'll have to do it everytime you manipulate SPM. Developing in Xcode gives you a lot of nice features known from developing iOS/macOS apps.

Everything else