explaingit

gyscos/cursive

4,792RustAudience · developerComplexity · 3/5LicenseSetup · easy

TLDR

Cursive is a Rust library for building terminal user interfaces with ready-made widgets like buttons, menus, dialogs, and input fields, no graphical window needed. Works on Windows, macOS, and Linux.

Mindmap

mindmap
  root((cursive))
    What it does
      Terminal UI library
      Keyboard navigation
      Screen redrawing
    Built-in Widgets
      Dialogs and buttons
      Text input fields
      Scrollable lists
    Tech stack
      Rust language
      crossterm backend
      crates.io package
    Use cases
      SSH tools
      CLI apps
      Games and clients
    Audience
      Rust developers
      CLI tool builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a terminal settings panel or configuration wizard that runs over SSH without needing a graphical desktop.

USE CASE 2

Create an interactive CLI tool with menus, dialogs, and keyboard navigation for internal DevOps or admin tasks.

USE CASE 3

Develop a text-based game or productivity app like a password manager or music client that runs in any terminal.

USE CASE 4

Add a polished interactive interface to a Rust CLI tool instead of relying on plain command-line flags.

Tech stack

Rustcrosstermcrates.ioTUI

Getting it running

Difficulty · easy Time to first run · 30min

Add cursive to Cargo.toml, default crossterm backend works on Windows, macOS, and Linux with no extra system dependencies. A three-part tutorial is included in the repo.

MIT license, free to use, modify, and distribute in personal or commercial projects with no major restrictions.

In plain English

Cursive is a Rust library for building text-based user interfaces that run inside a terminal window. Instead of a graphical window with pixels and mouse clicks, a TUI application uses characters, boxes drawn from text symbols, and keyboard navigation to create menus, dialogs, buttons, and input fields. This style of interface was common before graphical desktops and remains useful for tools that run over SSH, in CI environments, or anywhere a standard window system is not available. The library provides ready-made building blocks called views. These include text labels, text input fields, scrollable areas, select lists, checkboxes, dialog boxes with buttons, and menu bars. You compose your interface by layering and nesting these views. A short example in the README shows creating a dialog with a title, a text message, and a quit button in around eight lines of code. The library handles keyboard events, focus management, and redrawing the screen when content changes. Cursive works with multiple terminal backends. The default is crossterm, which supports Windows, macOS, and Linux without extra dependencies. Other backends can be swapped in for projects that already use a different terminal library. The community has published additional view types as separate crates covering things like calendar pickers, image display, tabs, tables, and a tmux-style multiplexer. The showcase section of the README lists real applications built with Cursive, ranging from a Spotify client and a Tetris game to a Stack Overflow browser and a password manager. This gives a sense of the range of complexity the library can handle. A three-part written tutorial is included in the repository for getting started. The library is licensed under MIT and is available on crates.io, the standard Rust package registry.

Copy-paste prompts

Prompt 1
I'm using the Rust cursive crate. Show me how to create a dialog box with a title, a text message, and two buttons (OK and Cancel) that prints which button was pressed.
Prompt 2
Using cursive in Rust, how do I build a scrollable select list that lets the user pick one item from a long list and then shows their choice in a new dialog?
Prompt 3
I want to add a menu bar to my cursive TUI app in Rust with File and Help menus, each containing two items. Show me the complete code to set this up.
Prompt 4
How do I swap the default crossterm backend in cursive for a different terminal backend, and what do I need to change in Cargo.toml?
Prompt 5
I'm building a terminal app with cursive in Rust. How do I handle a custom keyboard shortcut globally so that pressing Ctrl+Q quits the application from anywhere in the UI?
Open on GitHub → Explain another repo

← gyscos on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.