Welcome to the SL Project

SL (Steam Locomotive) runs across your terminal when you type “sl” as you meant to type “ls”. It’s just a joke command.

Visit our GitHub repository for more information.


Demo

Trains

SL draws three trains. Pick one with a CLI flag, or with the trainType embed parameter - each demo below runs on its own.

D51

The D51 is the locomotive that runs when you type sl with no flags: a 2-8-2 Mikado engine eleven rows tall, a coal car, and a line of passenger cars that carry whatever you pipe in.

Run it with sl.

Open the D51 full-screen demo

C51

Pass -c (or --c51) to swap the engine for the C51: a Pacific with a leading truck, a longer boiler, and twelve rows of art instead of eleven. The coal car and passenger cars trail along the same way.

Run it with sl -c.

Open the C51 full-screen demo

The little version from -l (or --logo) is a seven-row train. It keeps the animation intact on narrow terminals and small embeds, where the full locomotives are clipped by the window.

Run it with sl -l.

Open the Logo full-screen demo

Usage

Usage: sl [OPTIONS]

Options:
  -a, --accident  An accident is occurring. People cry for help. Lists all files
  -l, --logo      Little version
  -F, --fly       It flies like the galaxy express 999
  -c, --c51       C51 appears instead of D51
  -f, --files     Disables listing files and directories
  -h, --help      Print help
  -V, --version   Print version

Piping

SL supports piping contents into it for printing things to the train car.

echo "Hello\nworld!" | sl

You can also pipe long/slow running processes into it:

# Print package names as they are built as train cars!
cargo build 2>&1 | awk -F' ' '/Compiling/ {print $2}' | sl

Embed

You can embed the SL terminal in your own pages using query parameters:

https://scaryrawr.github.io/sl/embed.html?accident=true&fly=false&smoke=true&trainType=d51&messages=["hello","world"]

Supported query parameters:

The terminal fills the entire embed viewport and the page background matches backgroundColor, so an embed blends into your page without letterboxing or scrollbars.

Installation

macOS and x64 Linux

Using homebrew:

brew install scaryrawr/formulae/sl

Fedora Linux

Using copr:

sudo dnf copr enable scaryrawr/sl
sudo dnf install sl

Windows

Download the latest release or using winget:

winget install scaryrawr.sl
# Override sl alias which was (Set-Location)
echo 'Set-Alias -Name sl -Value "C:\Program Files\sl\bin\sl.exe" -Force' >> $profile
Set-Alias -Name sl -Value "C:\Program Files\sl\bin\sl.exe" -Force

Using cargo:

cargo install --git https://github.com/scaryrawr/sl