CLIGEBRA is a terminal-native geometry workspace for linear algebra and 3D analytic geometry.
The current milestone focuses on the interface:
- a full-screen TUI shell
- an editable scene-definition buffer
- a live object list derived from the buffer
- a separate PyVista scene window for 3D visualization
The language reference lives in LANGUAGE.md.
Check out example.md to see how I use it in my Math Classes.
There are two normal ways to work with CLIGEBRA:
-
Built-in editor
Startcligebra,cligebra tui, or open a file directly withcligebra <file.clg>. The object list and renderer update from that editor. -
Neovim or another external editor
Edit a.clgfile as a normal file and runcligebra watch <file>to update the renderer when the file is saved.
If you want everything in one place, use the built-in editor. If you want your usual editor workflow, use a .clg file with watch.
Open the built-in editor:
cligebraOpen a file directly in the built-in editor:
cligebra examples/basic.clgWatch a scene file and update the renderer when it is saved:
cligebra watch examples/basic.clgCheck a scene file without opening the renderer:
cligebra check examples/basic.clgFor editor integrations, checks can also be emitted as JSON:
cligebra check examples/basic.clg --jsonInstalled entrypoint:
python -m venv .venv
source .venv/bin/activate
pip install -e .
cligebraWithout installing, you can also run:
python3 main.py
python3 main.py examples/basic.clgcligebra, cligebra tui, and cligebra <file> start the built-in editor. cligebra watch <file> starts the PyVista renderer for a scene file.
Start the built-in editor with:
cligebraor:
cligebra tuior open a file directly:
cligebra examples/basic.clgEdit the scene directly inside the app. The parsed object list updates in the sidebar and the renderer updates from the editor content.
Inside the command palette you can use:
savesave <file>open <file>samplehelpquit
CLIGEBRA scene files are intended to work well as normal files edited in Neovim. Use .clg as the main extension:
nvim examples/cylinder.clgThe repository includes Neovim examples here:
- editor/nvim/lua/config/autocmds.lua
- editor/nvim/lua/plugins/cligebra.lua
- editor/nvim/snippets/package.json
- editor/nvim/snippets/cligebra.json
With LazyVim's default leader key, <leader>cr means Space c r.
Open a scene file:
nvim examples/cylinder.clgThen press:
Space c r
That starts this command in the background:
cligebra watch /absolute/path/to/current-file.clgThe PyVista renderer window opens. After that, edit the scene normally and save with:
:wEvery save updates the renderer.
To confirm the buffer is using the right filetype:
:set filetype?Expected:
filetype=cligebra
If Space c r does nothing, restart Neovim after adding the config, reopen the .clg file, and check :set filetype?.
After restarting Neovim, editing a .clg file will give you:
- snippet completion for CLIGEBRA constructors
- buffer completion for names already used in the file, like
p1,p2,v1 - path completion if you want it