New
Apps 6,362Makers 6,341This week 13
Promote your app−30%
cbirds screenshot 1
5views in
the last 30 days

cbirds

A flock of birds (boids) in your terminal, in braille or Kitty graphics

Built with Claude Code

by clainstone · Unclaimed · from ITItaly · added Oct 29, 2026
no ratings0 comments

A flock of birds in your terminal.

A murmuration of a thousand birds in three dimensions, in red, yellow, green and blue: it stretches into a long band, splits in two, opens into a loose cloud and gathers again

cbirds --render kitty --3d --color prism

Craig Reynolds' boids, drawn in braille in any terminal, and as sprites over the Kitty graphics protocol in Kitty and Ghostty. One C99 program, no dependencies. Every clip on this page but the first was recorded by cbirds itself.

Two scarlet hawks hunt an ice-blue flock, which parts around them and closes behind Three flocks in gold, orange and red, each keeping to its own kind and crossing the others
cbirds --render kitty --hawks 2 --color ice --speed 0 cbirds --render kitty --flocks 3 --color ember
Matrix rain, as green birds with tails falling through the screen Two skies: birds with tails in front, smaller and dimmer birds drifting slower behind them
cbirds --render kitty --matrix --speed 0 cbirds --render kitty --depth --trails --color ice
Syntax-highlighted C, the three rules from boids.c: a wave from the middle lifts the letters, they fly as a flock, and each one lands back on the cell it left A murmuration of two thousand birds at dusk, in three dimensions: those near the camera large and peach, those far from it small and indigo, and a stream of the nearest sweeps round in front of the camera before the flock folds back into one body
pygmentize -f 16m -O style=monokai docs/rules.c | cbirds cbirds --render kitty --3d --color dusk
Birds gather into the word HELLO, red through violet, and hover in their places while the rest of the flock wheels round it The flock tells the time, 12:34:56, mint through to violet: the seconds tick as their birds hop over to the next digit, and at 12:35 the digit of the minute that changes lets go and other birds write the new one
cbirds --render kitty --say "hello" --color prism cbirds --render kitty --clock-at 12:34:56 --seconds --color aurora
The same flock and hawks in braille dots, as a terminal without a graphics protocol shows it The flock in sextant blocks, as a text terminal with a font from 2020 or later shows it
cbirds --render braille --hawks 2 --color ice cbirds --render sextants --color acid --speed 2

Install

Homebrew

macOS and Linux. Completions for bash, zsh and fish come with it, and brew upgrade keeps it up to date.

brew install clainstone/tap/cbirds

MacPorts

macOS, from the port. Completions for bash, zsh and fish come with it, and sudo port selfupdate && sudo port upgrade outdated keeps it up to date.

sudo port install cbirds

apt

Debian 12, Ubuntu 22.04 and later, and their derivatives, on amd64 or arm64, from its apt repository. Completions come with it, and sudo apt upgrade keeps it up to date.

sudo apt install curl
curl -fsSL https://clainstone.com/apt/cbirds.gpg | sudo tee /etc/apt/keyrings/cbirds.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/cbirds.gpg] https://clainstone.com/apt stable main" | sudo tee /etc/apt/sources.list.d/cbirds.list
sudo apt update
sudo apt install cbirds

Or just the package, without the repository and so without updates: the .deb files are on the release page, for sudo apt install ./cbirds_*.deb.

Nix flake

Linux on x86_64 and aarch64, macOS on Apple silicon. With Nix and the nix-command and flakes experimental features enabled, run directly from this repository:

nix run github:clainstone/cbirds

Pass cbirds options after --, for example for sprites in Kitty or Ghostty:

nix run github:clainstone/cbirds -- --render kitty --hawks 2 --color ice

From a local checkout of this repository, use nix run ..

From source

git clone https://github.com/clainstone/cbirds
cd cbirds
make
sudo make install
cbirds

