Beautiful, minimal, opinionated CLI prompts inspired by the
@clack/prompts npm
package.
sh
cargo add cliclack
cliclack
in actionsh
cargo run --example basic
cargo run --example log
cargo run --example theme
💎 Fancy minimal UI
✅ Simple API
🎨 Theme support
The intro
and outro
/outro_cancel
functions will
print a message to begin and end a prompt session respectively.
```rust use cliclack::{intro, outro};
intro("create-my-app")?; // Do stuff outro("You're all set!")?; ```
The input prompt accepts a single line of text trying to parse it into a target type.
```rust use cliclack::input;
let path: String = input("Where should we create your project?") .placeholder("./sparkling-solid") .validate(|input: &String| { if input.isempty() { Err("Please enter a path.") } else if !input.startswith("./") { Err("Please enter a relative path") } else { Ok(()) } }) .interact()?; ```