TimeWarp.Nuru.Logging
3.0.0-beta.15
Prefix Reserved
dotnet add package TimeWarp.Nuru.Logging --version 3.0.0-beta.15
NuGet\Install-Package TimeWarp.Nuru.Logging -Version 3.0.0-beta.15
<PackageReference Include="TimeWarp.Nuru.Logging" Version="3.0.0-beta.15" />
<PackageVersion Include="TimeWarp.Nuru.Logging" Version="3.0.0-beta.15" />
<PackageReference Include="TimeWarp.Nuru.Logging" />
paket add TimeWarp.Nuru.Logging --version 3.0.0-beta.15
#r "nuget: TimeWarp.Nuru.Logging, 3.0.0-beta.15"
#:package TimeWarp.Nuru.Logging@3.0.0-beta.15
#addin nuget:?package=TimeWarp.Nuru.Logging&version=3.0.0-beta.15&prerelease
#tool nuget:?package=TimeWarp.Nuru.Logging&version=3.0.0-beta.15&prerelease
TimeWarp.Nuru
<div align="center">
Route-based CLI framework for .NET - bringing web-style routing to command-line applications
</div>
Nuru means "light" in Swahili - illuminating the path to your commands with clarity and simplicity.
📦 Installation
dotnet add package TimeWarp.Nuru
🚀 Quick Start
ASP.NET Core-Style API (Recommended)
using TimeWarp.Nuru;
NuruCoreApp app = NuruApp.CreateBuilder(args)
.Map("add {x:double} {y:double}", (double x, double y) =>
Console.WriteLine($"{x} + {y} = {x + y}"))
.Build();
return await app.RunAsync(args);
Slim Builder (Lightweight)
using TimeWarp.Nuru;
NuruCoreApp app = NuruApp.CreateSlimBuilder()
.Map("add {x:double} {y:double}", (double x, double y) =>
Console.WriteLine($"{x} + {y} = {x + y}"))
.Build();
return await app.RunAsync(args);
Empty Builder (Total Control)
using TimeWarp.Nuru;
NuruCoreApp app = NuruApp.CreateEmptyBuilder()
.Map("add {x:double} {y:double}", (double x, double y) =>
Console.WriteLine($"{x} + {y} = {x + y}"))
.Build();
return await app.RunAsync(args);
dotnet run -- add 15 25
# Output: 15 + 25 = 40
Choose Your Builder
| Builder | Use Case | Features |
|---|---|---|
NuruApp.CreateBuilder(args) |
Full-featured apps | DI, Config, Mediator, REPL, Completion |
NuruApp.CreateSlimBuilder() |
Lightweight tools | Auto-help, Logging infra, AOT-friendly |
NuruApp.CreateEmptyBuilder() |
Total control | Type converters only, fully AOT |
✨ Key Features
| Feature | Description | Learn More |
|---|---|---|
| 🎯 Web-Style Routing | Familiar "deploy {env} --version {tag}" syntax |
Routing Guide |
| ⚡ Dual Approach | Mix Direct (fast) + Mediator (structured) | Architecture Choices |
| 🛡️ Roslyn Analyzer | Catch route errors at compile-time | Analyzer Docs |
| ⌨️ Shell Completion | Tab completion for bash, zsh, PowerShell, fish | Shell Completion |
| 🤖 MCP Server | AI-assisted development with Claude | MCP Server Guide |
| 📊 Logging Package | Zero-overhead structured logging | Logging Docs |
| 🚀 Native AOT | Zero warnings, 3.3 MB binaries, instant startup | Deployment Guide |
| 🔒 Type-Safe Parameters | Automatic type conversion and validation | Supported Types |
| 📖 Auto-Help | Generate help from route patterns | Auto-Help Feature |
| 🎨 Colored Output | Fluent ANSI colors without Spectre.Console | Terminal Abstractions |
📚 Documentation
Getting Started
- Getting Started Guide - Build your first CLI app in 5 minutes
- Use Cases - Greenfield apps & progressive enhancement patterns
- Architecture Choices - Choose Direct, Mediator, or Mixed
Core Features
- Routing Patterns - Complete route syntax reference
- Roslyn Analyzer - Compile-time validation
- Logging System - Structured logging setup
- Auto-Help - Automatic help generation
- Output Handling - stdout/stderr best practices
- Terminal Abstractions - Testable I/O & colored output
Tools & Deployment
- MCP Server - AI-powered development assistance
- Deployment Guide - Native AOT, runfiles, distribution
- Best Practices - Patterns for maintainable CLIs
Reference
- Performance Benchmarks - Detailed performance metrics
- Supported Types - Complete type reference
- API Documentation - Technical reference
🎯 Two Powerful Use Cases
🆕 Greenfield CLI Applications
Build modern command-line tools from scratch:
NuruCoreApp app = new NuruAppBuilder()
.Map
(
"deploy {env} --version {tag?}",
(string env, string? tag) => Deploy(env, tag)
)
.Map
(
"backup {source} {dest?} --compress",
(string source, string? dest, bool compress) => Backup(source, dest, compress)
)
.Build();
🔄 Progressive Enhancement
Wrap existing CLIs to add auth, logging, or validation:
NuruCoreApp app = new NuruAppBuilder()
.Map
(
"deploy prod",
async () =>
{
if (!await ValidateAccess()) return 1;
return await Shell.ExecuteAsync("existing-cli", "deploy", "prod");
}
)
.Map
(
"{*args}",
async (string[] args) => await Shell.ExecuteAsync("existing-cli", args)
)
.Build();
→ Detailed Use Cases with Examples
🌟 Working Examples
Calculator Samples - Four complete implementations you can run now:
- calc-createbuilder.cs - ASP.NET Core-style API (recommended)
- calc-delegate.cs - Direct approach (pure performance)
- calc-mediator.cs - Mediator pattern (enterprise)
- calc-mixed.cs - Mixed approach (classic builder)
./samples/calculator/calc-mixed.cs add 10 20 # Direct: fast
./samples/calculator/calc-mixed.cs factorial 5 # Mediator: structured
AOT Example - Native AOT compilation with source generators
Cocona Comparison - Migration guides from Cocona
⚡ Performance
| Implementation | Memory | Speed (37 tests) | Binary Size |
|---|---|---|---|
| Direct (JIT) | ~4 KB | 2.49s | N/A |
| Direct (AOT) | ~4 KB | 0.30s 🚀 | 3.3 MB |
| Mediator (AOT) | Moderate | 0.42s 🚀 | 4.8 MB |
Native AOT is 88-93% faster than JIT → Full Performance Benchmarks
🤖 AI-Powered Development
Install the MCP server for AI assistance:
dotnet tool install --global TimeWarp.Nuru.Mcp
Get instant help in Claude Code, Roo Code, or Continue:
- Validate route patterns before writing code
- Generate handler code automatically
- Get syntax examples on demand
- Real-time error guidance
⌨️ Shell Completion
Enable tab completion for your CLI with one line of code:
NuruCoreApp app = new NuruAppBuilder()
.Map("deploy {env} --version {tag}", (string env, string tag) => Deploy(env, tag))
.Map("status", () => ShowStatus())
.EnableStaticCompletion() // ← Add this
.Build();
Generate completion scripts for your shell:
# Bash
./myapp --generate-completion bash >> ~/.bashrc
# Zsh
./myapp --generate-completion zsh >> ~/.zshrc
# PowerShell
./myapp --generate-completion powershell >> $PROFILE
# Fish
./myapp --generate-completion fish > ~/.config/fish/completions/myapp.fish
Supports:
- ✅ Command completion (
deploy,status) - ✅ Option completion (
--version,--force) - ✅ Short option aliases (
-v,-f) - ✅ All 4 major shells (bash, zsh, PowerShell, fish)
See shell-completion-example for a complete working example.
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for details.
For Contributors:
- Developer Documentation - Architecture and design
- Standards - Coding conventions
📄 License
This project is licensed under the Unlicense - see the license file for details.
<div align="center">
Ready to build powerful CLI applications?
Get Started in 5 Minutes • View Examples • Read the Docs
</div>
| 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
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Logging.Console (>= 10.0.0)
- TimeWarp.Build.Tasks (>= 1.0.0)
- TimeWarp.Nuru.Core (>= 3.0.0-beta.15)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on TimeWarp.Nuru.Logging:
| Package | Downloads |
|---|---|
|
TimeWarp.Nuru
Route-based CLI framework for .NET - batteries included with telemetry, REPL, and shell completion |
|
|
TimeWarp.Nuru.Telemetry
OpenTelemetry integration for TimeWarp.Nuru CLI framework with Aspire Dashboard support |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-beta.15 | 24 | 12/8/2025 |
| 3.0.0-beta.14 | 37 | 12/8/2025 |
| 3.0.0-beta.13 | 31 | 12/7/2025 |
| 3.0.0-beta.12 | 642 | 12/2/2025 |
| 3.0.0-beta.11 | 602 | 12/2/2025 |
| 3.0.0-beta.10 | 606 | 12/2/2025 |
| 3.0.0-beta.9 | 586 | 12/1/2025 |
| 3.0.0-beta.8 | 293 | 11/30/2025 |
| 3.0.0-beta.7 | 202 | 11/30/2025 |
| 3.0.0-beta.6 | 52 | 11/29/2025 |
| 3.0.0-beta.5 | 116 | 11/27/2025 |
| 3.0.0-beta.4 | 118 | 11/27/2025 |
| 3.0.0-beta.3 | 124 | 11/27/2025 |
| 3.0.0-beta.2 | 119 | 11/26/2025 |
| 2.1.0-beta.32 | 251 | 11/17/2025 |
| 2.1.0-beta.31 | 234 | 11/12/2025 |
| 2.1.0-beta.30 | 62 | 11/8/2025 |
| 2.1.0-beta.29 | 144 | 11/6/2025 |
| 2.1.0-beta.28 | 137 | 10/27/2025 |
| 2.1.0-beta.27 | 134 | 10/27/2025 |
| 2.1.0-beta.26 | 94 | 10/25/2025 |
| 2.1.0-beta.25 | 70 | 10/24/2025 |
| 2.1.0-beta.24 | 117 | 10/24/2025 |
| 2.1.0-beta.23 | 125 | 10/23/2025 |
| 2.1.0-beta.22 | 126 | 10/23/2025 |
| 2.1.0-beta.21 | 125 | 10/20/2025 |
| 2.1.0-beta.20 | 43 | 10/18/2025 |
| 2.1.0-beta.19 | 119 | 10/16/2025 |
| 2.1.0-beta.17 | 68 | 10/11/2025 |
| 2.1.0-beta.16 | 66 | 10/11/2025 |
| 2.1.0-beta.15 | 129 | 10/8/2025 |
| 2.1.0-beta.13 | 125 | 10/8/2025 |
| 2.1.0-beta.12 | 128 | 10/7/2025 |
| 2.1.0-beta.11 | 120 | 9/13/2025 |
| 2.1.0-beta.10 | 175 | 8/30/2025 |
| 2.1.0-beta.9 | 174 | 8/28/2025 |
| 2.1.0-beta.8 | 174 | 8/8/2025 |