That puts one file, /usr/local/bin/cbirds. Without sudo, in your home instead (~/.local/bin has to be on your PATH):

make install PREFIX="$HOME/.local"

Linux and macOS. You need a C compiler and make, nothing else. make test runs the tests. The build uses the system's cc and honours CC, CFLAGS, LDFLAGS, PREFIX and DESTDIR, so make CC=clang and packaging work as usual.

Uninstall

Homebrew

The second line removes the tap as well; leave it out to keep it.

brew uninstall cbirds
brew untap clainstone/tap

MacPorts

sudo port uninstall cbirds

apt

The last two lines remove the repository as well; leave them out to keep it.

sudo apt remove cbirds
sudo rm /etc/apt/sources.list.d/cbirds.list /etc/apt/keyrings/cbirds.gpg
sudo apt update

A .deb installed on its own goes with the first line alone.

From source

In the same directory, and with the same PREFIX it was installed with:

sudo make uninstall                     # installed with sudo make install
make uninstall PREFIX="$HOME/.local"    # installed in your home

Without the clone it is the one file: sudo rm /usr/local/bin/cbirds, or rm ~/.local/bin/cbirds.

Use

cbirds                              a flock in braille, in your terminal's own colours
cbirds --render kitty               sprites, in Kitty or Ghostty
cbirds --preset murmuration         the starling look
cbirds --hawks 2 --color ice        something to watch
cbirds --flocks 3 --color ember     three flocks that keep to their own
cbirds --color prism                a turn runs a rainbow through the flock
cbirds --depth --trails             a second sky behind the first
cbirds --3d                         a murmuration in three dimensions
cbirds --link                       one sky across several terminals
cbirds --matrix                     it is raining birds
cbirds --say "back in five"         the flock writes it, and holds it as a sign
cbirds --clock                      the flock tells the time
cbirds --clock --seconds            and the seconds, HH:MM:SS
cbirds --say "ciao" --font-size 8   letters eight rows tall, from 4 to 10
cbirds --picture logo.png           the flock draws a PNG; --shape dot and -n 2000 suit it
cbirds --screensaver --clock        a lock screen that tells the time; any key quits
fastfetch | cbirds                  the letters of anything take flight

It opens by writing BOIDS, lets go, and flocks. Move the pointer into the flock and it scatters. Press q and it flies off the top. Left alone for a minute, it starts moving the sliders itself; any key takes them back.

h opens the panel of sliders in the corner, and --panel opens it from the start: boundary on b/B, separation on s/S, alignment on a/A, turning on t/T, perception on p/P, speed on v/V, and with two flocks or more avoidance on g/G. Lowercase lowers, uppercase raises, one press is one notch.

key key
Space pause . one frame
+ - more birds, fewer k K a hawk more, one fewer
e tails Tab next preset
0 back to the defaults Enter letters off, or home

Anything can fly

Pipe text into cbirds and the text is the flock.

fastfetch | cbirds
figlet -f big hello | cbirds
ls --color=always -la | cbirds
git log --oneline --graph --color=always | cbirds
cbirds --text poem.txt

A bird drawn in letters, a list of settings beside it and rows of colour blocks: the letters take flight as a wave runs through them, fly as a flock, and land on the cells they left

cat docs/neofetch.txt | cbirds

It opens with the text exactly as the command printed it, in its own colours, laid out as a terminal would have laid it out: cbirds reads the escape sequences, so a logo with its information beside it comes out as a logo with its information beside it. A few seconds later one letter leaves and the ones near it follow, a wave that crosses the screen in about a second, and the letters fly as a flock. After twenty seconds or so they are called home, and every letter lands on its own cell: the screen is what the command printed again, to the cell. After a pause it happens again.

Enter sends the letters off, or calls them home at once. Move the pointer through the text at rest and the letters it touches fly up, and they come back when it has gone. q sends them off the top, as it does the birds.

