Commands Overview
Gate provides a powerful command system built on top of the Brigadier library, allowing you to register custom proxy commands that players can execute.Command Architecture
Gate’s command system consists of several key components:Command Manager
Thecommand.Manager handles command registration and execution:
pkg/command/command.go:14-15
Command Source
TheSource interface represents the command invoker (player or console):
pkg/command/command.go:19-23
Basic Concepts
Command Context
Every command receives aContext containing:
- Command arguments
- Source (who executed the command)
- Parsed parameters
Command Execution
Commands are executed through a pipeline:- Parse: Command input is parsed into a
ParseResults - Execute: Parsed command is executed with context
- Response: Results are sent back to the source
pkg/command/command.go:102-104
Built-in Commands
Gate includes several built-in commands:| Command | Description | Permission |
|---|---|---|
/server | Switch or list servers | gate.command.server |
/glist | List online players | gate.command.glist |
/send | Send player to server | gate.command.send |
Built-in commands can be disabled via
builtinCommands: false in config.yml.Next Steps
Command Registration
Learn how to register custom commands
Using Brigadier
Master Brigadier’s node system
Permissions
Implement permission checks
Command Examples
See complete command implementations

