ratatui

ratatui is a skill for Claude Code, Codex from JSK9999/ai-nexus. It costs 37 tokens per session (1,474 once invoked), scanned A, original, Apache-2.0.

A guide to building terminal user interfaces in Rust with Ratatui, a library for drawing interactive screens inside a terminal.

In plain words
What is it for?
Use it when creating Rust terminal applications, immediate-mode interfaces that redraw from current state, background tasks, or production command-line tools.
Why use it?
It gives implementation guidance for handling terminal events, rendering screens, and setting up a Rust project with the stated libraries and versions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating Rust terminal applications, immediate-mode interfaces that redraw from current state, background tasks, or production command-line tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jsk9999/ai-nexus/ratatui_rs
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add JSK9999/ai-nexus --skill ratatui_rs
Clone the repo
git clone --depth 1 https://github.com/JSK9999/ai-nexus

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ratatui

README.md
[![agentmods](https://agentmods.dev/badge/skills/jsk9999/ai-nexus/ratatui_rs/github.svg)](https://agentmods.dev/skills/jsk9999/ai-nexus/ratatui_rs)
Your own site
<a href="https://agentmods.dev/skills/jsk9999/ai-nexus/ratatui_rs"><img src="https://agentmods.dev/badge/skills/jsk9999/ai-nexus/ratatui_rs/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ratatui

Your own site · 80×15
<a href="https://agentmods.dev/skills/jsk9999/ai-nexus/ratatui_rs"><img src="https://agentmods.dev/badge/skills/jsk9999/ai-nexus/ratatui_rs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,474 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01474
Opus 5 $0.00018 $0.00737
Sonnet 5 $0.00007 $0.00295
Haiku 4.5 $0.00004 $0.00147

Measured 11d ago against content hash 16e2d06b4f52, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ratatui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

config/skills/ratatui_rs/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ratatui (Rust TUI)

Immediate-mode terminal UI framework for Rust using Crossterm backend.

Project Setup

Always use Edition 2024:

[package]
name = "my-tui-app"
version = "0.1.0"
edition = "2024"
rust-version = "1.85"

[dependencies]
ratatui = "0.30"
crossterm = "0.29"
# Optional: Enhanced error handling
anyhow = "1.0"
thiserror = "2.0"

Why Edition 2024 for TUI apps:

  • ✅ Better async support for background tasks
  • ✅ Improved pattern matching for event handling
  • ✅ Cleaner error handling with if let chains
  • ✅ Native async traits for plugins/extensions

Basic Application

use crossterm::{
    event::{self, Event, KeyCode},
    execute,
    terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use ratatui::{backend::CrosstermBackend, widgets::{Block, Borders, Paragraph}, Terminal};
use std::io;

struct App {
    counter: i32,
}

impl App {
    fn new() -> App {
        App { counter: 0 }
    }

    fn on_key(&mut self, key: KeyCode) {
        match key {
            KeyCode::Up => self.counter += 1,
            KeyCode::Down => self.counter -= 1,
            _ => {}
        }
    }
}

fn main() -> Result<(), io::Error> {
    enable_raw_mode()?;
    let mut stdout = io::stdout();
    execute!(stdout, EnterAlternateScreen)?;

    let backend = CrosstermBackend::new(stdout);
    let mut terminal = Terminal::new(backend)?;

    let mut app = App::new();

    loop {
        terminal.draw(|f| {
            let block = Block::default().title("Counter").borders(Borders::ALL);
            let paragraph = Paragraph::new(format!("Count: {}", app.counter)).block(block);
            f.render_widget(paragraph, f.area());
        })?;

        if let Event::Key(key) = event::read()? {
            match key.code {
                KeyCode::Char('q') => break,
                code => app.on_key(code),
            }
        }
    }

    disable_raw_mode()?;
    execute!(terminal.backend_mut(), LeaveAlternateScreen)?;
    Ok(())
}

Read the full file on GitHub · 248 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 248 lines · 37 tokens per session scan A 16e2d06b4f52

Subscribe to this mod's changes

ratatui is a skill published in the GitHub repository JSK9999/ai-nexus (19 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 1,474 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.