glslerate
v1.1.0
Published
Live GLSL editor in the terminal
Readme
glslerate
Live GLSL in a nano-style terminal editor, synced to a native transparent OpenGL window on the desktop.
Install
Node.js 18+ required.
yarn global add glslerate
# or
npm install -g glslerateOr run without installing:
npx glslerateMinimum requirements (viewer / shaders)
The native viewer needs a real OpenGL 3.3 core GPU and working drivers. Headless servers, many thin clients, and some VMs (no GPU passthrough) often cannot create the context or will fall back to software that is too slow or unsupported.
| Area | Expectation | |------|----------------| | GPU / GL | Hardware and drivers that expose OpenGL 3.3 in a core profile (not legacy 2.1-only stacks). Very old integrated graphics or broken/outdated drivers may fail at startup or show a black window. | | Performance | The bundled default fragment shader is heavy (ray marching, many steps). Laptops with weak GPUs, thermal limits, or battery saving may stutter or run hot; simpler shaders are easier on the machine. | | RAM | Roughly 2 GB free system RAM minimum for Node plus the viewer; more helps if the OS is already tight. |
If the viewer does not open or shaders never appear, check GPU/driver support and try a lighter fragment shader before assuming the install is broken.
Usage
CLI
| Command | Purpose |
|--------|---------|
| glslerate | Start the viewer and open the editor |
| glslerate <project.json> | Load vertex and fragment shaders from a saved project file |
| glslerate viewer open | Start only the OpenGL window (background) |
| glslerate viewer close | Stop the viewer using CLI state |
| glslerate guide | Print the GLSL guide (stdout) |
| glslerate --help | Usage and key cheatsheet |
Editor (nano-like)
| Key | Action | |-----|--------| | ^X or ^C | Exit | | ^O | Open a saved project JSON from a path (relative paths use the current working directory) | | ^V | Toggle the OpenGL viewer on or off (editor keeps running) | | ^S | Save the project to the current JSON path; if no path is set yet, prompts for a file path (relative paths are resolved from the current working directory) | | ^T | Switch between vertex and fragment shader buffers | | ^G | Show the GLSL guide in the terminal; press Enter to return | | Arrows | Move the cursor | | Home / End or ^A / ^E | Start or end of the current line | | Enter | New line | | Tab | Insert two spaces | | Backspace / Delete | Delete before or after the cursor |
Overlay window: drag with the left mouse button to move the frameless viewer.
Project file: JSON with shape { "version": 1, "vertex": "...", "fragment": "..." }. Use ^O inside the editor, ^S to save (or save-as), or run glslerate your-file.json from the shell.
Shaders use OpenGL 3.3 core (#version 330 core). The editor uses syntax highlighting (deep green chrome inspired by Devlink; line numbers in the gutter) for display only; the source sent to the viewer is plain text. Set NO_COLOR or run without a TTY to disable colors.
Overview
Two processes: a Node CLI (raw-mode terminal editor) and a native viewer. Edits are debounced over a WebSocket on 127.0.0.1 only. The viewer uses a transparent framebuffer so alpha-zero regions show the desktop behind the window.
