repl
is an interactive program which wraps non-interactive programs. Inspired by Chris Wanstrath's original Ruby version. It comes with
line editing capabilities (including history and completions) provided by liner.
$ brew tap citizen428/homebrew-tap
$ brew install repl-go
Head over to the release page and download the archive for your operating system/architecture.
git clone https://github.com/citizen428/repl.git
cd repl
go build
Ruby's gem command:
$ repl gem
gem>> --version
2.7.6
gem>> list --local
ast (2.4.0)
awesome_print (1.8.0)
bigdecimal (default: 1.3.4)
bundler (1.17.1, 1.16.6)
byebug (10.0.2)
cmath (default: 1.0.0)
[...]
Docker:
$ repl docker
docker>> version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:31 2018
OS/Arch: darwin/amd64
Experimental: false
[...]
docker>> images
REPOSITORY TAG IMAGE ID CREATED SIZE
citizen428/unsavory latest abe19fd175b0 6 days ago 6.6MB
citizen428/unsavory v0.2.0 abe19fd175b0 6 days ago 6.6MB
golang alpine 95ec94706ff6 3 weeks ago 310MB
$ repl
Usage:
repl cmd [options]
Options:
-compdir string
Directory for completion files (default "/Users/<username>/.repl")
-debug
Enable debug output
-histdir string
Directory for history file (default "/Users/<username>")
Since liner supports completions, repl
does too. Any file in
the directory specified via the -compdir
option matching the name of the command you start repl
with will be used for completions.
For instance, a file named ~/.repl/redis-cli
containing "get set info" will cause "get", "set", and
"info" to be tab completeable at the repl redis-cli
prompt.
This is compatible with the original repl-completion project, which contains a few common, pre-rolled completion files.
Bug reports and pull requests are welcome on GitHub at https://github.com/citizen428/repl.
- Add tests
The gem is available as open source under the terms of the MIT License.