{"id":13541380,"url":"https://github.com/nushell/reedline","last_synced_at":"2026-04-11T20:17:15.632Z","repository":{"id":37051672,"uuid":"343068432","full_name":"nushell/reedline","owner":"nushell","description":"A feature-rich line editor - powering Nushell","archived":false,"fork":false,"pushed_at":"2025-04-22T12:19:06.000Z","size":1242,"stargazers_count":614,"open_issues_count":144,"forks_count":169,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-27T20:04:03.959Z","etag":null,"topics":["line-editor","nushell","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/reedline/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nushell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-28T09:42:07.000Z","updated_at":"2025-04-27T18:51:14.000Z","dependencies_parsed_at":"2023-02-16T11:46:01.596Z","dependency_job_id":"a4e82f87-7456-492d-a183-8741f14c6381","html_url":"https://github.com/nushell/reedline","commit_stats":{"total_commits":432,"total_committers":62,"mean_commits":6.967741935483871,"dds":0.6759259259259259,"last_synced_commit":"86beb8793e9fa910eada7929f50ea78207590a69"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Freedline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Freedline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Freedline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Freedline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nushell","download_url":"https://codeload.github.com/nushell/reedline/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254010813,"owners_count":21998995,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["line-editor","nushell","rust"],"created_at":"2024-08-01T10:00:45.585Z","updated_at":"2026-04-11T20:17:15.622Z","avatar_url":"https://github.com/nushell.png","language":"Rust","readme":"# A feature-rich line editor - powering Nushell\n\n![GitHub](https://img.shields.io/github/license/nushell/reedline)\n[![Crates.io](https://img.shields.io/crates/v/reedline)](https://crates.io/crates/reedline)\n[![docs.rs](https://img.shields.io/docsrs/reedline)](https://docs.rs/reedline/)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nushell/reedline/ci.yml?branch=main)\n[![codecov](https://codecov.io/gh/nushell/reedline/graph/badge.svg?token=NUTC465WOL)](https://codecov.io/gh/nushell/reedline)\n[![Discord](https://img.shields.io/discord/601130461678272522.svg?logo=discord)](https://discord.gg/NtAbbGn)\n\n## Introduction\n\nReedline is a project to create a line editor (like bash's `readline` or zsh's `zle`) that supports many of the modern conveniences of CLIs, including syntax highlighting, completions, multiline support, Unicode support, and more.\nIt is currently primarily developed as the interactive editor for [nushell](https://github.com/nushell/nushell) (starting with `v0.60`) striving to provide a pleasant interactive experience.\n\n## Outline\n\n- [Examples](#examples)\n  - [Basic example](#basic-example)\n  - [Integrate with custom keybindings](#integrate-with-custom-keybindings)\n  - [Integrate with `History`](#integrate-with-history)\n  - [Integrate with custom syntax `Highlighter`](#integrate-with-custom-syntax-highlighter)\n  - [Integrate with custom tab completion](#integrate-with-custom-tab-completion)\n  - [Integrate with `Hinter` for fish-style history autosuggestions](#integrate-with-hinter-for-fish-style-history-autosuggestions)\n  - [Integrate with custom line completion `Validator`](#integrate-with-custom-line-completion-validator)\n  - [Use custom `EditMode`](#use-custom-editmode)\n- [Crate features](#crate-features)\n- [Are we prompt yet? (Development status)](#are-we-prompt-yet-development-status)\n- [Contributing](./CONTRIBUTING.md)\n- [Alternatives](#alternatives)\n\n## Examples\n\nFor the full documentation visit \u003chttps://docs.rs/reedline\u003e. The examples should highlight how you enable the most important features or which traits can be implemented for language-specific behavior.\n\n### Basic example\n\n```rust,no_run\n// Create a default reedline object to handle user input\n\nuse reedline::{DefaultPrompt, Reedline, Signal};\n\nlet mut line_editor = Reedline::create();\nlet prompt = DefaultPrompt::default();\n\nloop {\n    let sig = line_editor.read_line(\u0026prompt);\n    match sig {\n        Ok(Signal::Success(buffer)) =\u003e {\n            println!(\"We processed: {}\", buffer);\n        }\n        Ok(Signal::CtrlD) | Ok(Signal::CtrlC) =\u003e {\n            println!(\"\\nAborted!\");\n            break;\n        }\n        x =\u003e {\n            println!(\"Event: {:?}\", x);\n        }\n    }\n}\n```\n\n### Integrate with custom keybindings\n\n```rust\n// Configure reedline with custom keybindings\n\n//Cargo.toml\n//    [dependencies]\n//    crossterm = \"*\"\n\nuse {\n  crossterm::event::{KeyCode, KeyModifiers},\n  reedline::{default_emacs_keybindings, EditCommand, Reedline, Emacs, ReedlineEvent},\n};\n\nlet mut keybindings = default_emacs_keybindings();\nkeybindings.add_binding(\n    KeyModifiers::ALT,\n    KeyCode::Char('m'),\n    ReedlineEvent::Edit(vec![EditCommand::BackspaceWord]),\n);\nlet edit_mode = Box::new(Emacs::new(keybindings));\n\nlet mut line_editor = Reedline::create().with_edit_mode(edit_mode);\n```\n\n### Integrate with `History`\n\n```rust,no_run\n// Create a reedline object with history support, including history size limits\n\nuse reedline::{FileBackedHistory, Reedline};\n\nlet history = Box::new(\n  FileBackedHistory::with_file(5, \"history.txt\".into())\n    .expect(\"Error configuring history with file\"),\n);\nlet mut line_editor = Reedline::create()\n  .with_history(history);\n```\n\n### Integrate with custom syntax `Highlighter`\n\n```rust\n// Create a reedline object with highlighter support\n\nuse reedline::{ExampleHighlighter, Reedline};\n\nlet commands = vec![\n  \"test\".into(),\n  \"hello world\".into(),\n  \"hello world reedline\".into(),\n  \"this is the reedline crate\".into(),\n];\nlet mut line_editor =\nReedline::create().with_highlighter(Box::new(ExampleHighlighter::new(commands)));\n```\n\n### Integrate with custom tab completion\n\n```rust\n// Create a reedline object with tab completions support\n\nuse reedline::{default_emacs_keybindings, ColumnarMenu, DefaultCompleter, Emacs, KeyCode, KeyModifiers, Reedline, ReedlineEvent, ReedlineMenu, MenuBuilder};\n\nlet commands = vec![\n  \"test\".into(),\n  \"hello world\".into(),\n  \"hello world reedline\".into(),\n  \"this is the reedline crate\".into(),\n];\nlet completer = Box::new(DefaultCompleter::new_with_wordlen(commands.clone(), 2));\n// Use the interactive menu to select options from the completer\nlet completion_menu = Box::new(ColumnarMenu::default().with_name(\"completion_menu\"));\n// Set up the required keybindings\nlet mut keybindings = default_emacs_keybindings();\nkeybindings.add_binding(\n    KeyModifiers::NONE,\n    KeyCode::Tab,\n    ReedlineEvent::UntilFound(vec![\n        ReedlineEvent::Menu(\"completion_menu\".to_string()),\n        ReedlineEvent::MenuNext,\n    ]),\n);\n\nlet edit_mode = Box::new(Emacs::new(keybindings));\n\nlet mut line_editor = Reedline::create()\n    .with_completer(completer)\n    .with_menu(ReedlineMenu::EngineCompleter(completion_menu))\n    .with_edit_mode(edit_mode);\n```\n\n### Integrate with `Hinter` for fish-style history autosuggestions\n\n```rust\n// Create a reedline object with in-line hint support\n\n//Cargo.toml\n//  [dependencies]\n//  nu-ansi-term = \"*\"\n\nuse {\n  nu_ansi_term::{Color, Style},\n  reedline::{DefaultHinter, Reedline},\n};\n\nlet mut line_editor = Reedline::create().with_hinter(Box::new(\n  DefaultHinter::default()\n  .with_style(Style::new().italic().fg(Color::LightGray)),\n));\n```\n\n### Integrate with custom line completion `Validator`\n\n```rust\n// Create a reedline object with line completion validation support\n\nuse reedline::{DefaultValidator, Reedline};\n\nlet validator = Box::new(DefaultValidator);\n\nlet mut line_editor = Reedline::create().with_validator(validator);\n```\n\n### Use custom `EditMode`\n\n```rust\n// Create a reedline object with custom edit mode\n// This can define a keybinding setting or enable vi-emulation\n\nuse reedline::{\n    default_vi_insert_keybindings, default_vi_normal_keybindings, EditMode, Reedline, Vi,\n};\n\nlet mut line_editor = Reedline::create().with_edit_mode(Box::new(Vi::new(\n    default_vi_insert_keybindings(),\n    default_vi_normal_keybindings(),\n)));\n```\n\n## Crate features\n\n- `clipboard`: Enable support to use the `SystemClipboard`. Enabling this feature will return a `SystemClipboard` instead of a local clipboard when calling `get_default_clipboard()`.\n- `bashisms`: Enable support for special text sequences that recall components from the history. e.g. `!!` and `!$`. For use in shells like `bash` or [`nushell`](https://nushell.sh).\n- `sqlite`: Provides the `SqliteBackedHistory` to store richer information in the history. Statically links the required sqlite version.\n- `sqlite-dynlib`: Alternative to the feature `sqlite`. Will not statically link. Requires `sqlite \u003e= 3.38` to link dynamically!\n- `external_printer`: **Experimental:** Thread-safe `ExternalPrinter` handle to print lines from concurrently running threads.\n\n## Are we prompt yet? (Development status)\n\nReedline has now all the basic features to become the primary line editor for [nushell](https://github.com/nushell/nushell\n)\n\n- General editing functionality, that should feel familiar coming from other shells (e.g. bash, fish, zsh).\n- Configurable keybindings (emacs-style bindings and basic vi-style).\n- Configurable prompt\n- Content-aware syntax highlighting.\n- Autocompletion (With graphical selection menu or simple cycling inline).\n- History with interactive search options (optionally persists to file, can support multiple sessions accessing the same file)\n- Fish-style history autosuggestion hints\n- Undo support.\n- Clipboard integration\n- Line completeness validation for seamless entry of multiline command sequences.\n- Visual selection\n\n### Areas for future improvements\n\n- [ ] Support for Unicode beyond simple left-to-right scripts\n- [ ] Easier keybinding configuration\n- [ ] Support for more advanced vi commands\n- [ ] Smooth experience if completion or prompt content takes long to compute\n- [ ] Support for a concurrent output stream from background tasks to be displayed, while the input prompt is active. (\"Full duplex\" mode)\n\nFor more ideas check out the [feature discussion](https://github.com/nushell/reedline/issues/63) or hop on the `#reedline` channel of the [nushell discord](https://discordapp.com/invite/NtAbbGn).\n\n### Alternatives\n\nFor currently more mature Rust line editing check out:\n\n- [rustyline](https://crates.io/crates/rustyline)\n","funding_links":[],"categories":["Reedline Integrations"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnushell%2Freedline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnushell%2Freedline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnushell%2Freedline/lists"}