LinuxCommandLibrary

cbonsai

Display a colorful, animated ASCII tree

TLDR

Generate a bonsai in live mode

$ cbonsai [[-l|--live]]
copy

Generate a bonsai in infinite mode
$ cbonsai [[-i|--infinite]]
copy

Set the growth factor of the tree (default: 32)
$ cbonsai [[-L|--life]] [0..200]
copy

Set the branching factor of the tree (default: 5)
$ cbonsai [[-M|--multiplier]] [0..20]
copy

Run in screensaver mode (equivalent to --live --infinite but any keypress exits)
$ cbonsai [[-S|--screensaver]]
copy

Append a message to the bonsai
$ cbonsai [[-m|--message]] "[message]"
copy

Display extra information about the bonsai
$ cbonsai [[-v|--verbose]]
copy

Display help
$ cbonsai [[-h|--help]]
copy

SYNOPSIS

cbonsai [-h] [-t TIME] [-s SIZE] [-l LEVELS] [-S SEED]

PARAMETERS

-h
    Display help message and exit.

-t TIME
    Milliseconds between animation frames (default: 200).

-s SIZE
    Scale multiplier for tree size (default: 1).

-l LEVELS
    Maximum branching levels (default: 10).

-S SEED
    Integer seed for reproducible trees (default: time-based).

DESCRIPTION

Cbonsai is a charming C-language utility that renders animated, growing ASCII art bonsai trees in your terminal. It simulates organic tree growth through recursive branching algorithms, displaying frames with swaying leaves and trunks that evolve over time.

Invoking cbonsai launches a continuous animation loop, perfect for terminal eye candy, zen breaks, or as a lightweight screensaver. Trees are procedurally generated with randomized elements, but options allow customization of speed, scale, depth, and reproducibility. The effect is hypnotic, using simple characters like / \ | - ` ' to craft intricate structures.

It's resource-light, running efficiently on most Unix-like systems with a standard terminal (80x24+ recommended). Interrupt with Ctrl+C. Popular for its whimsy, cbonsai has become a staple in the arsenal of terminal toys.

CAVEATS

Large sizes/levels may exceed terminal height, increase CPU use, or cause flicker. Requires 24+ terminal lines.

EXAMPLES

cbonsai (default tree)
cbonsai -s 2 -l 12 (large tree)
cbonsai -t 100 -S 42 (fast, reproducible)

INSTALLATION

Arch: pamac install cbonsai
Nix: nix-env -iA nixpkgs.cbonsai
Others: Clone/compile from GitHub.

HISTORY

Created by Jan Helbling in June 2018 as a weekend project. Exploded in popularity via viral Twitter GIF (500k+ likes), leading to distro packaging (e.g., Arch, NixOS) and GitHub repo with 10k+ stars.

SEE ALSO

sl(6), cowsay(1), figlet(1)

Copied to clipboard