Add CLI & form interface to your program.
Switch branches/tags
Clone or download
Latest commit 5642167 Jul 28, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Set theme's color: highlight_inactive = "light black" Mar 25, 2018
examples Fmt Jul 28, 2018
src Bump version to 0.9 Jul 28, 2018
.gitignore Add example with shell completion Mar 23, 2018
.travis.yml Add travis.yml Feb 8, 2018 Update Jul 28, 2018
Cargo.toml Bump version to 0.9 Jul 28, 2018
LICENSE Initial commit Feb 5, 2018 Bump version to 0.9 Jul 28, 2018

fui Build Status MIT licensed

Add CLI & form interface to your program.

Note: Use it at own risk!!

Basic example


fui = "0.9"

// Example showing imagined CLI app. with two actions

extern crate clap;
extern crate fui;

use fui::{Fui, Value};
use fui::form::FormView;
use fui::fields::Text;

fn hdlr(v: Value) {
    println!("user input (from fn) {:?}", v);

fn main() {
            "help for action1",
            FormView::new().field(Text::new("action1-data").help("help for action1 data")),
            |v| {
                println!("user input (from closure) {:?}", v);
            "help for action2",
            FormView::new().field(Text::new("action2-data").help("help for action2 data")),

This will make the program automatically working in 2 modes:

  1. Ready for parsing CLI arguments, like here:

    $ ./app_basic -h
    app_basic 1.0.0
    xliiv <>
    An Example program which has CLI & form interface (TUI)
        app_basic [SUBCOMMAND]
        -h, --help       Prints help information
        -V, --version    Prints version information
        action1    help for action1
        action2    help for action2
        help       Prints this message or the help of the given subcommand(s)


    $ ./app_basic action1 -h
    help for action1
        app_basic action1 [OPTIONS]
        -h, --help       Prints help information
        -V, --version    Prints version information
            --action1-data <action1-data>    help for action1 data
  2. Ready for getting user input from easy and discoverable TUI interface, like image below:

More examples


Screens example example example


  • empty forms are skipped and executed

  • .validator(OneOf || Regex::new("v\d+.\d+.\d+")).unwrap()

    • or something similiar
  • add option for prose help in widget?

  • add option for prose help in cmd-picker?

    • "path" in "rustup toolchain link -h"
    • perhaps adding new cmd is walkaround, like "link-help" which displays prose
  • reusing fields in form by cloning is stupid

  • command picker show only 5 items Oo

  • expose view's options (eg. submit_anything) on Autocomplete & Multiselect

  • reusing fields in each form, like "verbose for each form"

  • allow disabling copying (ctrl+k)

  • support user's history!

    • make fill-error-correct flow pleasent
  • support for piping!

  • create wrapper FileField

  • create wrapper DirField

  • ctrl+enter submits (#151)?

  • checkbox: automatic toggle on char

  • add & form on_submit returns it?

  • optimalizations

    • feeders use iterators
    • thread
  • more tests

  • error handling & unwraps

  • magic stuff:

    • add magic which renders form for clap (or structopt) if args missing
      • clap should distinguish data types: file, dir, other
    • add magic which works with current programs like: ls, grep, etc.