Expand description
Bash script parser for extracting tool definitions from comments.
This parser uses a simple, comment-based annotation syntax to define tools within Bash scripts. The syntax is designed to be readable and easy to write.
The following annotations are supported:
@describe <description>
: A description of the tool.@option --<name>...
: Defines a parameter for the tool. See below for details.@flag --<name>...
: Defines a boolean flag for the tool.@env <VAR_NAME>...
: Defines a required environment variable.@meta require-tools <tool1> <tool2>...
: Lists required external tools.
For @option
, the format is: --<name>[!][<enum_values>][<type_hint>] <description>
!
indicates a required parameter.[...|...]
provides a list of enum values.<TYPE>
provides a type hint (e.g., INT, NUM).
Functionsยง
- parse
- Parses a Bash script and extracts a
ToolDefinition
.