Skip to main content

PyBonsai-CLI

PyBonsai is a Python script that generates procedural ASCII art trees in the comfort of your terminal.

Features 🌱

This is a fork of PyBonsai with some additional features.

  • Simple package installation 📦
  • Better CLI experience 💻
  • Infinite mode 🔄
  • Save to text files 📄
  • True bonsai 🌳
  • Preset change 🎨
  • Falling leaves animation 🍃
  • Lofi radio 📻 [UPDATED] ✨

About other features read more on examples.md.

Installation 🔗

Requirements:

  • Python 3.9 or greater
  • For YouTube radio: Python 3.10+, FFmpeg (ffplay), and Deno 2.3+ or Node.js 22+

Use pipx to install PyBonsai globally.

pipx install pybonsai

or using uv to install in temporary, isolated environment:

uvx pybonsai

Alternative

Also can be installed using pip:

pip install pybonsai

or build from source:

git clone https://github.com/DaEtoJostka/PyBonsai-CLI.git
cd PyBonsai-CLI
pip install .

Verify the installation by running:

pybonsai --version

Usage 🔧

Run pybonsai --help for usage:

OPTIONS:
    -h, --help            display help
        --version         display version

    -s, --seed            seed for the random number generator

    -i, --instant         instant mode: display finished tree immediately
    -w, --wait            time delay between drawing characters when not in instant mode [default {Options.WAIT_TIME}]

    -c, --branch-chars    string of chars randomly chosen for branches [default "{Options.BRANCH_CHARS}"]
    -C, --leaf-chars      string of chars randomly chosen for leaves [default "{Options.LEAF_CHARS}"]

    -x, --width           maximum width of the tree [default {Options.WINDOW_WIDTH}]
    -y, --height          maximum height of the tree [default {Options.WINDOW_HEIGHT}]

    -t, --type            tree type [0-3]: "classic":0, "fibonacci":1, "offset fibonacci":2, "random fibonacci":3 [default random]
    -b, --bonsai          enable bonsai preset settings (invokes specific defaults for small tree)
    -S, --start-len       length of the root branch [default {Options.INITIAL_LEN}]
    -L, --leaf-len        length of each leaf [default {Options.LEAF_LEN}]
    -l, --layers          number of branch layers: more => more branches [default {Options.NUM_LAYERS}]
    -a, --angle           mean angle of branches to their parent, in degrees; more => more arched trees [default {Options.ANGLE_MEAN}]

    -o, --save PATH       save the tree to a text file. If only a filename is provided, it will be saved in a user's Downloads directory.
    -f, --fixed-window    do not allow window height to increase when tree grows off screen
    
    -I, --infinite        run in infinite mode, infinitely growing same tree
    -n, --new             run in infinite mode, automatically growing new trees
    -W, --wait-infinite   time delay between drawing in infinite mode [default {Options.INFINITE_WAIT_TIME}]

    -p, --preset           apply a color preset: {", ".join(colors.PRESETS.keys())}
    -B, --branch-color     custom color for branches (e.g. "red", "#553311", "100,60,30")
    -e, --leaf-color       custom color for leaves
    -g, --soil-color       custom color for soil

    -F, --leaves-falling   animate leaves falling from the tree continuously
    -N, --intensity        intensity of falling leaves [1-10, default {Options.INTENSITY}]
    -d, --fall-speed       speed of falling animation [default {Options.FALL_SPEED}]
    -T, --tumbling-speed   speed of leaf character change [default {Options.TUMBLING_SPEED}]
    -K, --falling-chars    custom characters for falling leaves (e.g. "01" for matrix-style)

    -R, --lofi [PRESET]    play a terminal radio preset; presets: lofi (default), classical (alias: 0), medieval (alias: 1), synthwave (alias: 2), sad (alias: 3), jazz (alias: 4)
    -V, --volume           volume level for radio [0-100, default {Options.VOLUME}]
    -U, --radio-url        custom radio stream URL

Other options usage examples see examples.md

Radio

Requires FFmpeg (ffplay). YouTube stations also need Python 3.10+ and Deno 2.3+ or Node.js 22+ on your PATH.

pybonsai -R       # lo-fi
pybonsai -R 2     # synthwave
pybonsai -U 'https://example.com/live.mp3'  # custom stream

See --help for all stations. Playback reconnects automatically; press Ctrl+C to stop.

Like it?

If you like this project, please consider giving it a ⭐️ on GitHub

Also don't forget to check out PyBonsai

Contributing

If you want to contribute to this project, please feel free to submit a pull request.

License

MIT license

Metadata

Release files for pybonsai 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybonsai 3.1.1
File Size Uploaded Provenance Actions
pybonsai-3.1.1.tar.gz 120.5 kB With provenance Details for pybonsai-3.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybonsai 3.1.1
File Interpreter ABI Platform Actions
pybonsai-3.1.1-py3-none-any.whl Python 3 none any Details for pybonsai-3.1.1-py3-none-any.whl

Total release size: 152.4 kB

Release files / pybonsai-3.1.1.tar.gz

Download URL pybonsai-3.1.1.tar.gz
Size 120.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cef08914a46c70a49c66489151f4be64c57c72c020dff55069cbef87414be0ee
BLAKE2b-256 checksum
How to use checksums
23bb170edec79d0343c97ffefdf1b3bdee5353d207facc36f7b14a88381942db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / pybonsai-3.1.1-py3-none-any.whl

Download URL pybonsai-3.1.1-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a88ec307ee463b512903668b5457c78cc738319542b13b0694734fe184e3b05
BLAKE2b-256 checksum
How to use checksums
78c9080201c4e37ecf45abe780d3a714775457e6579343d3ce0630960c346695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for pybonsai 3.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pybonsai-3.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page