MCPcopy Index your code
hub / github.com/asciinema/avt

github.com/asciinema/avt @v0.18.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.18.0 ↗ · + Follow
461 symbols 1,428 edges 19 files 0 documented · 0% updated 2mo agov0.18.0 · 2026-05-05★ 2274 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

avt - asciinema virtual terminal

Test Crates.io

avt is asciinema's implementation of virtual terminal emulator written in Rust.

It is used by asciinema CLI, asciinema player, asciinema server and asciinema gif generator.

This implementation covers only parsing and virtual buffer related aspects of a terminal emulator as it's all asciinema needs.

avt consists of:

  • parser for ANSI-compatible video terminal based on excellent state diagram by Paul Williams,
  • virtual screen buffers (primary/alternate) in a form of character grid with additional color/styling attributes,
  • API for feeding text into the parser and for querying virtual screen buffer and cursor position.

Following aspects of terminal emulation are not in scope of this project:

  • input handling,
  • rendering.

While avt is small and focused, a full-fledged terminal emulator could potentially be built on top of it.

avt doesn't try to 100% replicate any specific terminal variant like VT102 or VT520, instead it implements most control sequences supported by modern terminal emulators like xterm, Gnome Terminal, WezTerm, Alacritty, iTerm, Ghostty, mosh etc.

Building

Building avt from source requires the Rust compiler (1.82 or later) and the Cargo package manager. If they are not available via your system package manager then use rustup.

To download the source code and build the library run:

git clone https://github.com/asciinema/avt
cd avt
cargo build --release

To run the test suite:

cargo test

To run the benchmarks:

cargo bench

Donations

Sustainability of asciinema development relies on donations and sponsorships.

Please help the software project you use and love. Become a supporter or a corporate sponsor.

asciinema is sponsored by:

Consulting

If you're interested in customization of avt or any other asciinema component to suit your corporate needs, check asciinema consulting services.

License

© 2019 Marcin Kulik.

All code is licensed under the Apache License, Version 2.0. See LICENSE file for details.

Core symbols most depended-on inside this repo

execute
called by 237
src/terminal.rs
push
called by 92
src/util.rs
feed
called by 80
src/terminal.rs
as_u16
called by 44
src/parser.rs
len
called by 38
src/line.rs
push_csi
called by 34
src/parser.rs
resize
called by 30
src/terminal.rs
dec_modes
called by 30
src/terminal.rs

Shape

Method 241
Function 176
Class 22
Enum 22

Languages

Rust100%

Modules by API surface

src/terminal.rs183 symbols
src/parser.rs74 symbols
src/vt.rs48 symbols
src/buffer.rs36 symbols
src/line.rs29 symbols
src/pen.rs23 symbols
src/tabs.rs12 symbols
src/util.rs11 symbols
src/cell.rs11 symbols
benches/vt.rs8 symbols
src/terminal/dirty_lines.rs7 symbols
src/terminal/cursor.rs4 symbols

For agents

$ claude mcp add avt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page