Crate Structure Reference
clish is organized as a Cargo workspace with three crates.
Crate table
| Crate | Purpose | Should you depend on it? |
|---|---|---|
clish |
Public API crate. Re-exports everything from the other two crates and provides the app! macro. |
Yes. This is the only crate your application should depend on. |
clish-core |
Runtime types and logic: App, CommandEntry, ParamEntry, argument parsing, help rendering, error formatting, and the AppStyles system. |
No. Re-exported through clish. |
clish-macros |
Procedural macro crate providing the #[command] attribute macro. |
No. Re-exported through clish. |
Public exports
Everything you need is available through clish::prelude::*:
| Item | Re-exported from |
|---|---|
App |
clish_core::app::App |
Pos<T> |
clish_core::types::Pos |
Named<T> |
clish_core::types::Named |
Flag |
clish_core::types::Flag (alias for bool) |
command |
clish_macros::command |
app! |
Defined in clish |
Additional items available directly from clish:
| Item | Re-exported from |
|---|---|
ErrorKind |
clish_core::parse::ErrorKind |
help module |
clish_core::help |
inventory |
clish_core::inventory (internal) |
parse module |
clish_core::parse (internal) |
CommandEntry |
clish_core::parse::CommandEntry (internal) |
Workspace structure
clish/
├── Cargo.toml # Workspace definition
├── clish/ # Public API crate
│ └── src/lib.rs # Re-exports + app! macro
├── clish-core/ # Runtime crate
│ └── src/
│ ├── lib.rs # Module exports
│ ├── app.rs # App struct and dispatch
│ ├── types.rs # Pos, Named, Flag types
│ ├── help.rs # Help text and error rendering
│ └── command/
│ └── parse.rs # Argument parsing and validation
└── clish-macros/ # Proc-macro crate
└── src/lib.rs # #[command] macro