Skip to main content

Cowser

Logo

A fun, cross-platform command-line tool that greets you with ASCII art animals. Inspired by cowsay, written in Python.

Features

  • 35+ animals across categories: cows, cats, dogs, birds, sea life, robots, mythical creatures and more
  • Greet users with a random animal, or pick one by name/index/prefix
  • Custom messages and piping from stdin
  • Configurable eyes (--eyes) and tongues (--tongue) on token-based art
  • cowsay-style modes (--mode dead, --think, ...)
  • Word wrapping for long messages (-W/--wrap, -n/--no-wrap)
  • Color themes: rainbow, bold, plus plain colored output
  • Fortune mode (--fortune) and two animals at once (--and)
  • Interactive REPL (--interactive)
  • Colored output (ANSI, works on modern Windows terminals)
  • Legacy-console fallback — output is automatically made printable for cp437/cmd.exe and other old codepages
  • Windows wrappers (cowser.cmd, cowser.ps1) and single-file binaries built with PyInstaller for Linux/macOS/Windows
  • Config file at ~/.config/neostore/cowser/config.toml
  • Usable as a library in your own Python code

Installation

Requires Python 3.8+.

pip install cowser

For color support on legacy Windows consoles (cmd.exe pre-Windows 10):

pip install cowser[color]

From source:

git clone https://github.com/rkriad585/Cowser
cd Cowser
pip install .

Usage

cowser Alice                 # greet with a random animal
cowser --cow owl Bob         # pick a specific animal
cowser --message "Hello!"    # custom message
echo "From stdin" | cowser   # pipe a message
cowser --mode dead --cow pig # mood preset (eyes + tongue)
cowser --think --cow owl "Where am I?"
cowser --rainbow --bold --message "Party time!"
cowser --fortune             # random fortune
cowser --cow dog --and cat "Best friends"
cowser --list                # show all animals
cowser --search mythical     # search by name, category, or tag
cowser --interactive         # chat REPL
 _________
/ Hi Bob! \
\__________/
   _____
  / o o \
 (   V   )
  \_____/

Options

Option Description
-c, --cow NAME_OR_INDEX Choose an animal by name, prefix, or index.
-e, --eyes CHARS Replace the {eyes} token in the art.
--mode MODE Preset style: borg, dead, greedy, paranoid, stoned, drunk, wired, youthful.
--tongue CHARS Replace the {tongue} token in the art.
--think Use a thought bubble instead of a speech bubble.
-W, --wrap WIDTH Word-wrap the message to WIDTH columns.
-n, --no-wrap Disable word wrapping.
--rainbow Colorize output line by line in rainbow order.
--bold Make the output bold.
--fortune Show a random fortune instead of a message.
--and NAME_OR_INDEX Render a second animal next to the first.
--interactive Start an interactive REPL session.
--seed INT Seed random selection for reproducible output.
-m, --message TEXT Show a custom message instead of a greeting.
-l, --list List all available animals.
--search TEXT List animals matching name, category, or tag.
--color COLOR Output color (default: cyan).
--no-color Disable colored output.
-V, --version Show version.
-h, --help Show help.

Legacy commands

Backwards-compatible with the original script:

python main.py Alice
python main.py help
python main.py list
./cowset Alice

Windows wrappers

On Windows, if python is on your PATH, use the bundled wrappers instead of installing anything extra:

cowser.cmd Alice
cowser.cmd --cow owl --message "Hello"
.\cowser.ps1 Alice
.\cowser.ps1 --think --cow owl "Where am I?"

Single-file binaries

Optional standalone binaries (no Python needed) are built with PyInstaller:

pip install -e ".[binary]"
python scripts/build_binary.py

The binary lands in dist/ (cowser.exe on Windows). CI also builds and attaches Linux/macOS/Windows binaries to every v* git tag.

Legacy consoles

When output cannot be encoded by the current console (e.g. cp437 cmd.exe), Cowser automatically replaces unsupported characters with readable ASCII — smart quotes, dashes, accents, and emoji all get a safe fallback.

Configuration

Defaults are read from ~/.config/neostore/cowser/config.toml. Command-line flags always win. See config.example.toml.

# ~/.config/neostore/cowser/config.toml
color = "green"
cow = "fish"
eyes = "o o"
# seed = 42

Using Cowser as a library

from cowser import COWS, render, render_pair, register_cow, search_cows, Cow

print(render("Hello from my app", cow="owl", eyes="0.0"))
print(render("moo", cow="pig", mode="dead", think=True))
print(render_pair("best friends", "dog", "cat", rainbow=True))

for cow in search_cows(category="mythical"):
    print(cow.name, cow.tags)

register_cow(Cow("my-dragon", "   ~\n  (o.o)", category="mythical"))

render() is a pure function — no I/O, no side effects — so it is safe to embed in other tools.

Adding more animals

Open cowser/cows.py and add a Cow to the COWS list. Art may include an {eyes} token that --eyes replaces, and a {tongue|default} token that --tongue (or --mode) replaces:

Cow("my-cow", r"""   /\
  /  \
 | oo |
  ~~   ~~""", "misc", ("new",)),

Development

pip install -e ".[dev]"
python -m pytest

Tests run on Linux, macOS, and Windows via GitHub Actions.

License

MIT © 2026 rkriad585

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cowser-1.3.0.tar.gz (20.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cowser-1.3.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file cowser-1.3.0.tar.gz.

File metadata

  • Download URL: cowser-1.3.0.tar.gz
  • Upload date:
  • Size: 20.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.7

File hashes

Hashes for cowser-1.3.0.tar.gz
Algorithm Hash digest
SHA256 0310c9c0e724a02839bfab0897ae910b718e684f5caa828846d8aa360b5be0f5
MD5 1a8e247d4dcdafbb9207c6a2375ee96a
BLAKE2b-256 87c9d2bad9eb0fe2547cd654eba29675154a53d4d59e69a95ed0d21022bcc3cf

See more details on using hashes here.

File details

Details for the file cowser-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: cowser-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.7

File hashes

Hashes for cowser-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab03cae12cf212ecbf6e59b99ecb753bb884da3a85ce6719fbc3c0cb16c7c993
MD5 18af2478dc9da550bef7071d228151f5
BLAKE2b-256 f34fe3c86cc5b0b1a61d99bfe5e7b94f1e8869798303757e5a7788ee8d6b59f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page