Simple in-game console for Godot 4.x.
- Installed as plugin
- Singleton implementation
- Command history navigation (Up/Down keys)
- Tab-based command autocompletion
- Argument type conversion for static typing
- Built-in
clear
andhelp
commands - C# support via bindings
- Rich text formatting support
- Clone this repository to your project's
addons
folder:Or download the latest releasegit clone https://github.com/4d49/godot-console.git
- Enable the plugin in Godot: Project Settings → Plugins → Enable
Godot Console
- Add the
ConsoleContainer
node to your main scene
Register commands using Console.create_command()
:
# player.gd
func teleport(x: float, y: float) -> void:
position = Vector2(x, y)
func _ready() -> void:
# Register command: name, callback, description
Console.create_command("tp", teleport, "Teleport player to coordinates")
Arguments are automatically converted to specified types:
# Arguments auto-converted to float
func teleport(x: float, y: float) -> void:
position = Vector2(x, y)
Supported Types: bool
, int
, float
, String
, StringName
Arguments are passed as raw strings:
# Arguments received as Strings
func teleport(x, y):
position = Vector2(x.to_float(), y.to_float())
Return a String to display results in console:
func add_money(amount: int) -> String:
money += amount
return "Added money: %d (Total: %d)" % [amount, money]
- Up/Down arrows: Browse command history
- Shift + Tab: Autocomplete commands
- Enter: Execute command
Add addons/godot-console/scripts/ConsoleMono.cs
to Autoloads after Console
.
public partial class Player : CharacterBody2D
{
private void Teleport(float x, float y)
{
Position = new Vector2(x, y);
}
public override void _Ready()
{
// Register command directly
ConsoleMono.CreateCommand("tp", Teleport);
// Alternative registration
ConsoleMono.CreateCommand("teleport", this, MethodName.Teleport);
}
}
- Use explicit type hints for arguments
- Validate user input in command handlers
- Return meaningful success/error messages
- Keep command names short and descriptive
- Use
warning()
/error()
for status messages:Console.warning("Low health!") Console.error("Invalid coordinates!")
Copyright (c) 2020-2025 Mansur Isaev and contributors
Unless otherwise specified, files in this repository are licensed under the MIT license. See LICENSE.md for more information.