Clack.Net.Prompts
1.7.0
dotnet add package Clack.Net.Prompts --version 1.7.0
NuGet\Install-Package Clack.Net.Prompts -Version 1.7.0
<PackageReference Include="Clack.Net.Prompts" Version="1.7.0" />
<PackageVersion Include="Clack.Net.Prompts" Version="1.7.0" />
<PackageReference Include="Clack.Net.Prompts" />
paket add Clack.Net.Prompts --version 1.7.0
#r "nuget: Clack.Net.Prompts, 1.7.0"
#:package Clack.Net.Prompts@1.7.0
#addin nuget:?package=Clack.Net.Prompts&version=1.7.0
#tool nuget:?package=Clack.Net.Prompts&version=1.7.0
Clack.Net
A faithful C# / .NET 10 port of clack — effortlessly build beautiful command-line wizards in your .NET CLI tools.
Status: feature-complete port of @clack/core 1.4.3 + @clack/prompts 1.7.0. Output fidelity is verified byte-for-byte against the published npm package by ~650 golden transcripts, including a one-to-one mirror of upstream's entire test suite. See PLAN.md for the roadmap and remaining ship tasks.
using ClackDotNet.Core;
using ClackDotNet.Prompts;
Clack.Intro("create-app");
var name = await Clack.Text(new()
{
Message = "What is your project named?",
Placeholder = "my-app",
});
if (name.IsCanceled)
{
Clack.Cancel("Operation cancelled.");
return;
}
var framework = await Clack.Select(new SelectOptions<string>
{
Message = "Pick a framework",
Options =
[
new() { Value = "console", Label = "Console" },
new() { Value = "web", Label = "ASP.NET Core" },
new() { Value = "maui", Label = ".NET MAUI", Hint = "mobile + desktop" },
],
});
var s = Clack.Spinner();
s.Start("Scaffolding");
await DoWork();
s.Stop("Scaffolded");
Clack.Outro($"You're all set — cd {name.Value}");
All prompts return ClackResult<T> — check IsCanceled (the typed equivalent of
upstream's isCancel()), or use Value / ValueOr(fallback).
Layout
src/Clack.Core— unstyled primitives (port of@clack/core): prompt state machines, render/diff engine, keybindingssrc/Clack.Prompts— the styled layer (port of@clack/prompts): text/select/confirm/multiselect prompts, spinner, progress bar, notes, intro/outro, groupstests/— xUnit tests, snapshot-based like upstreamexamples/Clack.Examples.Basic— port of clack'sexamples/basicwizard
Building
dotnet build
dotnet test
dotnet run --project examples/Clack.Examples.Basic
Credits
Ported from clack by Nate Moore and the bombshell-dev contributors (MIT). This project is not affiliated with upstream clack.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Clack.Net.Core (>= 1.4.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|