{"id":24851914,"url":"https://github.com/m-lima/rucline","last_synced_at":"2025-10-14T22:31:08.648Z","repository":{"id":52055896,"uuid":"254338408","full_name":"m-lima/rucline","owner":"m-lima","description":"(Rust CLI line /rɪˈklaɪn/), a Rust line reader UTF-8 capable and with autosuggestions and autocompletions","archived":false,"fork":false,"pushed_at":"2023-03-20T18:49:10.000Z","size":223,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T08:08:03.005Z","etag":null,"topics":["autocompletions","rust","rust-cli"],"latest_commit_sha":null,"homepage":"","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/m-lima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-09T10:17:37.000Z","updated_at":"2022-10-20T09:56:45.000Z","dependencies_parsed_at":"2022-08-31T01:01:14.684Z","dependency_job_id":null,"html_url":"https://github.com/m-lima/rucline","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lima%2Frucline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lima%2Frucline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lima%2Frucline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lima%2Frucline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-lima","download_url":"https://codeload.github.com/m-lima/rucline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236528860,"owners_count":19163717,"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":["autocompletions","rust","rust-cli"],"created_at":"2025-01-31T14:27:27.213Z","updated_at":"2025-10-14T22:31:03.304Z","avatar_url":"https://github.com/m-lima.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rucline\n[![Github](https://github.com/m-lima/rucline/workflows/build/badge.svg)](https://github.com/m-lima/rucline/actions?workflow=build)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Cargo](https://img.shields.io/crates/v/rucline.svg)](https://crates.io/crates/rucline)\n[![Documentation](https://docs.rs/rucline/badge.svg)](https://docs.rs/rucline)\n\n![demo](docs/demo.gif)\n\u003e Code for demo above available at [examples/multiple.rs](../../blob/master/examples/multiple.rs)\n\nRucline, the Rust CLI Line reader, or simply \"recline\", is a cross-platform, UTF-8 compatible\nline reader that provides hooks for autocompletion and drop-down suggestion. It supports advanced\nediting [`actions`] and hooks for customizing the line reader behavior making it more flexible\nthan simply reading from `stdin`.\n\n#### Basic usage:\n\n```rust\nuse rucline::Outcome::Accepted;\nuse rucline::prompt::{Builder, Prompt};\n\nif let Ok(Accepted(string)) = Prompt::from(\"What's you favorite website? \")\n    // Add some tab completions (Optional)\n    .suggester(vec![\n        \"https://www.rust-lang.org/\",\n        \"https://docs.rs/\",\n        \"https://crates.io/\",\n    ])\n    //Block until value is ready\n    .read_line()\n{\n    println!(\"'{}' seems to be your favorite website\", string);\n}\n```\n\n## Actions\n\nRucline's behavior can be customized and composed with use of [`actions`].\n\nThere is a built-in set of default [`actions`] that will be executed upon user interaction.\nThese are meant to feel natural when coming from the default terminal, while also adding further\nfunctionality and editing commands. For example, a few of the built-ins:\n* `Tab`: cycle through completions\n* `Shift` + `Tab`: cycle through completions in reverse\n* `CTRL` + `W`: delete the current word\n* `CTRL` + `J`: delete until the beginning of the word\n* `CTRL` + `K`: delete until the end of the word\n* `CTRL` + `U`: delete the whole line\n* `CTRL` + `H`: delete until the beggining of the line\n* `CTRL` + `L`: delete until the end of the line\n\n\u003e See [`Action`][`actions`] for the full default behavior specification\n\nThe default behavior can be customized by overriding user [`events`] with [`actions`]. Which\nin turn can be serialized, stored, and loaded at run-time with the `config-serde` feature flag.\n\n\n#### Overriding key bindings\n\n```rust\nuse rucline::Outcome::Accepted;\nuse rucline::actions::{Action, Event, KeyBindings, KeyCode, Range};\nuse rucline::prompt::{Builder, Prompt};\n\nlet mut bindings = KeyBindings::new();\n\n// Accept the full suggestions if `right` is pressed\nbindings.insert(Event::from(KeyCode::Right), Action::Complete(Range::Line));\n\nif let Ok(Accepted(string)) = Prompt::from(\"What's you favorite website? \")\n    // Add some likely values as completions\n    .completer(vec![\n        \"https://www.rust-lang.org/\",\n        \"https://docs.rs/\",\n        \"https://crates.io/\",\n    ])\n    // Set the new key bindings as an override\n    .overrider(bindings)\n    //Block until value is ready\n    .read_line()\n{\n    println!(\"'{}' seems to be your favorite website\", string);\n}\n```\n\n[`actions`]: ../../blob/master/src/actions.rs\n[`events`]: ../../blob/master/src/actions.rs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-lima%2Frucline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-lima%2Frucline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-lima%2Frucline/lists"}