With 1.21.80.22 Preview versions of Minecraft, you can create your own script commands! Find out how in this video.
NOTE: As of 1.21.80.27, some of the APIs have already changed (based on your feedback!) - you can see an updated sample at https://github.com/microsoft/minecraft-scripting-samples/tree/main/custom-commands.
Documentation: https://learn.microsoft.com/minecraft/creator/documents/customcommands
Code sample used in this video: https://github.com/microsoft/minecraft-scripting-samples/tree/main/custom-commands