This nuget package is a c# wrapper that helps facilitate using the limbo_console godot plugin in c#.
- Requirements
- Installation
- Getting Started
- Documentation
- Contributing
- Features
- Changelog
- License
- Contributors
- Simplified Integration: Easily interact with the π» limbo_console godot plugin from a c# godot game.
- Command Registration: Register commands with descriptions and auto-complete sources.
- Auto-Complete Support: Add auto-complete sources for command arguments.
- Demo Project: Includes examples for initialization, commands, and advanced features.
- Godot Engine: Version 4.4.X or higher.
- .NET SDK: Version 8.0
- limbo_console plugin: Installed and enabled in your godot project. See π» limbo console.
-
Ensure the π» limbo console plugin is installed and enabled in your godot project:
- Go to Project > Project Settings > Plugins and enable the plugin.
-
Install the nuget package for your godot c# project (compatible with godot 4.4.X).
Run the following command:
dotnet add package LimboConsole.SharpAdd the following line to your godot game's csproj
<PackageReference Include="LimboConsole.Sharp" Version="<specify.your.version>" />// Access the console statically from any node within the tree
LimboConsole.RegisterCommand(new Callable(this, MethodName.StartGame), "start_game", "Starts the game");
private void StartGame() {
// Do something
}You can also use the [ConsoleCommand] attribute to easily define commands.
π‘You must call
RegisterConsoleCommands()to enable your class's [ConsoleCommands].
// By default use name of function exactly
[ConsoleCommand]
private void LogFromAttribute() => LimboConsole.Info($"{GlobalPosition}");
// Pass a custom name
[ConsoleCommand("CoolName")]
private void AFunctionName() => LogFromAttribute();
// Pass a custom name and description
[ConsoleCommand("Say", "Shows a message in the console")]
private void Print(string message) => LimboConsole.Info(message);
// Remember to register the commands!
private void _Ready() {
// This will register the commands
RegisterConsoleCommands();
}You can also add auto-complete sources for command arguments:
LimboConsole.AddArgumentAutocompleteSource("abc", 1, Callable.From(() => new string[] { "a", "b", "c" }));This example adds an auto-complete source for the first argument of the abc command, suggesting the values a, b, or c.
Note: when registering an argument index starts at 1 not 0 and currently has a max of 5 arguments
You can also use the [AutoComplete] attribute to quickly define autocompletes for your attribute based console commands
π‘You must call
RegisterConsoleCommands()to enable your class's [AutoComplete]'s!
Method-based autocomplete:
[ConsoleCommand]
[AutoComplete(nameof(Colors))]
public void FavoriteColorCommand(string colors) {
// Do something
}
private string[] Colors() {
return new [] {"red", "blue", "green"};
}This example adds an auto-complete source for the first argument of the FavoriteColorCommand command, suggesting the values red, blue, and green.
Inline array autocomplete:
You can also define autocomplete values inline without needing a separate method:
[ConsoleCommand]
[AutoComplete(new string[] { "red", "white", "orange", "green" })]
public void ColorCommand(string color) {
// Do something
}For multi-parameter commands, specify the argument index (note: parameter indices are 0-based):
[ConsoleCommand]
[AutoComplete(new string[] { "apple", "banana", "cherry", "date" }, 1)]
public void FruitCommand(int quantity, string fruit) {
// Do something with quantity and fruit
}In newer C# versions, you can use collection expressions:
[ConsoleCommand]
[AutoComplete(["red", "white", "orange", "green"])]
public void ColorCommand(string color) {
// Do something
}See run the demo project and see Demo.cs for more examples of how to use the package
See summary comments in nuget package or refer to π» limbo_console
For a detailed history of changes, see the Changelog.
Thanks for your interest in contributing. Please follow these guidelines to keep the project consistent and maintainable in the long-term. Keep in mind this is just a wrapper. Feature or bug fixes for the requests for the console itself should go here π» limbo_console.
After a feature is added and/or the public api changes this repo will need to be updated so help keeping it up to date is appreciated!
See something you want or could improve upon? Make a PR! β¨
-
Limbo.Console.Sharp: The root of the nuget package.
- Pack: Use
dotnet packto create the package. Alternatively, run the provided.batscript on Windows to automate packaging to the demo project.
The
.batfile is a helpful reference for understanding how the demo project and the nuget package interact. It automates the packaging process for Windows users to test changes in the demo project. - Pack: Use
-
Demo Project: A sample godot project included to demonstrate:
- Registering commands and auto-complete sources.
- Using advanced features like signals and callable commands.
Note: Currently, there is no quick script for packaging on non-Windows platforms. Contributions to add this functionality are welcome!
- Follow the official Microsoft coding conventions and name identifiers
See the CHANGELOG.md file for a detailed list of changes in each version.
This project is licensed under the MIT License. See the LICENSE file for details.
Thanks to these wonderful people for their contributions:


