{"id":13414917,"url":"https://github.com/tonerdo/readline","last_synced_at":"2025-04-10T06:17:55.889Z","repository":{"id":47658541,"uuid":"79130594","full_name":"tonerdo/readline","owner":"tonerdo","description":"A Pure C# GNU-Readline like library for .NET/.NET Core","archived":false,"fork":false,"pushed_at":"2021-08-19T10:49:20.000Z","size":87,"stargazers_count":810,"open_issues_count":26,"forks_count":77,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-06T22:17:24.556Z","etag":null,"topics":["csharp","dotnet-core","gnu-readline","readline","readline-library"],"latest_commit_sha":null,"homepage":"","language":"C#","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/tonerdo.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":"2017-01-16T15:15:38.000Z","updated_at":"2024-11-20T19:50:52.000Z","dependencies_parsed_at":"2022-09-07T02:02:35.679Z","dependency_job_id":null,"html_url":"https://github.com/tonerdo/readline","commit_stats":null,"previous_names":["tsolarin/readline"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonerdo%2Freadline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonerdo%2Freadline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonerdo%2Freadline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tonerdo%2Freadline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tonerdo","download_url":"https://codeload.github.com/tonerdo/readline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166861,"owners_count":21058481,"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":["csharp","dotnet-core","gnu-readline","readline","readline-library"],"created_at":"2024-07-30T21:00:39.866Z","updated_at":"2025-04-10T06:17:55.869Z","avatar_url":"https://github.com/tonerdo.png","language":"C#","readme":"[![Windows build status](https://ci.appveyor.com/api/projects/status/github/tonerdo/readline?branch=master\u0026svg=true)](https://ci.appveyor.com/project/tonerdo/readline)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![NuGet version](https://badge.fury.io/nu/ReadLine.svg)](https://www.nuget.org/packages/ReadLine)\n# ReadLine\n\nReadLine is a [GNU Readline](https://en.wikipedia.org/wiki/GNU_Readline) like library built in pure C#. It can serve as a drop in replacement for the inbuilt `Console.ReadLine()` and brings along\nwith it some of the terminal goodness you get from unix shells, like command history navigation and tab auto completion.\n\nIt is cross platform and runs anywhere .NET is supported, targeting `netstandard1.3` means that it can be used with .NET Core as well as the full .NET Framework.\n\n## Shortcut Guide\n\n| Shortcut                       | Comment                           |\n| ------------------------------ | --------------------------------- |\n| `Ctrl`+`A` / `HOME`            | Beginning of line                 |\n| `Ctrl`+`B` / `←`               | Backward one character            |\n| `Ctrl`+`C`                     | Send EOF                          |\n| `Ctrl`+`E` / `END`             | End of line                       |\n| `Ctrl`+`F` / `→`               | Forward one character             |\n| `Ctrl`+`H` / `Backspace`       | Delete previous character         |\n| `Tab`                          | Command line completion           |\n| `Shift`+`Tab`                  | Backwards command line completion |\n| `Ctrl`+`J` / `Enter`           | Line feed                         |\n| `Ctrl`+`K`                     | Cut text to the end of line       |\n| `Ctrl`+`L` / `Esc`             | Clear line                        |\n| `Ctrl`+`M`                     | Same as Enter key                 |\n| `Ctrl`+`N` / `↓`               | Forward in history                |\n| `Ctrl`+`P` / `↑`               | Backward in history               |\n| `Ctrl`+`U`                     | Cut text to the start of line     |\n| `Ctrl`+`W`                     | Cut previous word                 |\n| `Backspace`                    | Delete previous character         |\n| `Ctrl` + `D` / `Delete`        | Delete succeeding character       |\n\n\n## Installation\n\nAvailable on [NuGet](https://www.nuget.org/packages/ReadLine/)\n\nVisual Studio:\n\n```powershell\nPM\u003e Install-Package ReadLine\n```\n\n.NET Core CLI:\n\n```bash\ndotnet add package ReadLine\n```\n\n\n## Usage\n\n### Read input from the console\n\n```csharp\nstring input = ReadLine.Read(\"(prompt)\u003e \");\n```\n\n### Read password from the console\n\n```csharp\nstring password = ReadLine.ReadPassword(\"(prompt)\u003e \");\n```\n\n_Note: The `(prompt\u003e)` is  optional_\n\n### History management\n\n```csharp\n// Get command history\nReadLine.GetHistory();\n\n// Add command to history\nReadLine.AddHistory(\"dotnet run\");\n\n// Clear history\nReadLine.ClearHistory();\n\n// Disable history\nReadLine.HistoryEnabled = false;\n```\n\n_Note: History information is persisted for an entire application session. Also, calls to `ReadLine.Read()` automatically adds the console input to history_\n\n### Auto-Completion\n\n```csharp\nclass AutoCompletionHandler : IAutoCompleteHandler\n{\n    // characters to start completion from\n    public char[] Separators { get; set; } = new char[] { ' ', '.', '/' };\n\n    // text - The current text entered in the console\n    // index - The index of the terminal cursor within {text}\n    public string[] GetSuggestions(string text, int index)\n    {\n        if (text.StartsWith(\"git \"))\n            return new string[] { \"init\", \"clone\", \"pull\", \"push\" };\n        else\n            return null;\n    }\n}\n\nReadLine.AutoCompletionHandler = new AutoCompletionHandler();\n```\n\n_Note: If no \"AutoCompletionHandler\" is set, tab autocompletion will be disabled_\n\n## Contributing\n\nContributions are highly welcome. If you have found a bug or if you have a feature request, please report them at this repository issues section.\n\nThings you can help with:\n* Achieve better command parity with [GNU Readline](https://en.wikipedia.org/wiki/GNU_Readline).\n* Add more test cases.\n\n## License\n\nThis project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","funding_links":[],"categories":["CLI"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonerdo%2Freadline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonerdo%2Freadline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonerdo%2Freadline/lists"}