Example scripts showing how to chain clets together in real workflows. Each script uses dotnet run against the local build — no global tool install needed.
Pick a Markdown file using the file clet's tree dialog, then open it in the md viewer.
Available in PowerShell (.ps1) and bash (.sh).
# PowerShell
./demos/file-then-md.ps1
# bash (requires jq)
./demos/file-then-md.sh
# Start in a specific directory
./demos/file-then-md.ps1 ~/projects
./demos/file-then-md.sh ~/projectsWhat it demonstrates:
- Chaining an input clet (
file) into a viewer clet (md) - Using
--json+--outputto capture structured results without interfering with TUI rendering - Parsing the JSON envelope to extract the
valuefield - Handling cancellation (Esc exits with code 130)
Terminal.Gui renders to stdout, so shell command substitution ($(clet ...) or $result = clet ...) swallows the TUI. The --output <path> flag writes the result to a file instead, keeping stdout free for the TUI:
# PowerShell
$tmp = [System.IO.Path]::GetTempFileName()
clet file --json --output $tmp
$result = Get-Content $tmp -Raw | ConvertFrom-Json
# use $result.value ...# bash
tmp=$(mktemp)
clet file --json --output "$tmp"
file=$(jq -r '.value' "$tmp")
# use $file ...- .NET 10.0 preview SDK
- PowerShell 7+ (for
.ps1scripts) jq(for.shscripts only)
Keep each demo focused on one workflow. Provide both .ps1 and .sh variants where practical. Use dotnet run --project relative to $PSScriptRoot / $script_dir so scripts work from any working directory.