{"id":17274974,"url":"https://github.com/waf/prettyprompt","last_synced_at":"2025-04-04T21:08:59.308Z","repository":{"id":37560943,"uuid":"344532022","full_name":"waf/PrettyPrompt","owner":"waf","description":"A cross-platform command line input library that provides syntax highlighting, autocompletion, history and multi-line input.","archived":false,"fork":false,"pushed_at":"2024-06-27T15:14:01.000Z","size":1051,"stargazers_count":164,"open_issues_count":27,"forks_count":23,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T20:08:42.758Z","etag":null,"topics":["autocompletion","dotnet","readline","repl","syntax-highlighting"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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}},"created_at":"2021-03-04T16:06:11.000Z","updated_at":"2025-03-23T07:00:45.000Z","dependencies_parsed_at":"2024-02-24T11:24:01.324Z","dependency_job_id":"858226d7-26f0-4e6b-b023-89d75efc8335","html_url":"https://github.com/waf/PrettyPrompt","commit_stats":{"total_commits":319,"total_committers":4,"mean_commits":79.75,"dds":"0.40752351097178685","last_synced_commit":"a8dbc5de8997b3c2ffa959a735801eedcba5509c"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waf%2FPrettyPrompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waf%2FPrettyPrompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waf%2FPrettyPrompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waf%2FPrettyPrompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waf","download_url":"https://codeload.github.com/waf/PrettyPrompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249528,"owners_count":20908212,"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":["autocompletion","dotnet","readline","repl","syntax-highlighting"],"created_at":"2024-10-15T08:55:09.631Z","updated_at":"2025-04-04T21:08:59.283Z","avatar_url":"https://github.com/waf.png","language":"C#","readme":"# PrettyPrompt\r\n\r\n[![Nuget](https://img.shields.io/nuget/v/PrettyPrompt.svg?style=flat\u0026color=005ca4)](https://www.nuget.org/packages/PrettyPrompt/)\r\n[![Code Coverage](https://codecov.io/gh/waf/PrettyPrompt/branch/main/graph/badge.svg)](https://app.codecov.io/gh/waf/PrettyPrompt)\r\n[![Build Status](https://github.com/waf/PrettyPrompt/workflows/main%20build/badge.svg)](https://github.com/waf/PrettyPrompt/actions/workflows/main.yml)\r\n\r\nA cross-platform command line prompt that provides syntax highlighting, autocompletion, history and more! It's `Console.ReadLine()` on steroids.\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"https://raw.githubusercontent.com/waf/PrettyPrompt/main/images/screenshot.png\" alt=\"PrettyPrompt screenshot\" style=\"max-width:100%;\"\u003e\r\n\u003c/p\u003e\r\n\r\n## Features\r\n\r\n- User Experience (UX) features:\r\n  - Syntax highlighting support via ANSI escape sequences. Supports both the terminal color palette and full RGB colors.\r\n  - Autocompletion menu, with extended documentation tooltips and overload menus.\r\n  - Multi-line input with word-wrapping\r\n  - Word-wrapping\r\n  - History navigation, optionally persistent across sessions, with history filtering (similar to PSReadLine's `HistorySearchBackward`).\r\n  - Unsurprising keybindings: \u003ckbd\u003eHome\u003c/kbd\u003e, \u003ckbd\u003eEnd\u003c/kbd\u003e, \u003ckbd\u003eCtrl-L\u003c/kbd\u003e to clear screen, \u003ckbd\u003eCtrl-C\u003c/kbd\u003e to cancel current line, \u003ckbd\u003eCtrl+Space\u003c/kbd\u003e to open autocomplete menu, and more.\r\n  - Cross platform copy/paste: \u003ckbd\u003eCtrl-Shift-C\u003c/kbd\u003e for copy, \u003ckbd\u003eCtrl-V\u003c/kbd\u003e or \u003ckbd\u003eShift-Insert\u003c/kbd\u003e for pasting.\r\n  - Optionally detects incomplete lines and converts \u003ckbd\u003eEnter\u003c/kbd\u003e to a \"soft newline\" (\u003ckbd\u003eShift-Enter\u003c/kbd\u003e).\r\n  - Optionally autoformats input text as it's typed.\r\n  - Works \"in-line\" on the command line; it doesn't take over the entire terminal window.\r\n- Developer Experience (DX) features:\r\n  - Many customization hooks available for configuring PrettyPrompt for your application (see `IPromptCallbacks`).\r\n  - Provides a `CancellationToken` for each prompt result, so the end-user of your application can cancel long running tasks via \u003ckbd\u003eCtrl-C\u003c/kbd\u003e.\r\n  - Fast rendering—PrettyPrompt only renders the diff of what changed, so the screen doesn't flicker as text is redrawn.\r\n\r\n## Installation\r\n\r\nPrettyPrompt can be [installed from nuget](https://www.nuget.org/packages/PrettyPrompt/) by running the following command:\r\n\r\n```\r\ndotnet add package PrettyPrompt\r\n```\r\n\r\n## Usage\r\n\r\nA simple read-eval-print-loop looks like this:\r\n\r\n```csharp\r\n\r\nvar prompt = new Prompt();\r\n\r\nwhile (true)\r\n{\r\n    var response = await prompt.ReadLineAsync(\"\u003e \");\r\n    if (response.IsSuccess) // false if user cancels, i.e. ctrl-c\r\n    {\r\n        if (response.Text == \"exit\") break;\r\n\r\n        Console.WriteLine(\"You wrote \" + response.Text);\r\n    }\r\n}\r\n```\r\n\r\nThe `Prompt` constructor takes optional configuration options for enabling syntax highlighting, autocompletion, and soft-newline configuration.\r\nFor a more complete example, see the project in the [`examples`](https://github.com/waf/PrettyPrompt/tree/main/examples/PrettyPrompt.Examples.FruitPrompt) directory.\r\nIf you have the [`dotnet example`](https://github.com/patriksvensson/dotnet-example) global tool installed, run the following command in the repository root:\r\n\r\n```\r\ndotnet example FruitPrompt\r\n```\r\n\r\n## Building from source\r\n\r\nThis application targets modern .NET (i.e. not .NET Framework), and can be built with either Visual Studio or the normal `dotnet build` command line tool.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaf%2Fprettyprompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaf%2Fprettyprompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaf%2Fprettyprompt/lists"}