DEV Community

RK Riad Khan
RK Riad Khan

Posted on

Cowser: A Fun ASCII-Art Animal CLI in Pure Python

If you miss the good old days of cowsay, you'll love Cowser - a modern,
cross-platform reimagining written in Python with zero runtime dependencies.

What does it do?
Cowser wraps your message in a speech (or thought!) bubble and prints it
above a randomly chosen animal. Greet a friend, pipe in some text, or just
ask for a fortune.

Features

  • 35 built-in animals across 12 categories: cows, cats, pets, birds, sea life, farm, wild, robot, hedgehog, alien, spooky, and mythical creatures
  • cowsay-style moods: --mode dead, borg, greedy, paranoid, stoned, wired...
  • Thought bubbles with --think
  • Custom eyes and tongues via --eyes and --tongue
  • Word wrapping (-W), disabled with -n
  • Rainbow, bold, and 17 ANSI colors
  • --fortune for a random fortune
  • Render two animals side by side with --and
  • An interactive REPL session with --interactive
  • --seed for reproducible output
  • Art packs: drop .cow, .txt, or .art files in a folder and they load automatically (classic cowsay cowfiles supported)
  • Config file at ~/.config/neostore/cowser/config.toml

Quick start
pip install cowser

cowser Alice                     # greet with a random animal
cowser --cow owl Bob             # pick a specific animal
echo "From stdin" | cowser       # pipe a message
cowser --fortune                 # random fortune
cowser --rainbow --bold --message "Party time!"
Enter fullscreen mode Exit fullscreen mode

Also a library
cowser is a pure, type-hinted function you can embed in your own tools:

from cowser import render, render_pair, COWS, search_cows

print(render("Hello from my app", cow="owl", eyes="0.0"))
Enter fullscreen mode Exit fullscreen mode

Why I built it
It started as a tiny script and grew into a layered, well-tested package:
a pure rendering core with a thin CLI on top, a stable backwards-compatible
API surface, and no hard dependencies on modern Python. It works on Linux,
macOS, and Windows (including a legacy-console fallback for old cmd.exe).

Try it today:

python #cli #cowsay #asciiart #opensource #rkriad585

Top comments (0)