TimeWarp.Nuru 3.0.0-beta.51

Prefix Reserved
This is a prerelease version of TimeWarp.Nuru.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TimeWarp.Nuru --version 3.0.0-beta.51
                    
NuGet\Install-Package TimeWarp.Nuru -Version 3.0.0-beta.51
                    
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="TimeWarp.Nuru" Version="3.0.0-beta.51" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TimeWarp.Nuru" Version="3.0.0-beta.51" />
                    
Directory.Packages.props
<PackageReference Include="TimeWarp.Nuru" />
                    
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 TimeWarp.Nuru --version 3.0.0-beta.51
                    
#r "nuget: TimeWarp.Nuru, 3.0.0-beta.51"
                    
#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 TimeWarp.Nuru@3.0.0-beta.51
                    
#: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=TimeWarp.Nuru&version=3.0.0-beta.51&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TimeWarp.Nuru&version=3.0.0-beta.51&prerelease
                    
Install as a Cake Tool

TimeWarp.Nuru

<div align="center">

NuGet Version NuGet Downloads Build Status License Ask DeepWiki

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

TimeWarp.Nuru offers two patterns for defining CLI commands. Start with the Endpoint DSL for structured apps, or Fluent DSL for quick scripts.

Endpoint DSL

Define routes as classes with [NuruRoute] attributes:

using TimeWarp.Nuru;

[NuruRoute("add", Description = "Add two numbers together")]
public sealed class AddCommand : ICommand<Unit>
{
  [Parameter(Order = 0)] public double X { get; set; }
  [Parameter(Order = 1)] public double Y { get; set; }

  public sealed class Handler : ICommandHandler<AddCommand, Unit>
  {
    public ValueTask<Unit> Handle(AddCommand command, CancellationToken ct)
    {
      Console.WriteLine($"{command.X} + {command.Y} = {command.X + command.Y}");
      return default;
    }
  }
}

// In your main file:
NuruApp app = NuruApp.CreateBuilder()
  .DiscoverEndpoints()
  .Build();

return await app.RunAsync(args);

Fluent DSL

Define routes inline with a fluent builder API:

using TimeWarp.Nuru;

NuruApp app = NuruApp.CreateBuilder()
  .Map("add {x:double} {y:double}")
    .WithHandler((double x, double y) => Console.WriteLine($"{x} + {y} = {x + y}"))
    .AsCommand()
    .Done()
  .Build();

return await app.RunAsync(args);
dotnet run -- add 15 25
# Output: 15 + 25 = 40

Full Getting Started Guide

✨ Key Features

Feature Description Learn More
🎯 Web-Style Routing Familiar "deploy {env} --version {tag}" syntax Routing Guide
📦 Endpoint DSL Class-based commands with DiscoverEndpoints() auto-discovery Architecture Choices
🔧 Fluent DSL Inline routes with .Map().WithHandler().Done() chain 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
🎨 Rich Terminal Colors, tables, panels, rules via TimeWarp.Terminal Terminal Guide

📚 Documentation

Getting Started

Core Features

Tools & Deployment

Reference

🎯 Two Powerful Use Cases

🆕 Greenfield CLI Applications

Build modern command-line tools from scratch:

myapp/
├── calculator.cs       # Single runfile - just 5 lines
└── endpoints/
    ├── add-command.cs
    ├── factorial-command.cs
    └── ...

Endpoint DSL approach (class-based, organized by file):

// In endpoints/add-command.cs
[NuruRoute("add", Description = "Add two numbers")]
public sealed class AddCommand : ICommand<Unit>
{
  [Parameter] public double X { get; set; }
  [Parameter] public double Y { get; set; }

  public sealed class Handler : ICommandHandler<AddCommand, Unit>
  {
    public ValueTask<Unit> Handle(AddCommand c, CancellationToken ct)
    {
      Console.WriteLine($"{c.X} + {c.Y} = {c.X + c.Y}");
      return default;
    }
  }
}

Fluent DSL approach (inline definitions):

NuruApp.CreateBuilder()
  .Map("deploy {env} --version {tag?}")
    .WithHandler((string env, string? tag) => Deploy(env, tag))
    .AsCommand()
    .Done()
  .Build();

🔄 Progressive Enhancement

Wrap existing CLIs to add auth, logging, or validation:

NuruApp app = NuruApp.CreateBuilder(args)
  .Map("deploy prod")
    .WithHandler(async () =>
    {
      if (!await ValidateAccess()) return 1;
      return await Shell.ExecuteAsync("existing-cli", "deploy", "prod");
    })
    .AsCommand()
    .Done()
  .Map("{*args}")
    .WithHandler(async (string[] args) => await Shell.ExecuteAsync("existing-cli", args))
    .AsCommand()
    .Done()
  .Build();

Detailed Use Cases with Examples

🌟 Working Examples

Calculator Samples - Three complete implementations you can run now:

./samples/02-calculator/01-calc-endpoints.cs add 10 20    # Endpoint DSL: structured
./samples/02-calculator/02-calc-fluent.cs factorial 5      # Fluent DSL: inline

AOT Example - Native AOT compilation with source generators

⚡ 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
Endpoints (AOT) Moderate 0.42s 🚀 4.8 MB

Native AOT is 88-93% faster than JITFull Performance Benchmarks

🤖 AI-Powered Development

For AI agents: Load the built-in Nuru Skill for instant access to:

  • Complete DSL syntax and patterns
  • Testing with TestTerminal
  • Route examples and type conversion

💡 Tip: No MCP installation needed - the skill provides all essential patterns.

For MCP Server: Install for Claude Code, Roo Code, or Continue:

dotnet tool install --global TimeWarp.Nuru.Mcp

Get instant help:

  • Validate route patterns before writing code
  • Generate handler code automatically
  • Get syntax examples on demand
  • Real-time error guidance

MCP Server Setup Guide

⌨️ Shell Completion

Enable tab completion for your CLI with one line of code:

NuruApp app = NuruApp.CreateBuilder(args)
  .Map("deploy {env} --version {tag}")
    .WithHandler((string env, string tag) => Deploy(env, tag))
    .AsCommand()
    .Done()
  .Map("status")
    .WithHandler(() => ShowStatus())
    .AsQuery()
    .Done()
  .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 completion-example for a complete working example.

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for details.

For Contributors:

📄 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 MinutesView ExamplesRead the Docs

</div>

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
3.0.0-beta.57 46 3/6/2026
3.0.0-beta.56 74 3/4/2026
3.0.0-beta.55 57 3/3/2026
3.0.0-beta.54 142 2/20/2026
3.0.0-beta.53 57 2/20/2026
3.0.0-beta.52 73 2/17/2026
3.0.0-beta.51 74 2/17/2026
3.0.0-beta.50 154 2/15/2026
3.0.0-beta.49 77 2/14/2026
3.0.0-beta.48 70 2/14/2026
3.0.0-beta.47 112 2/13/2026
3.0.0-beta.46 89 2/11/2026
3.0.0-beta.45 87 2/4/2026
3.0.0-beta.44 111 1/30/2026
3.0.0-beta.43 83 1/30/2026
3.0.0-beta.42 97 1/27/2026
3.0.0-beta.41 81 1/26/2026
3.0.0-beta.40 86 1/26/2026
3.0.0-beta.39 83 1/26/2026
2.0.0 342 8/4/2025
Loading failed