Command Registration
This guide shows you how to register custom commands with Gate’s command manager.Getting the Command Manager
Access the command manager from the proxy instance:Basic Registration
Simple Command
Register a command with no arguments:Command with Arguments
Add arguments to your command:Command with Aliases
Register a command with multiple names:pkg/command/command.go:125-138
Permission Requirements
Add permission checks to commands:Tab Completion
Provide suggestions for command arguments:Dynamic Registration
Register commands at runtime:Unregistering Commands
Remove commands from the manager:pkg/command/command.go:114-118
Best Practices
Error Handling
Error Handling
Always handle errors gracefully:
Permission Naming
Permission Naming
Use consistent permission naming:
gate.command.<name>for basic commandsgate.admin.<feature>for admin commandsmyplugin.command.<name>for plugin commands
Argument Validation
Argument Validation
Validate arguments before use:
Next Steps
Brigadier Guide
Learn Brigadier’s advanced features
Complete Example
See a full command plugin

