cowsay
Version, currently 0.0.52 versions
- 0.0.5latestApr 18, 2025
- 0.0.4not indexedJun 19, 2026
github.com/kojix2/cowsay.cr
A Crystal implementation of the classic cowsay program.
Installation
# Add this to your shard.yml
dependencies:
cowsay:
github: kojix2/cowsay.cr
version: ~> 0.0.5Then run:
shards installshard.yml
- Crystal
- no constraint declared
- Target
cowsayfrom src/cowsay/cli.cr
Dependencies
Runtime Dependencies
- uniwidth*github: naqvis/uni_char_width
README
Cowsay (In Crystal)
___________
< OMGHI2U!! >
-----------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
A Crystal implementation of the classic cowsay program, which generates ASCII art of a cow with a message.
Installation
From Binary
Download the latest binary from the Releases page.
From Source
git clone https://github.com/kojix2/cowsay.cr
cd cowsay.cr
shards build --release
The compiled binary will be available at bin/cowsay.
Usage
As a Command Line Tool
Basic usage:
bin/cowsay "Hello, World!"
Output:
_____________
< Hello, World! >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Using a different character:
bin/cowsay -c tux "Hello, Linux!"
Making the character think:
bin/cowsay -n "I am thinking..."
Using different modes:
bin/cowsay -b "Borg mode" # Borg mode
bin/cowsay -d "Dead mode" # Dead mode
bin/cowsay -s "Stoned mode" # Stoned mode
Custom eyes and tongue:
bin/cowsay -e ^^ -T ~~ "Custom face"
Colored output:
bin/cowsay -C "Colorful message!"
As a Library
require "cowsay"
# Basic usage
puts Cowsay.say("Hello, World!")
# Using a different character
puts Cowsay.say("Hello, Linux!", character: "tux")
# Making the character think
puts Cowsay.think("I am thinking...")
# Using different modes
puts Cowsay.say("Borg mode", mode: "borg")
puts Cowsay.say("Dead mode", mode: "dead")
# Custom eyes and tongue
puts Cowsay.say("Custom face", eyes: "^^", tongue: "~~")
# Colored output
puts Cowsay.say("Colorful message!", color: true)
# Direct class usage
cow = Cowsay::Cow.new(mode: "stoned", color: true)
puts cow.say("I'm feeling strange...")
Command Line Options
Usage: cowsay [options] message
-c, --cow CHARACTER Selects a character
-n, --think Makes the cow think
-e EYES, --eyes=EYES Sets the eyes of the cow (default 'oo')
-T TONGUE, --tongue=TONGUE Sets the tongue of the cow (default ' ')
-b, --borg Borg mode
-d, --dead appear dead
-g, --greedy Greedy mode
-p, --paranoid Paranoid mode
-s, --stoned Stoned mode
-t, --tired Tired mode
-w, --wired Wired mode
-y, --young Youthful appearance
-l, --list Lists available characters
-W, --wrap-column WIDTH Sets the width of the cow
-C, --color Enable colored output
-v, --version Displays version information
-h, --help Displays this help message
Available Characters
You can list all available characters with:
bin/cowsay -l
Some notable characters include:
cow: The default cowtux: The Linux mascotdragon: A dragonsheep: A sheepturtle: A turtlebunny: A bunnymoose: A moose- And many more!
Face Modes
The following face modes are available:
| Mode | Description | Eyes | Tongue |
|---|---|---|---|
| default | Default face | oo | |
| borg | Borg mode | == | |
| dead | Dead face | == | U |
| greedy | Greedy face | $$ | |
| paranoid | Paranoid face | @@ | |
| stoned | Stoned face | ** | U |
| tired | Tired face | -- | |
| wired | Wired face | OO | |
| young | Young face | .. |
Development / Contributing
This project was forked from ruby cowsay.
Here are some ways you can contribute:
- Fork this repository
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
- Add tests
Special Thanks
Special thanks to Tony Monroe for the original perl CLI implementation. You can find out more about that here:
http://www.nog.net/~tony/warez/cowsay.shtml
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.0.5- Tagged
- Apr 18, 2025
- Commit
17a64660b036- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/kojix2/cowsay.cr
Metadata
- Created
- Sep 3, 2026
- Updated
- Sep 24, 2026
- Synced
- Sep 23, 2026
- Versions
- 2