Key Features
- Automatic Argument Parsing: Command arguments are defined by function parameters
- Type Safety: Built-in support for primitives (Int, Boolean, String, etc.)
- Subcommands: Easy creation of nested command structures
- Optional Arguments: Support for nullable types in Kotlin and
Optionalin Java - Custom Parsers: Extensible argument parsing system
- Auto-generated Help: Automatic help subcommand generation
- Tab Completion: Built-in tab completion support
Basic Structure
To create a command, extend theCommand class:
Command Components
Default Handler
A function annotated with@DefaultHandler is invoked when the command is called with no subcommands:
Subcommands
Functions annotated with@SubCommand create subcommands:
Arguments
Arguments are defined by function parameters:Constructor Parameters
When creating a command, you can configure:name: The command name (required)autoHelpSubcommand: Generate automatic help subcommand (default:true)hideFromAutocomplete: Hide from tab completion (default:false)
Command Aliases
You can define global aliases for your command:Next Steps
Creating Commands
Learn how to create your first command
Arguments
Understand the argument parsing system
Subcommands
Create complex command hierarchies
Registry
Register commands and custom parsers