LuaScripting.CSharpHost
1.0.0
dotnet tool install --global LuaScripting.CSharpHost --version 1.0.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local LuaScripting.CSharpHost --version 1.0.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=LuaScripting.CSharpHost&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package LuaScripting.CSharpHost --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
LuaScripting.CSharpHost - A .NET Tool for Lua Scripting
Overview
LuaScripting.CSharpHost is a minimalist .NET tool for executing Lua scripts with ultimate simplicity. Built on top of the NLua library, it provides a clean command-line interface to run Lua code quickly and efficiently.
The tool utilizes just one line of C# code to create a Lua runtime instance and execute your script:
new NLua.Lua().DoFile(args[0]);
Key Features
- Easy Installation: Install as a global .NET tool
- Simple Usage: Run Lua scripts with a single command
- Seamless Lua Integration: Uses the NLua library for robust Lua scripting
- Cross-Platform: Runs anywhere .NET 10 is supported
Prerequisites
- .NET SDK 10 or later
Installation
Install the tool globally using .NET CLI:
dotnet tool install --global LuaScripting.CSharpHost
Usage
Run Lua scripts using the luahost command:
luahost path/to/your/script.lua
Example:
luahost examples/HelloWorld.lua
Example Lua Scripts
- HelloWorld.lua: Prints "Hello world!" to the console
- FindPrimes.lua: Finds all prime numbers up to a specified limit
- EventQueue.lua: Simulates an event queue using Lua's metatable feature
Project Structure
LuaScripting.CSharpHost/
├── LuaHost/
│ ├── LuaHost.csproj # Project configuration
│ └── Program.cs # Main entry point
├── examples/ # Example Lua scripts
├── LICENSE
└── README.md
How It Works
- The tool is installed as a .NET global tool
- The
NLualibrary provides the Lua scripting engine - The host reads the specified Lua file and executes it using the Lua engine
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
Acknowledgements
- NLua - .NET binding for Lua
- .NET SDK 10 - .NET platform
License
This project is licensed under the MIT License. See the LICENSE file for details.
| 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. |
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.0.0 | 106 | 6/12/2026 |