Bonsai_term is a library that lets you write Terminal UIs (TUIs) using
OCaml. It uses the same programming model as the bonsai_web library.
bonsai_term is released across 4 repositories:
Here are some of our demos. The source code for these (and others) is located in our examples repo.






bonsai_term and its dependencies.
The specific installation instructions depend on your platform. You
can find platform-specific instructions
here.bonsai_term uses OxCaml so the next thing
you'll want to do is install oxcaml by following the instructions
here.opam install bonsai_term. (This will install bonsai_term and its dependencies).At this point you should now have bonsai_term "installed".
To learn how to use bonsai_term you can read its MLI src/bonsai_term.mli and / or look
at some examples in the
bonsai_term_examples repo.
To learn how to use bonsai, you can read the docs in
bonsai_web.
(most of those docs are aimed at the "web" version of bonsai, so the "vdom" bits may not
apply, but the "effect" / "state-fulness" and ways of doing "incrementality" all should
transfer from bonsai_web into bonsai_term).
To learn how to use ocaml here are some good resources:
If you followed the install instructions at the top of this page, you can skip the "Install" instructions on the above links.
OCaml
99.7%
Bonsai_term is a library that lets you write Terminal UIs (TUIs) using
OCaml. It uses the same programming model as the bonsai_web library.
bonsai_term is released across 4 repositories:
Here are some of our demos. The source code for these (and others) is located in our examples repo.






bonsai_term and its dependencies.
The specific installation instructions depend on your platform. You
can find platform-specific instructions
here.bonsai_term uses OxCaml so the next thing
you'll want to do is install oxcaml by following the instructions
here.opam install bonsai_term. (This will install bonsai_term and its dependencies).At this point you should now have bonsai_term "installed".
To learn how to use bonsai_term you can read its MLI src/bonsai_term.mli and / or look
at some examples in the
bonsai_term_examples repo.
To learn how to use bonsai, you can read the docs in
bonsai_web.
(most of those docs are aimed at the "web" version of bonsai, so the "vdom" bits may not
apply, but the "effect" / "state-fulness" and ways of doing "incrementality" all should
transfer from bonsai_web into bonsai_term).
To learn how to use ocaml here are some good resources:
If you followed the install instructions at the top of this page, you can skip the "Install" instructions on the above links.
OCaml
99.7%