{"id":28629173,"url":"https://github.com/odd12258053/interaction","last_synced_at":"2025-06-12T11:41:35.031Z","repository":{"id":62440980,"uuid":"328946724","full_name":"odd12258053/interaction","owner":"odd12258053","description":"Interaction is a minimal and a simple readline library for Rust.","archived":false,"fork":false,"pushed_at":"2021-01-17T12:24:02.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T06:00:34.951Z","etag":null,"topics":["cli","crates","multi","readline","readline-library","rust"],"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/odd12258053.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":"2021-01-12T10:12:59.000Z","updated_at":"2021-01-17T12:26:53.000Z","dependencies_parsed_at":"2022-11-01T21:53:43.233Z","dependency_job_id":null,"html_url":"https://github.com/odd12258053/interaction","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/odd12258053/interaction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odd12258053%2Finteraction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odd12258053%2Finteraction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odd12258053%2Finteraction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odd12258053%2Finteraction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odd12258053","download_url":"https://codeload.github.com/odd12258053/interaction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odd12258053%2Finteraction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259456989,"owners_count":22860645,"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":["cli","crates","multi","readline","readline-library","rust"],"created_at":"2025-06-12T11:41:15.746Z","updated_at":"2025-06-12T11:41:35.004Z","avatar_url":"https://github.com/odd12258053.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interaction\n![Crates.io](https://img.shields.io/crates/l/interaction)\n[![Crates.io](https://img.shields.io/crates/v/interaction.svg)](https://crates.io/crates/interaction)\n\nInteraction is a minimal and a simple readline library for Rust.\n\n## Features\n* Single line editing mode\n* Multi line editing mode\n* Key bindings\n* History\n* Completion\n\n# Usage\nAdd this in your `Cargo.toml`:\n\n```toml\n[dependencies]\ninteraction = \"0.3.4\"\n```\n\nOr, if you installed [cargo-edit](https://github.com/killercup/cargo-edit), you run this command:\n\n```sh\n$ cargo add interaction\n```\n\n# Example\n\n```rust\nuse interaction::InteractionBuilder;\nuse std::io;\n\nfn main() {\n    let history_file = \"./.example_history\";\n    let mut inter = InteractionBuilder::new()\n        .prompt_str(\";;\u003e\")\n        .history_limit(5)\n        .completion(|_input, completions| {\n            completions.push(b\"foo\".to_vec());\n            completions.push(b\"bar\".to_vec());\n        })\n        .load_history(history_file)\n        .unwrap()\n        .build();\n    loop {\n        match inter.line() {\n            Ok(input) =\u003e {\n                // write any code.\n            }\n            Err(e) if e.kind() == io::ErrorKind::Interrupted =\u003e {\n                inter.save_history(history_file).unwrap();\n                break;\n            }\n            Err(_) =\u003e {\n                break;\n            }\n        }\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodd12258053%2Finteraction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodd12258053%2Finteraction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodd12258053%2Finteraction/lists"}