A letter is drawn as itself, in its own colours, with its bold and underline, wherever it is; one with no colour of its own takes the flock's while it flies. A background colour stays where it was printed. Wide characters take two cells. Hawks work, and are arrows over text. --birds, --flocks, --depth, --matrix, --shape, --sprite, --size and tails do not apply: the text decides how many letters there are, and a letter has no sprite. --render kitty draws text too. The panel is laid over the text, and the letters under it still land there.

When standard input is not a terminal, the keys are read from the terminal itself, its controlling one, /dev/tty, on Linux and on macOS alike; with no terminal at all, as from a service or an editor's run button, cbirds says that it needs one and stops. A pipe is read to its end, or until it has been quiet for a second and a half, or has gone on for eight seconds, or has sent a megabyte, and what is kept is the last screenful, as a terminal would keep it; tail -f log | cbirds shows what the log had when it went quiet. A pipe that sends nothing for three seconds, and text with nothing to see in it, give the ordinary flock. If the window changes size, the text is laid out again on the new one. A sign is what the flock writes, and text is the flock, so --say, --clock, --seconds and --picture stop with a usage error beside --text or beside text on a pipe, and so does --3d, whose sky has no screen to lay a text out on.

Recordings take text too, and then run a whole cycle, 34 seconds, unless --record-seconds says otherwise. A recording never starts a wave it has no time to finish, so a whole cycle ends on the text as it was printed, and a GIF of it loops without a jump:

fastfetch | cbirds --record fetch.cast
cbirds --text poem.txt --record poem.gif --record-fps 20

A GIF of text is drawn with a 5 by 7 font in cells of 12 by 20 pixels, so it shows the letters rather than dots. --snapshot takes text, and --bench takes --text and never a pipe it happens to be in.

Signs

--say TEXT has the flock write TEXT where it would write BOIDS, and keep it up. A sign is for reading, so it is held for thirty to forty-five seconds, and then the flock lets go for eight to twelve, flies as a murmuration, and writes it again. The birds that write do not stand still: each hovers round its place in a small loop of its own, so the strokes shimmer and stay sharp. The colour runs along the text, from one end of the ramp to the other.

Birds gather into the words BACK IN FIVE on two lines, and hover in their places while the rest of the flock wheels round the sign

cbirds --render kitty --say "back in five" --color ember

The rest of the flock wheels round the sign, not through it: all of it the same way, on an ellipse round the text, as one river that bunches and thins, and the other way round the next time the sign is written. Each bird of it wears the colour of its heading, so the sky round the text turns like a wheel.

The letters are a seventh of the window's rows tall: four rows at 80 by 24, five at 120 by 34, seven at 200 by 50. --font-size ROWS sets them from 4 to 10 rows, on any window. Under four the text is lost in the river, and over ten the birds, which are as wide as the cells of the letters, are as heavy as a flock with nothing to write and the river is two bands above and below the text. A sign never takes more than half the width of the screen and not quite half its height, or half and half on a small terminal, so that the river has room; a size that does not fit there is made as large as fits, on up to three lines, and a long text that would be too small to read takes up to two thirds by three fifths. On a small terminal more of the flock writes, so that the birds that are left have sky to fly in.

Lower case is written in capitals, and an accented letter as its plain one, so that città is CITTA and Straße is STRASSE; a symbol, or a letter of another alphabet, has no plain letter and is left out. A text the flock has too few birds to write is said so on stderr and left unwritten, and one that turns out too big for the screen once the run has started is said so there when the run ends, after the terminal is given back. A key does not end a sign. Move the pointer through it and the birds it reaches scatter, and come back when it has gone. A hawk does the same to the places it flies over, for less time: a fifth of a second to two fifths, and only the places within a hawk's own width of its path. A hawk is turned from the text as the flock is, if less firmly than it is drawn to its prey, so it hunts round the sign with the river and crosses it when a chase takes it there. With one hawk up, 800 birds and a screen of 96 by 26 cells, about 3% of the writers are scattered at any moment, and about 7% with two; a clock stays readable.

