ToolDefinition class
Definition of a CLI tool for buildkit and similar applications.
Provides metadata for automatic help generation, argument parsing, and traversal configuration.
- Available extensions
Constructors
-
ToolDefinition({required String name, required String description, String version = '1.0.0', String? versionString, ToolMode mode = ToolMode.multiCommand, String? pipelineName, NavigationFeatures features = const NavigationFeatures(), List<
OptionDefinition> globalOptions = const [], List<CommandDefinition> commands = const [], String? defaultCommand, List<HelpTopic> helpTopics = const [], Set<Type> ? requiredNatures, Set<Type> worksWithNatures = const {}, String? wiringFile, List<ToolWiringEntry> ? defaultIncludes}) -
const
Properties
-
allGlobalOptions
→ List<
OptionDefinition> -
Get all global options including feature-based options.
no setter
-
commands
→ List<
CommandDefinition> -
Available commands (empty for single-command tools).
final
- defaultCommand → String?
-
Default command when none specified (multi-command tools).
final
-
defaultIncludes
→ List<
ToolWiringEntry> ? -
Default nested tools wired into this tool at the code level.
final
- description → String
-
Human-readable description for help text.
final
- features → NavigationFeatures
-
Navigation features supported by this tool.
final
-
globalOptions
→ List<
OptionDefinition> -
Tool-level options (applied before command).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasWiring → bool
-
Whether this tool has any wiring configuration (code-level or file-level).
no setter
-
Footer text for help output.
final
-
helpTopics
→ List<
HelpTopic> -
Help topics available via
tool help <topic>.final - mode → ToolMode
-
Tool mode (multi-command, single-command, hybrid).
final
- name → String
-
Tool name (e.g., 'buildkit', 'ws_tools').
final
- pipelineName → String
-
Prefix used for delegated pipeline command entries.
final
-
requiredNatures
→ Set<
Type> ? -
Nature types that ALL must be present on a folder for the tool to run.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → String
-
Version string (e.g., '2.0.0').
final
- versionString → String?
-
Full version string for --version output.
final
-
visibleCommands
→ List<
CommandDefinition> -
Get all visible commands (not hidden).
no setter
- wiringFile → String?
-
File that contains nested tool wiring configuration.
final
-
worksWithNatures
→ Set<
Type> -
Nature types where at least ONE must be present on a folder.
final
Methods
-
copyWith(
{String? name, String? description, String? version, String? versionString, ToolMode? mode, String? pipelineName, NavigationFeatures? features, List< OptionDefinition> ? globalOptions, List<CommandDefinition> ? commands, String? defaultCommand, List<HelpTopic> ? helpTopics, Set<Type> ? requiredNatures, Set<Type> ? worksWithNatures, String? wiringFile, List<ToolWiringEntry> ? defaultIncludes}) → ToolDefinition - Create a modified copy of this tool definition.
-
findCommand(
String nameOrAlias) → CommandDefinition? - Find command by name, alias, or unambiguous prefix.
-
findCommandsWithPrefix(
String prefix) → List< CommandDefinition> - Find all commands matching a prefix.
-
findHelpTopic(
String name) → HelpTopic? - Find a help topic by name.
-
generateCompletion(
ShellType shell) → String -
Available on ToolDefinition, provided by the ToolDefinitionCompletion extension
Generate completion script for the specified shell. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- kAutoWiringFile → const String
- Sentinel value for convention-based wiring file discovery.