Repository iconcurepo.dev
ratty preview

orhun / ratty

3d3d-graphicscommandgpu

A GPU-rendered terminal emulator with inline 3D graphics ๐Ÿ€๐Ÿง€

3.2k Stars
visibility11 Watchers
fork_right85 Forks
Rust
historyUpdated recently

description README.md



Ratty: A GPU-rendered terminal emulator with inline 3D graphics ๐Ÿง€
Inspired by TempleOS | Built with Rust & Ratatui
Built with Ratatui badge

"Rodent-obsessed developer creates Ratty to bring 3D graphics to the command line" - The Register
"This New Terminal is Absurd (But Totally Fun)" - It's FOSS
"10 weird OSS projects you need right now... " - Fireship
"Your terminal can render in 3D now, and Rust made it surprisingly usable" - MakeUseOf

Features

โ–ถ๏ธ Watch the demo video here!
๐Ÿ“š Read the behind the scenes blog post here!

3D mode

Ever wondered what's behind the terminal? Press Ctrl+Alt+Enter!

Installation

Packaging status

Requirements:

  • A GPU / graphics stack supported by Bevy and wgpu
  • Melted cheese (optional but recommended)

crates.io

cargo install ratty

Arch Linux

sudo pacman -S ratty

Nix

See the Nix packaging docs for flake, NixOS, and Home Manager usage.

nix run github:orhun/ratty

Binary releases

Prebuilt binaries are available on the GitHub releases page for direct download.

From Git

Requirements:

  • Rust toolchain with Cargo
  • on Bazzite / Bluefin: sudo rpm-ostree install gcc fontconfig-devel wayland-devel (then reboot)
  • on Debian / Ubuntu: sudo apt-get update ; sudo apt-get install gcc pkgconf libfontconfig-dev libwayland-dev
  • on Fedora: sudo dnf install gcc fontconfig-devel wayland-devel
cargo install --git https://github.com/orhun/ratty

Configuration

The default configuration file is available in config/ratty.toml.

You can copy this file to $HOME/.config/ratty/ratty.toml and customize it.

Changing the cursor

[cursor.model]
path = "CairoSpinyMouse.obj"
scale_factor = 6.0
brightness = 0.5
x_offset = 0.5
plane_offset = 18.0
visible = true

[cursor.animation]
spin_speed = 1.4
bob_speed = 2.2
bob_amplitude = 0.08

For cursor.model.path, Ratty supports both .obj, .glb, and .stl assets.

Other useful cursor fields are:

  • scale_factor: scales the model relative to the terminal cell size
  • brightness: adjusts the cursor material brightness
  • x_offset: shifts the cursor model horizontally inside the cell
  • plane_offset: pushes the cursor away from the warped terminal surface in 3D mode
  • visible: show the custom 3D cursor model instead of only the terminal cursor

Key Bindings

KeyAction
Ctrl+Alt+CCopy selection
Ctrl+Alt+VPaste clipboard
Ctrl+Alt+EnterToggle 2D / ortho 3D
Ctrl+Alt+PToggle perspective
Ctrl+Alt+MToggle Mobius mode
Ctrl+Alt+Shift+0-9Activate camera slot
Ctrl+Alt+UpIncrease warp
Ctrl+Alt+DownDecrease warp
Alt+PageUpScroll one page up
Alt+PageDownScroll one page down
Alt+UpScroll one line up
Alt+DownScroll one line down
Ctrl+=Increase font size
Ctrl+-Decrease font size
Ctrl+Alt+0Reset font size

In custom configs, ToggleOrtho3DMode is the current action name for the orthographic 3D toggle. The old Toggle3DMode action remains supported as a backward-compatible alias.

Camera slot actions are named ActivateCameraSlot0 through ActivateCameraSlot9. The extra Shift modifier keeps slot 0 distinct from the existing Ctrl+Alt+0 font reset.

Inline 3D objects

Ratty uses its own protocol, the Ratty Graphics Protocol, to place inline 3D objects in terminal space.

RGP supports:

  • registering .obj, .glb, and .stl assets by path
  • placing them at terminal cell anchors
  • animation, scale, color, depth and other attributes
  • camera control for flat, orthographic, perspective and Mobius views

There is a Ratatui widget called ratatui-rgp available in widget/ if you want to build your own terminal applications that involve inline 3D objects.

Examples

Big rat

Places a single oversized rat directly in your terminal. Press v in the demo to cycle the Ratty camera protocol through flat, orthographic, perspective and Mobius views.

Document

TempleOS-inspired document demo with editable text and embedded inline 3D objects:

Draw

Split-pane drawing demo with a 2D canvas on the left and a live 3D preview on the right:

Rubik's cube

Interactive 3D Rubik's cube demo:

Mobius Chess

A Mobius-strip chess demo:

Apps

Here are some applications explicitly built around Ratty's Graphics Protocol:

Ratscad

Terminal CAD:

[Ratty-runner](https://github.com/