--clock writes the time, HH:MM, in local time, and follows the locale for the hour: twelve hours, with no AM or PM, if LC_TIME has a time format that shows the hour on a twelve hour clock, and twenty four otherwise. The colon rises and settles once a second. At each new minute the digits that change let go and other birds write the new ones, while the rest of the time stays where it is, so the clock can be read at any moment. On the hour the whole of it lets go for a few seconds, and the flock writes the next time.

The flock writes 10:09, and a few seconds later the two digits that change let go and other birds write 10:10 while the rest of the time stays where it is

cbirds --render kitty --clock-at 10:09:52 --color ember

--seconds shows the seconds too, HH:MM:SS, and is a clock on its own, as --clock-at is. A digit of the seconds is not let go: its own birds hop over to the next one, which takes them a fraction of a second, so the seconds can be read as they tick. The minutes and the hour change as they do without it.

--picture FILE has the flock draw a PNG instead. Every bird takes a place in the opaque part of the picture, where a pixel with an alpha above half is ink, the places spread evenly over it, and wears the picture's colour there. The picture is cut down to at most eight colours, which are the palette of the run; with --color given they are not, and the light and dark of the picture pick shades of that ramp. A bird keeps its colour while it flies, and the picture is held, let go of and drawn again as a sign is. --shape dot and more birds, -n 2000, draw it best. The file is read as --sprite reads one: a PNG of up to 4 MB, in any of the colour types PNG has.

A sign picks a bird as wide as the distance between the cells of its letters unless you give --size, so larger letters are written by larger birds, up to the usual thirty pixels, and the whole flock flies at that size. --shape dot is the crispest, and more birds make thicker strokes.

A recording runs on its own clock, not the wall's, so the time a recorded --clock tells is the local time at which the recording started, moved on by its frames. --clock-at 10:09:50 starts it from a time you choose instead, which is how to record a change of minute. On its own it starts a clock.

Screensaver

--screensaver quits at once on any key, mouse click or pointer movement, with no flight out. Input in the first half second is ignored, because it is whatever started the lock. It goes with everything else, so cbirds --screensaver --clock is a lock screen that tells the time. For tmux, which locks a client after lock-after-time idle seconds and runs lock-command on it:

set -g lock-after-time 300
set -g lock-command "cbirds --screensaver --clock"

And in zsh, which sends itself an alarm after TMOUT idle seconds at the prompt and runs TRAPALRM:

TMOUT=300
TRAPALRM() { cbirds --screensaver --clock }

Three dimensions

--3d takes the flock off the plane and into a sky: a murmuration over its roost, seen from a camera that goes once round it every two minutes. The depth shows even in a still picture: a nearer bird is bigger and brighter than a far one, and a bird flying at the camera is short where one flying across it is long.

A murmuration in ember over a dark sky and a blue hawk: the birds near the camera are large and bright, those far from it small and dim, and the flock closes into a ring around the hawk and then folds into arcs and sheets

cbirds --render kitty --3d --color ember --hawks 1

The three rules are the same, but a bird heeds its seven nearest neighbours, as starlings do, and not everything within a radius. It turns at a limited rate a second, so it banks. A roost calls it home when it strays, and the air above the roost moves slowly, which folds the flock into sheets and ribbons.

Without -n, -s or -c there are 2000 birds, of 8 pixels, or 5 in text, in ink: the ramp from your terminal's text colour to its background, asked for at startup, so the flock is grey on a dark terminal and near black on a light one. A terminal that does not answer, or whose text i

Description taken from the repository README.

Ratings

–
0 ratings
5 0
4 0
3 0
2 0
1 0

Rate this app

Sign in to rate

Comments 0

Sign in to comment

No comments yet.

Related apps

#cli · #simulation · #boids