Fork me on GitHub

Ly

The easy-peasy command runner for code big and small.

Install with Go:

$ go get github.com/arthanzel/ly

Run with:

$ ly
Welcome to Ly!
ly >

Check it on Github.

What is?

Ly is a tool inspired by the likes of Ruby's God and Bluepill. Its goal it to make it trivial to run and keep an eye on running processes.

The "killer use case" of Ly is running compilers, preprocessors, or servers in a single shell while working on a project. This comes in handy especially if you don't have an IDE to compile assets for you. Ly lets you run instances of, let's say, Haml, Sass, Coffeescript and Jetty, all without opening a single extra shell or running any commands in the background that hijack your shell's stdout and may turn into zombie processes. Of course, Ly isn't limited to these tools.

Ly doesn't use big configuration files or a complex DSL. Rather, the ly program provides a single REPL environment where you can issue commands and monitor processes. It's simple, lightweight, doesn't pollute your code with more config files, and the learning curve is about 15 seconds long.

How-to

Running ly gives you a wonderful REPL:

$ ly
Welcome to Ly!
ly >

Use the help command to print a wonderful help text:

ly > help

Start a new process called "sass-watcher" with the new operation:

ly > new sass-watcher sass --watch assets/scss:public/css

Kill processes with the kill operation.

ly > kill sass-watcher

List all processes started with Ly with list. This command will show the names of all processes, their PIDs, and if it has printed any messages to stdout or stderr since the last time you checked its output.

ly > list
2 processes
sass-watcher(12345)  2 new messages
coffee-watcher(67890) -- Exited 12 new messages

Check the output of a process with the out operation. All entries are timestamped. White lines represent the standard output, and red lines represent the standard error. Lines that you have already seen by calling out are greyed out.

ly > out sass-watcher
15:13:32 :: some old output
15:21:04 :: some old error
15:21:03 :: some new output
15:21:04 :: some new error

Processes that have been killed or have exited will still have their standard output and error streams accessible using out.

You can also write to a process's standard input using the in operation:

ly > in sass-watcher some input

exit will attempt to close all running processes. When all processes have been closed, Ly will exit on its own. If some processes refuse to exit, Ly will inform you, then exit.

ly > exit
Goodbye!

Please use

Ly is released under the MIT license. You can use it in your own code and even sell said code provided that you retain the MIT license with Ly, including the appropriate copyright. Don't claim credit for Ly, or hold the author responsible if it does something unspeakable, like eat your cat.