Cmdr: A fully extensible and type safe command console for Roblox Developers

That’s what I did to get started. I like the system but the support is very lackluster at times

1 Like

how can i pre-bind actions to the chat bar? like as soon as the game loads up the player is able to :kill without me having to bind it?

You can bind actions when a user joins the game by running CmdrClient:Run() in your client initialization script and passing the command string as the first parameter.

1 Like

Would someone be able to help me make cmdr open with a button? Using the following I think is part how it’ll work but unsure since I haven’t been able to make it work.

<CmdrClient>:Show() - - Shows the Cmdr window, as long as it is enabled. <CmdrClient>:Hide() -- Hides the Cmdr window. <CmdrClient>:Toggle() -- Toggles the Cmdr window, will not show if it is not enabled.

I use TopBar+, but you can adjust my code to make it work for you.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Cmdr = require(ReplicatedStorage:WaitForChild("CmdrClient"))
local Icon = require(ReplicatedStorage.Modules.Icon)

if game:GetService("Players").LocalPlayer:GetRankInGroup(GroupID) >= 10 then
	Cmdr:SetEnabled(true)
	local icon = Icon.new()
	:setImage("rbxassetid://9790261539", "deseleceted")
	:setImage("rbxassetid://9790261414", "selected")

	icon.selected:connect(function()
		Cmdr:Show()
	end)

	icon.deselected:connect(function()
		Cmdr:Hide()
	end)

	Cmdr:SetActivationKeys({Enum.KeyCode.X})
else
	Cmdr:SetEnabled(false)
end

Interesting… I never thought to use TopBar+ to make Cmdr show up.

How do you even reference that though?

EDIT: Never mind, I figured it out.

Would you mind sharing? I still cant figure it out. Thanks btw

Oh, got it. So using entirety of topbar and adding this to it. Thank you

Hi
Is there a way to prevent players in a certain group from seeing commands inside another group?
My usecase for this is that I have two groups: one group is ‘Admin’ and the other is ‘PrivateServer’.

I don’t want players inside the PrivateServer group to see the commands inside the Admin group.

How do you add different permission groups into Cmdr?

1 Like

hi, is there a feature to show presets,

return {
	Name = "modifyCurrency";
	Aliases = {"cash", "changeCash"};
	Description = "Change currency data of a Player.";
	Group = "Admin";
	Args = {
		{
			Type = 'string';
			Name = 'Type';
			Description = 'Type of the data (add/remove/set).';
			Presets = {
				{
					Name = 'add', -- name
					Value = 'ADD' -- will return ADD
				},
				{
					Name = 'remove', -- name
					Value = 'REMOVE' -- will return REMOVE
				},
				{
					Name = 'set', -- name
					Value = 'SET' -- will return SET
				},

			}
		},
		{
			Type = 'player';
			Name = 'Player';
			Description = 'The Player that you will modify his data.';
			
		},
		{
			Type = 'number';
			Name = 'Value';
			Description = 'Value of the data.';

		},
	}
}
1 Like

Hi, I am not sure how to make this type listable. Can anyone help me please? I have looked in the documentation, but there is no way documented to make an Enum type listable.

return function (registry)
	registry:RegisterType("pass", registry.Cmdr.Util.MakeEnumType("Pass", {
			"ROCKETLAUNCHER",
			"VIP",
			"DOUBLEJUMP",
			"GRAVITYCOIL",
			"SPEEDCOIL"
	}))
end

@Pcoi94 If you want to define predetermined values for an argument, you can create an Enum type.


@CSJeverything The Util.MakeEnumType method returns a TypeDefinition, which can be passed as the first argument to the Util.MakeListableType method.

3 Likes

Cmdr v1.12.0 - Bug Fixes, Improvements, and Security Advisory

Hello fellow developers,

We are excited to announce the release of Cmdr v1.12.0! This version brings several bug fixes, quality of life improvements, and a security advisory that requires your immediate attention. Let’s dive into the details:

Changelog

  • Added a new default command: convertTimestamp. It provides a human-readable timestamp from epoch seconds.
  • Introduced built-in types: positiveInteger, nonNegativeInteger, byte (0-255), and digit (0-9), including their respective plural types.
  • Added a json built-in type, which takes a JSON string and provides a Luau table.
  • Implemented internal IsServer assertions for RegisterDefaultCommands and commandServerScript.
  • Updated the help command output with useful ‘tips.’
  • Made the window scroll to the bottom on input.
  • Modified fuzzy finders to search the entire string instead of just the start.
  • Improved the autocomplete menu by making it scrollable.
  • Fixed the window resizing issue that occurred after using the clear command.
  • Removed the global initialization scripts feature.

Security Advisory

Please note that in version 1.12.0, a high-severity security vulnerability (CVSS 7.5) was discovered. This vulnerability affects the var and var= (varSet) commands. If you use Cmdr in a production environment, we urge you to read the security advisory provided at the following link for more information:

Cmdr Security Advisory - GHSA-4vh6-p9hm-qwrr

Summary of the Security Advisory

The bug in the var and var= (varSet) commands allows potential attackers to execute commands on behalf of others, including with those users’ permissions. It is crucial to take immediate action to address this vulnerability and upgrade to the latest version of Cmdr.

To update your Cmdr installation to v1.12.0, please visit the official repository on GitHub:

Cmdr v1.12.0 Release

We highly recommend all developers using Cmdr to update to this version to benefit from the bug fixes and improvements while addressing the security vulnerability.

If you have any questions, concerns, or feedback regarding this release or the security advisory, please don’t hesitate to reach out. We appreciate your continued support and collaboration in making Cmdr a robust and secure command-line framework.

Happy coding!

5 Likes

Love it, thanks for the update.

1 Like

can you please help with a bug, my commands not always registering

This honestly seems like one, if not the best open source console command system I’ve seen. I might make something similar to this in the future, but for now this is definitely a system that I’ll be looking into and perhaps implementing into my own open sourced admin system.

2 Likes

I have addressed your thread. For faster support from our team, I suggest joining our Discord server and utilizing the #cmdr channel. This way, you can receive prompt assistance.

I know previously I’ve suggested this, but people told me to put a github issue about it, but I forgot and now I’m blocked from creating issues, so I’ll put it here.

Ability to define a table of command permissions/groups like:

return {
	Name = "kick",
	Aliases = {"boot"},
	Description = "Kicks a player",
	Group = {"Creators", "Administrators"},
	Args = {
		{
			Type = "player",
			Name = "target",
			Description = "The player being kicked"
		},
		{
			Type = "string",
			Name = "reason",
			Description = "The reason for kicking this player"
		}
	}
}

This will be useful, if somebody has multiple command permissions and can set them individually. I would pull request a feature like this, but cannot.