Crossterm

A pure-Rust, cross-platform terminal manipulation library

Library
Cargo
v0.29.0
4,233 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
81 /100 Excellent
Development Activity 80
Maintenance 72
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 82
Code Quality 76
Innovation 70
Learning Curve 75

Crossterm is a pure-Rust library for cross-platform terminal manipulation, covering cursor movement, text styling and colors, raw/alternate screen modes, and keyboard/mouse/resize event handling. It supports UNIX and Windows terminals down to Windows 7 with a single unified API, abstracting away the very different underlying terminal APIs each platform exposes.

Crossterm is one of the most widely depended-upon crates in the Rust TUI ecosystem, serving as the terminal backend for higher-level TUI frameworks like Ratatui, and is used directly by countless CLI tools that need styled output, interactive prompts, or full-screen terminal UIs without shelling out to platform-specific APIs.

What You Get

  • Cursor control: move, hide/show, blink, save/restore position
  • Styled output: 16-color, 256-color (ANSI), and RGB foreground/background colors plus text attributes (bold, italic, underline)
  • Terminal control: raw mode, alternate screen, scroll, resize, clear, and title-setting
  • A unified event system for keyboard, mouse (press/release/drag), and terminal-resize events with modifier key support
  • A command API (queue!/execute! macros) for buffered, flush-controlled output writing
  • Clipboard integration and bracketed-paste event support

Common Use Cases

  • Building full-screen terminal UIs (TUIs) as the low-level backend beneath frameworks like Ratatui
  • Adding cross-platform colored/styled output to CLI tools without shelling out to OS-specific APIs
  • Building interactive terminal applications that need mouse and keyboard event handling (editors, dashboards, games)
  • Writing portable terminal tooling that must behave identically on Windows and UNIX terminals

Under The Hood

Architecture — The crate is organized by terminal concern: src/cursor/, src/style/, src/terminal/, and src/event/ each expose a public module plus platform-specific backend implementations selected at compile time (UNIX ANSI escape-sequence writers vs Windows Console API calls), unified behind a common Command trait (src/command.rs) so callers write one line of code (execute!(stdout, MoveTo(x, y))) regardless of platform. src/tty.rs and src/ansi_support.rs handle detecting whether a stream is a real TTY and whether the terminal actually supports ANSI sequences (relevant on older Windows consoles), falling back accordingly.

Tech Stack — Pure Rust with a deliberately minimal dependency footprint (a stated design goal in the README’s ‘Dependency Justification’ section), using conditional compilation (cfg(windows)/cfg(unix)) rather than separate crates per platform. Feature flags (bracketed-paste, events, windows, derive-more) let consumers opt out of functionality they don’t need to shrink the dependency graph further, similar to other console-rs-family crates.

Code Quality — Roughly 19 source files carry inline #[test]/mod test blocks covering event parsing, cursor/style command construction, and platform-detection logic — reasonable given how much of the remaining logic is platform-specific behavior that’s difficult to unit test outside a real terminal. The crate has a long release history and is depended upon by enough downstream TUI projects (notably Ratatui) that regressions tend to surface quickly through the ecosystem.

API Design — The Command/execute!/queue! macro pair is the core ergonomic device: every terminal action (MoveTo, SetForegroundColor, Clear) implements Command, so execute!(stdout(), MoveTo(0,0), Print("hi")) composes multiple actions into one buffered write without manual escape-sequence construction. This consistency is what makes Crossterm pleasant to build directly on, though full-screen TUI application authors still typically reach for a higher-level framework (Ratatui) built on top rather than using Crossterm’s primitives directly for complex layouts.

Used by 10 apps in this directory

Rust
99%
MIT

abtop

Developer Tools · Monitoring

3,669

Like htop, but for your AI coding agents — monitor Claude Code, Codex CLI, and OpenCode sessions, tokens, context windows, rate limits, and orphan ports all from one terminal screen.

View details
74
Repo Health
79
Technical
78
Dependency
Built with
Rust 99%
Updated 2 weeks ago
Rust
54%
Other

Cameleer

AI Agents

23

A local-first desktop workspace for managing AI agents in an enterprise-style workflow — agent directory, Kanban task tracking, workspace chat, and a full runtime/audit log of agent actions and tool approvals.

View details
40
Repo Health
65
Technical
76
Dependency
Built with
Rust 54%
JavaScript 24%
TypeScript 15%
Updated 2 months ago
Rust
95%
MIT

claw-code

AI Agents · AI Code Assistants

195,291

A Rust-built CLI agent harness for Claude AI with persistent sessions, MCP tool integration, plugin hooks, and multi-provider support — designed to run autonomous coding workflows without human babysitting.

View details
51
Repo Health
71
Technical
77
Dependency
Built with
Rust 95%
Updated 1 months ago
Rust
88%
GPL 2.0

Fresh

Code Editors · Developer Tools

9,052

A zero-configuration terminal text editor with familiar keybindings, full mouse support, LSP-powered IDE features, and a built-in orchestrator for running multiple coding agents in parallel worktrees.

View details
86
Repo Health
88
Technical
71
Dependency
Built with
Rust 88%
Updated 5 days ago
Rust
94%
Apache 2.0

herdr

AI Agents · Developer Tools

41,057

A terminal-native agent multiplexer that runs Claude, Codex, Gemini, and other coding agents side by side in real, persistent panes you can detach from and reattach to from anywhere.

View details
84
Repo Health
84
Technical
72
Dependency
Built with
Rust 94%
Updated 5 days ago
Rust
37%
Other

Hook0

Devops

1,491

Open-source Webhooks-as-a-Service: deliver events to your users with auto-retry, signed payloads, and a real-time subscriber dashboard — all without building the infrastructure yourself.

View details
82
Repo Health
82
Technical
69
Dependency
Built with
Rust 37%
TypeScript 12%
Updated 1 weeks ago
Rust
71%
Apache 2.0

mesh-llm

AI Agents · AI Development

3,463

Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.

View details
84
Repo Health
91
Technical
69
Dependency
Built with
Rust 71%
TypeScript 13%
Python 10%
Updated 4 days ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 4 days ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers