gyscos /cursive

A Text User Interface library for the Rust programming language

★ 4,863⑂ 272👁 35⑃ 271● 560▤ 50
RustMITCreated 2015-05-09
下载:cursive-core-v0.4.6cursive-core-v0.4.6 ↓0.4.62025-10-14
+0
日增长
4,863
stars
272
forks
35
watchers
271
prs
560
issues
50
releases

README

Cursive







Cursive is a TUI (Text User Interface) library for rust. It uses the [crossterm] backend by default, but other backends are available.

It allows you to build rich user interfaces for terminal applications.

[crossterm]: https://github.com/crossterm-rs/crossterm

 Documentation

It is designed to be safe and easy to use:

toml
[dependencies]
cursive = "0.21"


Or to use the latest git version:

toml
[dependencies]
cursive = { git = "https://github.com/gyscos/cursive" }


rust,no_run
use cursive::views::{Dialog, TextView};

fn main() {
    // Creates the cursive root - required for every application.
    let mut siv = cursive::default();

    // Creates a dialog with a single "Quit" button
    siv.add_layer(Dialog::around(TextView::new("Hello Dialog!"))
                         .title("Cursive")
                         .button("Quit", |s| s.quit()));

    // Starts the event loop.
    siv.run();
}




Larger applications can look like this (showcase example):



Check out the other examples to get these results, and more:










_(Colors may depend on your terminal configuration.)_

 Tutorials

These tutorials may help you get started with cursive:

 Starting with cursive: (1/3)
 Starting with cursive: (2/3)
 Starting with cursive: (3/3)

 Third-party views

Here are a few crates implementing new views for you to use:

 cursive-aligned-view: A view wrapper which aligns child views.
 cursive-async-view: A loading-screen wrapper.
 cursive_calendar_view: A basic calendar view implementation.
 cursive-flexi-logger-view: An alternative debug view using flexi_logger.
 cursive_hexview: A simple hexview.
 cursive-hjkl: Wraps any view to use Vim-like hjkl controls.
 cursive-image: A graphical image view. Supported formats include PNG, GIF, JPEG, SVG, and PDF.
 cursive-markup: A view that renders HTML or other markup.
 cursive-multiplex: A tmux like multiplexer.
 cursive-spinner-view: A spinner view.
 cursive-split-panel: A split panel view with a movable divider. 
 cursive_table_view: A basic table view component.
 cursive-tabs: Tabs.
 cursive-tree: A tree view implementation.

 Showcases

Here are some cool applications using cursive:

 RustyChat: Chat client made using Rust and Cursive.
 checkline: Checkbox line picker from stdin to stdout.
 clock-cli: A clock with stopwatch and countdown timer functionalities.
 fui: Add CLI & form interface to your program.
 game2048-rs: a tui game2048 using Rust and cursive.
 git-branchless: Branchless workflow for Git.
 grin-tui: Minimal implementation of the MimbleWimble protocol.
 kakikun: A paint and ASCII art application for the terminal.
 launchk: Manage launchd agents and daemons on macOS.
 markline: Marker-based line picker from stdin to stdout.
 mythra: CLI to search for music.
 ncspot: Cross-platform ncurses Spotify client.
 rbmenu-tui: A TUI for bookmark management.
 retris: A simple implementation of the classic tetris game.
 ripasso: A simple password manager written in Rust.
 rusty-man:

Top issues

Discussions

Latest release

cursive-core-v0.4.6 cursive-core-v0.4.6 2025-10-14
Remove serde_yaml dependency (moved to dev-dependency)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON