cl-sl
A Common Lisp take on the classic Unix joke command sl (Steam Locomotive): mistype ls as sl and, instead of a shell error, a steam locomotive runs across the terminal and exits automatically once it scrolls off screen, rendered live via cl-tty-kit. Every locomotive sprite, smoke table, and motion rule in this release was authored for this repository. Revisions before v1.0.0 did not meet that standard; see LICENSE for the attribution notice covering them. Targets SBCL only.
Full documentation is published at <https://nerima-lisp.github.io/cl-sl/. The source for that site lives in docs/src/.
Quick Start
(asdf:load-system "cl-sl")
(cl-sl:run :accident-p t)
;; Fills the current terminal until the train exits or `q' is pressed.Or, once built, from the command line:
cl-sl # the default full-size train
cl-sl -a # -a/--accident: riders appear along the train
cl-sl -l # -l/--little: a shorter, smaller train
cl-sl -c # -c/--c51: the larger C51-style locomotive
cl-sl -F # -F/--fly: the train rises and falls as it crosses
cl-sl --fps 30-l and -c choose the artwork, and -l wins when both are given. -F is orthogonal to that choice: it changes the trajectory only, and the train keeps whichever art -l/-c selected.
Without a terminal on standard input -- a cron job, a CI step, a pipeline -- cl-sl writes one line to standard error and exits 0 rather than failing:
$ cl-sl < /dev/null
cl-sl: standard input is not a terminal; nothing to animate.
$ echo $?
0Standard output stays empty in that case. The zero status is deliberate: sl is what runs when someone mistypes ls, so it must not break the script that invoked it by accident.
Install
As a command, from a checkout:
nix build # -> ./result/bin/cl-sl
./result/bin/cl-sl -aOr without cloning: nix run github:nerima-lisp/cl-sl.
As a library, from another flake:
# flake.nix
inputs.cl-sl = {
url = "github:nerima-lisp/cl-sl/v1.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};Note the pinned tag. Consumers inside this org must pin a release tag rather than follow the default branch. On a lispDependencies edge, read cl-sl.packages.<system.cl-sl -- packages.default is the delivered binary, not the ASDF system.