Architecture
XaCLI crate structure and design
Architecture
Crate Structure
crates/
├── xacli/ # Facade crate (ONLY PUBLISHED)
├── xacli-core/ # Core types (internal)
├── xacli-derive/ # Derive macros (internal)
├── xacli-components/ # UI components (internal)
└── xacli-testing/ # Testing utilities (internal)
Important: Only xacli is published to crates.io. Internal crates have publish = false.
User API
// Core (always available)
use xacli::{App, Command, Arg, Context, Result};
// Derive macros
use xacli::derive::{App, Command};
// Interactive components
use xacli::components::*;
// Testing utilities
use xacli::testing::{TestingApp, TestCase, assert};
Feature Flags
| Feature | Description |
|---|---|
derive | Derive macros |
components | Interactive UI |
testing | Test utilities |
Default: empty (default = [])
Design Principles
- Derive-first - Derive macros are the primary API
- Owned data - Commands use owned strings, not references
- Sync-first - Synchronous execution (async planned)
- Testable - Built-in testing support via
TestingApp
Execution Flow
#[derive(App)] struct → MyApp::execute() → parse args → run commands