Hyperbee.XS.Cli 1.2.0

dotnet tool install --global Hyperbee.XS.Cli --version 1.2.0                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Hyperbee.XS.Cli --version 1.2.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Hyperbee.XS.Cli&version=1.2.0                
nuke :add-package Hyperbee.XS.Cli --version 1.2.0                

XS.Cli: Cli tooling for Hyperbee.XS

What is XS?

XS is a lightweight scripting language designed to simplify and enhance the use of C# expression trees. It provides a familiar C#-like syntax while offering advanced extensibility, making it a compelling choice for developers building domain-specific languages (DSLs), rules engines, or dynamic runtime logic systems.

XS.Cli added dotnet commands like:

  • run
  • compile
  • repl

Install Xs.Cli using

you can install Xs.Cli using the following command:

dotnet tool install -g hyperbee.xs.cli

or following Microsoft's documentation

Run

xs run script

or:

xs run file ./script.xs

Compile (.NET 9 or later)

xs compile -s "1 + 1" -o "output.dll"

Repl

xs repl

Examples

Run a script

xs run script "(1-5);"
Result: -4

Show Expression Tree

xs run script "if( true ) 1+1; else 0;" -s
Result:
using System;                                                                                                                                                  │
using System.Linq.Expressions;                                                                                                                                 │
                                                                                                                                                                │
var expression = Expression.Condition(                                                                                                                         │
  Expression.Constant(true),                                                                                                                                   │
  Expression.Add(                                                                                                                                              │
    Expression.Constant(1),                                                                                                                                    │
    Expression.Constant(1)                                                                                                                                     │
  ),                                                                                                                                                           │
  Expression.Constant(0),                                                                                                                                      │
  typeof(Int32)                                                                                                                                                │
);

Run a repl session

xs repl
Starting REPL session. Type "run" to run the current block, "exit" to quit, "print" to see variables.

> print
┌──────┬───────┐
│ Name │ Value │
└──────┴───────┘
> var x = 2;
> var y = 5;
> x + y;
> run
Result:
┌─────────────────────────────────────────────────────────────────────────────────────┐
│ 7                                                                                   │
└─────────────────────────────────────────────────────────────────────────────────────┘
> print
┌──────┬───────┐
│ Name │ Value │
├──────┼───────┤
│ x    │ 2     │
│ y    │ 5     │
└──────┴───────┘
> exit

Credits

Special thanks to:

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.2.0 127 2/11/2025
1.1.0 133 2/10/2025
1.1.0-develop.250210210309 78 2/10/2025