Clack.Net.Prompts 1.7.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Clack.Net.Prompts --version 1.7.0
                    
NuGet\Install-Package Clack.Net.Prompts -Version 1.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Clack.Net.Prompts" Version="1.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Clack.Net.Prompts" Version="1.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Clack.Net.Prompts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Clack.Net.Prompts --version 1.7.0
                    
#r "nuget: Clack.Net.Prompts, 1.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Clack.Net.Prompts@1.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Clack.Net.Prompts&version=1.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Clack.Net.Prompts&version=1.7.0
                    
Install as a Cake Tool

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, keybindings
  • src/Clack.Prompts — the styled layer (port of @clack/prompts): text/select/confirm/multiselect prompts, spinner, progress bar, notes, intro/outro, groups
  • tests/ — xUnit tests, snapshot-based like upstream
  • examples/Clack.Examples.Basic — port of clack's examples/basic wizard

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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