⚙️ Command properties
This page describes the properties available to define a command.
Here is a definition example that uses all the properties:
| |
You can check the showcase commands to get definition examples.
Important
Don’t forget to re-build Valet after making changes to your command definitions.
🫚 API reference
Find below the possible command properties and their meaning:
| Name | Required | Value | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| command | ✔️ | The name with which your command can be called by the user. E.g. mycmd will be accessible with valet mycmd. | |||||||||||||||
| function | ✔️ | The name of the function that corresponds to the command. This is the function that will be called by Valet when the user executes this command. | |||||||||||||||
| shortDescription | ✔️ | Shortly describe your command. This will appear next to your command name in the valet menu. This should be a single, short, line. | |||||||||||||||
| description | ✔️ | Long description of your command and its purpose. It will display when getting the help/usage on the command using valet help command or valet command --help. | |||||||||||||||
| hideInMenu | Set to true if you do not want this command to appear in the Valet menu. The command will still get listed in the help/usage of valet. | ||||||||||||||||
| arguments | A list of positional arguments for your command. Arguments are parsed in the order given in the list of arguments for the command definition.
| ||||||||||||||||
| options | A list of options for your command.
Tip All commands will have, by default, an | ||||||||||||||||
| examples | A list of examples for your command. Examples are used in the command help/usage and let the user quickly understand how to use the command.
|