clish
The most elegant CLI framework for Rust.
clish (/klɪʃ/ "KEL-ish")
use *;
Inspired by Typer
Quick Start
[]
= "0.1.0-beta.3"
use *;
# Hello, Alice!
Usage
Argument Types
| Type | CLI Form |
|---|---|
Pos<T> |
<arg> required positional |
Pos<Option<T>> |
[arg] optional positional |
Pos<Vec<T>> |
<arg>... variadic (zero or more) |
Named<T> |
--name <val> required option |
Named<Option<T>> |
[--name <val>] optional option |
Named<Vec<T>> |
--name <val> --name <val> repeatable |
bool |
--flag presence flag |
Named options support --name=value, --name value, -n value, and -nvalue forms.
Flags support bundling: -abc is equivalent to -a -b -c.
Command Options
Parameter Options
| Key | Type | Description |
|---|---|---|
help |
string | Short description |
details |
string | Long description (shown only in --help) |
name |
string | Override the CLI flag name |
short |
char | Single-character alias (-d) |
placeholder |
string | Custom help token |
hide |
bool | Omit from help listings |
default |
string | Default value |
env |
string | Environment variable fallback |
choices |
array | Allowed values |
conflicts_with |
array | Mutual exclusion |
requires |
array | Prerequisites |
value_hint |
string | Shell completion hint (reserved) |
Resolution order: CLI argument > $ENV_VAR > default > error.
Oneshot Mode
Pass a command function to app!() for single-command CLIs without subcommand dispatch:
use *;
Oneshot mode enforces that the command has no custom name, aliases, hidden, or deprecated attributes, and that no other commands are registered.
Styling
use *;
use ;
app!
.styles
.run;
Or use anstyle::Style values directly:
use ;
app!
.styles
.run;
Error Handling
Errors are printed to stderr with structured formatting:
error: unknown command 'deplyo'
|
1 | myapp deplyo
| ^^^^^^
|
= hint: run 'myapp --help' for available commands
Command functions can return Result<(), String> for custom error handling.
Documentation
Full docs: https://razkar.codeberg.page/clish API documentation: https://docs.rs/clish
License
MIT or Apache-2.0
Cheers, RazkarStudio.
Copyright (c) 2026 RazkarStudio. All rights reserved.