This project was inspired by sl, a toy program that sends an animated locomotive across your screen when you misspell 'ls'. As fun as this program is, it's disappointingly specific. We thought, why not leverage the power of AI (aka somebody else's web service) to create images for every possible misspelling.

What it does

When bash returns a 'command not found' error, Generalized Steam Locomotive captures your command, expands it into a random deacronymization, and queries the Bing image search API to obtain a suitable image, which is then converted to ASCII by jp2a.

How I built it

Shell scripts and Python glue. Most of the real work is done by existing programs or APIs.

Challenges I ran into

Bash documentation is hard to grok. It took be a long time to figure out what preset variables I had access to within a trap to extract the command from.

Accomplishments that I'm proud of

I wrestled with the shell and lived to tell the tale.

What I learned

Modern APIs are more composable than you might expect.

What's next for Generalized Steam Locomotive

Colors, animated images, bitmap images in terminals that support it, models for plausible deacronymization.

Share this project: