# Basic Example for XaCLI
This example demonstrates how to create a simple CLI application using the XaCLI framework. It showcases the basic structure of an application, including defining commands, handling input, and displaying output.
## Features Demonstrated
- **App Creation**: Create an app with name and version
- **Commands**: Define commands with title and description
- **Subcommands**: Nested command structure (`calc add`, `calc mul`)
- **Command Aliases**: Alternative command names (`echo` / `e`)
- **Flags**: Boolean flags (`--loud`, `-l`)
- **Options**: Key-value options (`--name Alice`, `-n Alice`)
- **Positional Arguments**: Order-based arguments (`calc add 1 2`)
- **Multiple Values**: Variadic arguments (`echo Hello World`)
- **Default Values**: Optional arguments with defaults
- **Execution Hooks**: `pre_run`, `run`, `post_run` lifecycle
## Usage
```bash
# Show help
cargo run --example basic -- --help
# Show version
cargo run --example basic -- --version
# Greet command with options
cargo run --example basic -- greet --name Alice
cargo run --example basic -- greet -n Bob -c 3 -l # repeat 3 times, loud mode
# Echo command with positional arguments
cargo run --example basic -- echo Hello World
# Calculator subcommands
cargo run --example basic -- calc add 10 20
cargo run --example basic -- calc mul 7 8
```
## Output Examples
```
$ cargo run --example basic -- greet -n Bob -c 2 -l
[pre_run] Preparing to greet...
HELLO, BOB!
HELLO, BOB!
[post_run] Greeting complete!
$ cargo run --example basic -- calc add 10 20
10 + 20 = 30
```