https://github.com/fadeevab/cliclack
Beautiful, minimal, opinionated CLI prompts inspired by the Clack NPM package
https://github.com/fadeevab/cliclack
Last synced: about 1 year ago
JSON representation
Beautiful, minimal, opinionated CLI prompts inspired by the Clack NPM package
- Host: GitHub
- URL: https://github.com/fadeevab/cliclack
- Owner: fadeevab
- License: mit
- Created: 2023-07-13T16:42:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-05T21:46:46.000Z (about 1 year ago)
- Last Synced: 2025-04-11T14:17:56.464Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 397 KB
- Stars: 248
- Watchers: 1
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Effortlessly build beautiful command-line apps with Rust 🦀✨
[](https://github.com/fadeevab/cliclack)
[](https://crates.io/crates/cliclack)
[](https://docs.rs/cliclack/)
[](https://github.com/fadeevab/cliclack/blob/main/LICENSE)
Beautiful, minimal, opinionated CLI prompts inspired by the
[@clack/prompts](https://www.npmjs.com/package/@clack/prompts) `npm` package.
```sh
cargo add cliclack
```
cliclack in action
```sh
cargo run --example basic
cargo run --example log
```
💎 Fancy minimal UI
✅ Simple API
🎨 Theme support
### Setup
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!")?;
```
### Input
The input prompt accepts a single line of text trying to parse it into a target type.
Multiline input can be enabled using the `multiline()` switch.
```rust
use cliclack::input;
let path: String = input("Where should we create your project?")
.placeholder("./sparkling-solid")
.validate(|input: &String| {
if input.is_empty() {
Err("Please enter a path.")
} else if !input.starts_with("./") {
Err("Please enter a relative path")
} else {
Ok(())
}
})
.interact()?;
```
### 🎨 Theme
A custom theme can be applied for UI rendering. An example of theme customization:
```sh
cargo run --example theme
```
### 🚥 Progress Bar
Starting from `cliclack = "0.2.3"`, progress bars and multi-progress bars are supported.
### See more
- [Documentation](https://docs.rs/cliclack)
- [Examples](https://github.com/fadeevab/cliclack/tree/main/examples)