AI prompts
base on AppCUI โ A feature-rich and cross-platform TUI/CUI framework for Rust, enabling modern terminal-based applications on Windows, Linux, and macOS. Includes built-in UI components like buttons, menus, list views, tree views, checkboxes, and more. Perfect for building fast and interactive CLI tools and text-based interfaces # AppCUI-rs
<img src="https://raw.githubusercontent.com/gdt050579/AppCUI-rs/main/docs/chapter-1/img/logo.png" align="center" />
```
โฏ ๐๐ฝ๐ฝ๐๐จ๐-๐ฟ๐ ๐ณ
```





[](https://crates.io/crates/appcui)
[](https://docs.rs/appcui)
AppCUI is a simple, easy-to-use and cross-platform library for creating text-based user interfaces in Rust:
* [Book](https://gdt050579.github.io/AppCUI-rs/)
* [Documentation](https://docs.rs/appcui)
## โจ Features
- [x] multiple out-of-the-box controls (buttons, labels, text boxes, check boxes, radio buttons, list views, tree views, combo boxes, date/time pickers, color pickers, etc.).
- [x] menus and toolbars
- [x] multi-platform support (Windows via API, Linux via ncurses, MacOS via termios)
- [x] multi-threading support
- [x] timers
- [x] mouse support
- [x] clipboard support
- [x] color themes
- [x] support for Unicode characters
- [x] predefined dialogs (message box, input box, color picker, save & open dialogs, folder navigator, etc)
- [x] true colors support (24 bits per pixel) for terminals that supports it.
## ๐ธ Screenshots
<img src="https://github.com/gdt050579/AppCUI-rs/raw/main/docs/chapter-1/img/appcui-rs-demo.gif" align="center" />
## ๐ฅ๏ธ Backends
AppCUI supports various backends based on the operating system it is being used for:
* **Windows Console** - based on Win32 low level API, design for clasical windows console
* **Windows VT** - based on ANSI sequances, designed for modern windows virtual terminals
* **NCurses** - based on NCurses API for linux envinronments
* **Termios** - based on ANSI sequances and low level APIs for MAC OSX
* **Web Terminal** - designed for Web implementation (based on webgl)
* **CrossTerm** - based on the `crossterm` crate, but enabled via a feature flag
More on the supported backends can be found [here](docs/chapter-2/backends.md)
## ๐ Quick Start
Add the following to your `Cargo.toml`:
```toml
[dependencies]
appcui = "*"
```
Then create a new Rust project and add the following code:
```rust
use appcui::prelude::*;
fn main() -> Result<(), appcui::system::Error> {
let mut app = App::new().build()?;
let mut win = window!("Test,d:c,w:30,h:9");
win.add(label!("'Hello World !',d:c,w:13,h:1"));
app.add_window(win);
app.run();
Ok(())
}
```
Then run the project with `cargo run`. You should see a window with the title `Test` and the text `Hello World !` in the center.
## ๐งช Examples
- ๐ [Hello World](examples/hello_world/)
- ๐งฎ [Calculator](examples/calculator/)
- ๐จ [Color Picker](examples/colorpicker/)
- ๐ [Menus](examples/menus/)
Check out the [examples](examples) folder for more examples.
## ๐ ๏ธ A more complex example
Am example that creates a window with a button that when pressed increases a counter.
```rust
use appcui::prelude::*;
// Create a window that handles button events and has a counter
#[Window(events = ButtonEvents)]
struct CounterWindow {
counter: i32
}
impl CounterWindow {
fn new() -> Self {
let mut w = Self {
// set up the window title and position
base: window!("'Counter window',d:c,w:30,h:5"),
// initial counter is 1
counter: 1
};
// add a single button with the caption "1" (like the counter)
w.add(button!("'1',d:b,w:20"));
w
}
}
impl ButtonEvents for CounterWindow {
// When the button is pressed, this function will be called
// with the handle of the button that was pressed
// Since we only have one button, we don't need to store its handle
// in the struct, as we will receive the handle via the on_pressed method
fn on_pressed(&mut self, handle: Handle<Button>) -> EventProcessStatus {
// increase the counter
self.counter += 1;
// create a text that containe the new counter
let text = format!("{}",self.counter);
// aquire a mutable reference to the button using its handle
if let Some(button) = self.control_mut(handle) {
// set the caption of the button to th new text
button.set_caption(&text);
}
// Tell the AppCUI framework that we have processed this event
// This allows AppCUI to repaint the button
EventProcessStatus::Processed
}
}
fn main() -> Result<(), appcui::system::Error> {
// create a new application
let mut a = App::new().build()?;
// add a new window (of type CounterWindow) to the application
a.add_window(CounterWindow::new());
// Run AppCUI framework (this wil start the window loop and messaage passing)
a.run();
Ok(())
}
```
## ๐ฃ๏ธ Roadmap
- [x] Basic set of widgets and support for Windows, Linux and MacOS
- [x] WebGL support
- [ ] OpenGL / SDL / Vulkan support
- [ ] TextArea support for code highlighting
## ๐ค Contributing
Contributions, issues, and feature requests are welcome!
Check out [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
Join the discussion in [GitHub Discussions](https://github.com/gdt050579/AppCUI-rs/discussions).
", Assign "at most 3 tags" to the expected json: {"id":"14225","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"