Skip to content

evanschoffstall/unicornsay

Repository files navigation


logo

unicornsay

Say something. A unicorn will deliver it.

Bash 4.2+ Tested with bats MIT License

A single-file Bash script that wraps any message in a styled speech bubble beside a unicorn. Reads from an argument or stdin. Pipe anything through it.

unicornsay banner

Usage

# Argument
unicornsay "Hello, world!"

# Stdin
echo "Build passed." | unicornsay

# Login greeting with fortune and lolcat
unicornsay "$(date "+%b %e, %Y %I:%M:%S %p"; echo; fortune)" | lolcat

Options

Flag Values Default Description
--above off Bubble above the unicorn instead of side-by-side.
--art big, small auto Art size. Auto-selected from terminal height.
--side left, right left Which side the unicorn appears on.
-h, --help Print usage and exit.

Side-by-side layout requires at least 60 columns. Set COLUMNS and LINES to pin layout for scripts and CI.

Tests

bun install
bun run test

Covers all 20 combinations of --above, --art, and --side with exact-output assertions at COLUMNS=80 LINES=24. BATS is installed as a local dev dependency and run through the package script.

Important

If you change the output layout, re-capture snapshots at COLUMNS=80 LINES=24 and update the heredocs in unicornsay.bats.

Made with ❤️ by Evan Schoffstall

About

Say something. A unicorn will deliver it.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors