DevToys exposes a command-line interface alongside its GUI. Two attributes —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DevToys-app/DevToys/llms.txt
Use this file to discover all available pages before exploring further.
CommandNameAttribute and CommandLineOptionAttribute — wire up an ICommandLineTool implementation to that CLI surface. CommandNameAttribute defines the top-level command (e.g. devtoys base64), while CommandLineOptionAttribute is applied to properties to declare individual --option flags.
CommandNameAttribute
Namespace:DevToys.ApiTarget:
AttributeTargets.ClassAllowMultiple:
false
ICommandLineTool class must carry exactly one [CommandName] attribute declaring the primary command word and its description resources.
Properties
The primary command name as it will be typed by users on the command line. For example, setting
Name = "base64" makes the command available as devtoys base64 ....The value must be non-null and non-empty. By convention, use lowercase kebab-case for multi-word names (e.g. "jwt-decode").An optional short alias for the command. For example,
Alias = "b64" allows devtoys b64 ... as a shorthand. Must be non-null and non-empty if set.The resource key (within
ResourceManagerBaseName) whose value is the human-readable description of the command, shown in --help output.The fully qualified base name of the .NET resource manager used to look up
DescriptionResourceName. For example, "MyExtension.Strings.Base64Strings".CommandLineOptionAttribute
Namespace:DevToys.ApiTarget:
AttributeTargets.PropertyAllowMultiple:
falseInherits from:
CommandNameAttribute
[CommandLineOption] to a property on your ICommandLineTool class to declare a CLI option. DevToys uses MEF metadata to read the attribute and bind option values to properties before invoking InvokeAsync.
Properties
The name of the option, used as
--name <value> on the command line. For example, Name = "file" produces --file <value>.A single-character (or short) alias, used as
-alias <value>. For example, Alias = "f" produces -f <value>.When
true, the CLI will report an error if the user does not supply this option. Defaults to false.The resource key whose value is the option description displayed in
--help output.The base name of the resource manager for resolving
DescriptionResourceName. Inherited from CommandNameAttribute.Full Usage Example
The following example shows a Base64 encoding CLI tool with two options: a required--input string and an optional --encode flag.
CommandLineOptionAttribute extends CommandNameAttribute, so DescriptionResourceName and ResourceManagerBaseName are inherited and must still be set on each option attribute.