Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MichalGniadek/klask
Automatically create GUI applications from clap3 apps
https://github.com/MichalGniadek/klask
clap gui rust
Last synced: 13 days ago
JSON representation
Automatically create GUI applications from clap3 apps
- Host: GitHub
- URL: https://github.com/MichalGniadek/klask
- Owner: MichalGniadek
- License: mit
- Created: 2021-09-24T01:15:42.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-27T09:06:23.000Z (over 1 year ago)
- Last Synced: 2024-10-31T12:13:16.972Z (13 days ago)
- Topics: clap, gui, rust
- Language: Rust
- Homepage:
- Size: 374 KB
- Stars: 375
- Watchers: 2
- Forks: 23
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![crates.io](https://img.shields.io/crates/v/klask?style=for-the-badge)](https://crates.io/crates/klask)
[![license](https://img.shields.io/crates/l/klask?style=for-the-badge)](LICENSE)
[![docs.rs](https://img.shields.io/docsrs/klask?style=for-the-badge)](https://docs.rs/klask)
# Klask
Allows you to create a gui application automatically from clap (v3). Uses egui for graphics. [Changelog](CHANGELOG.md)## Features
- Supports optional fields with and without default values
- Supports flags with multiple occurrences (`-vvv`)
- Has a native path picker
- Supports fields with multiple values
- Output is colored and has clickable links
- Combo boxes for arguments with only some values allowed
- Subcommands
- Optionally allow setting environment variables, stdin and working directory
- Progress barsIf you are using this library please contact me, I'm definitely interested!
Create an Issue if you find any bugs or would like a feature added!Example gui:
![image showcasing the gui](media/showcase-2021-09-25.png)Generated from [miniserve](https://github.com/svenstaro/miniserve)'s app:
![image showcasing the gui](media/miniserve-2021-09-25.png)## How it works
* The binary runs and there's no `CHILD_APP_ENV_VAR` environment variable ⇾ no user code runs, only the GUI is displayed.
* The "Run" button in the GUI is pressed ⇾ `CHILD_APP_ENV_VAR` is set, the binary is started again. Arguments are passed to `stdin` and `stdout` is intercepted for displaying output.
* The binary is run with `CHILD_APP_ENV_VAR` ⇾ the user-provided closure is run.