Cmdr is a fully extensible and type safe command console for Roblox developers.
- Great for admin commands, but does much more.
- Make commands that tie in specifically with your game systems.
- Intelligent autocompletion and instant validation.
- Run commands programmatically on behalf of the local user.
- Bind commands to user input.
- Secure: the client and server both validate input separately.
- Embedded commands: dynamically use the output of an inner command when running a command.
Demo:
Cmdr is designed specifically so that you can write your own commands and argument types, so that it can fit right in with the rest of your game. In addition to the standard moderation commands (teleport, kill, kick, ban), Cmdr is also great for debug commands in your game (say, if you wanted to have a command to give you a weapon, reset a round, teleport you between places in your universe).
Cmdr has a robust and friendly type validation system (making sure strings are strings, players are players, etc), which can give end users real time command validation as they type, and automatic error messages. By the time the command actually gets to your code, you can be assured that all of the arguments are present and of the correct type.
GitHub Repository, installation instructions, and docs
Key Features
- Define commands with a simple configuration scheme - take a look at the built-in commands for examples.
- Ships with a basic set of commands and utilities out of the box - but you choose what commands to load.
- Union argument types
- Easily create custom Enum types
- Capture and interrupt command execution with hooks - This all you need for permissions in your game. You can register a function that runs before every command is run, and decides if the user can run this command. By default, everyone can do everything.
- Powerful meta-commands allow for infinite possiblities - Automatically run commands when an event is fired, run commands if a string matches a condition, run command embedded inside of other commands, and more.
Potential use cases
Cmdr will work out of the box with minimal configuration, filling the role of admin commands in your game instantly, and doing a great job at it. But Cmdr can also be your best friend when debugging a game, making use of custom commands that can print information to the console based on certain parameters or force game state so you can test a specific scenario. The intelligent and type-safe auto-completion makes it great for commands that manage or modify player data.
But it doesn’t stop there. Cmdr can also be deeply integrated into the core of your game. For example, we can bind commands to any user input. This is very powerful: You could define a command, like cast_ability
, which casts a certain move in your game. Then, you could have a keybindings menu that allows the user to rebind keys, and whenever they do, it runs bind KEY cast_ability ABILITYNAME
in the background. By separating the user input from our hypothetical ability code, our code is made more robust as we can now trigger abilities from a number of possible events and places in our code, in addition to the bound key.
As another example of the versatile meta-commands, we could make Cmdr run any chat message you send as a command if it starts with !
, with the following command:
bind @me runif startsWith ! $1
One more: We can make a command that kills whatever player we are hovering our mouse over by making use of the built-in hover
command, which outputs the name of whatever player you’re currently hovering over. Not too useful by itself, but by using it as an embedded command, we can do something quite special:
alias kill_hover_target kill ${hover}
This creates a new command called “kill_hover_target”, which when run does exactly what it says on the tin. Since embedded commands are just normal commands that you can define yourself, the possibilities here really are endless.
Closing thoughts
I’ve been iterating on Cmdr for the past few months, and I’m very excited to have finally arrived at a point that I’m comfortable calling “version 1”. I’ve had great success and productivity boosts using Cmdr in my own projects, and I hope that you can as well. The documentation is quite detailed, but if you have any questions or problems please feel free to create an issue on the GitHub repository and I will do my best to help out. Contributions to the project are welcome as well
That’s all for now! Evaera, out.