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)
  • 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

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.2.0.tar.gz (18.6 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.2.0-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cowser-1.2.0.tar.gz
Algorithm Hash digest
SHA256 fe80ae5c2455016b1b4ffd978abb2ee81f8e9d7999d7799ddeedb467a3240e09
MD5 03f80125ea1d08593616535a4d74dce3
BLAKE2b-256 6b03550947d993e1c7a8f4a56ea0bdc384195ba246b642df75c360359126324b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cowser-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2673c89fcbd64b3d43f846e1eea0c5b06b3d2226b52702b16e9a37c4811f45bf
MD5 4355a7a957fd01625799e6d042f568f9
BLAKE2b-256 d376c3229e7b7a3977a229f403a34286e6fcf2c77813c7a7f0ed115c86b97203

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