REPL
Prefix any command with a given string, or run a series of subcommands.
Install
Requirements
REPL does not come pre-compiled, so you’ll need Swift 5.0 or later in order to build it. (This version of Swift comes with Xcode 10.2 or later).
To download Xcode, get it from the Mac App Store or download it from the Apple Developer portal (requires sign-in).
Alternatively, download Swift from Swift.org, using Homebrew, swiftenv, or via some other method.
Homebrew
Installation:
$ brew install Samasaur1/core/repl
Updating:
$ brew upgrade repl
Mint
Installation:
$ mint install Samasaur1/REPL
Updating:
$ mint install REPL
Manual Install
Installation & updating:
$ git clone https://github.com/Samasaur1/REPL.git
$ cd REPL
$ swift build -c release
$ sudo mv .build/release/repl /usr/local/bin/repl
Build and run directly:
$ git clone https://github.com/Samasaur1/REPL.git
$ cd REPL
$ swift run REPL git
Usage
[sam](~/Desktop/samasaur1.github.io)$ repl git Initializing REPL with command: git Use ^D to exit [sam](~/Desktop/samasaur1.github.io)$ git status On branch main Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: _layouts/project.html modified: _sass/main.scss modified: about.md modified: projects/customdieroller.html modified: projects/dicekit.html modified: projects/repl.html no changes added to commit (use "git add" and/or "git commit -a") [sam](~/Desktop/samasaur1.github.io)$ git branch * main [sam](~/Desktop/samasaur1.github.io)$ git ^D Exiting REPL [sam](~/Desktop/samasaur1.github.io)$
Notes:
- While REPL does support the up and down arrow keys with its own internal buffer, it does not support any other interaction with your terminal history (such as !!).
- REPL does not currently forward colors from the output of commands run through it.
- REPL’s command prompt is not dynamic — it’s based off of my command prompt,
which means it will always look as it does in the examples above.
This means that even if your normal prompt is this:
hostname:~/path/to/cwd username$
, in REPL it will show up like this:[username](~/path/to/cwd)$ REPLcommand
. - Visit the issues page to see the status of these issues.
Uninstall
REPL doesn’t leave anything behind, so you can use the normal uninstall method:
$ brew uninstall repl
$ mint uninstall REPL
$ sudo rm /usr/local/bin/repl