Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# AGENTS.md

## Cursor Cloud specific instructions

Glass is a single Rust crate (edition 2024) — a terminal Markdown editor (TUI) built with
Ratatui. There are no services, databases, or network ports; it's a self-contained binary.

### Toolchain caveats (non-obvious)
- Edition 2024 requires a recent stable Rust (≥ 1.85). The pre-baked image may ship an older
default toolchain; the environment is set up to use `stable` (currently 1.96).
- The `tree-sitter-markdown` dependency compiles C++ via `cc-rs`. On this image the default
`cc`/`c++` alternatives point at `clang`, and `clang` is invoked with
`--target=x86_64-unknown-linux-gnu`, which fails to locate the GNU libstdc++ headers
(`fatal error: 'cassert' file not found`). The environment fixes this by switching the
`cc`/`c++` alternatives to GCC (`update-alternatives --set c++ /usr/bin/g++`,
`--set cc /usr/bin/gcc`). If you ever hit a `cassert`/C++ stdlib build error, re-apply that,
or build with `CC=gcc CXX=g++ cargo build`.

### Lint / test / build / run
Authoritative checks mirror `.github/workflows/ci.yml`:
- Format/lint: `cargo fmt --all -- --check`
- Tests: `cargo test --locked` (inline `#[cfg(test)]` modules; no `tests/` dir)
- Build (dev): `cargo build`; release: `cargo build --release --locked`
- Run interactively (needs a TTY): `cargo run -- <path>` or `./target/release/glass <path>`
- Headless/automated rendering (no TTY): `./target/release/glass --render [--width N] [--height N] <path>`
also auto-renders when stdout is piped/redirected. Use this for non-interactive verification.

### Manual GUI testing
- Use the **Ghostty** terminal emulator for interactive/manual testing of the TUI (preferred).
It's installed and registered as `x-terminal-emulator`; launch with `ghostty &`.
- Ghostty runs over OpenGL via the GTK runtime; it works in the VM's software renderer. The
GTK/cgroup/empty-config warnings it prints at startup are harmless and don't affect the editor.