Skip to content

nikescar/tui.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tui.sh

minimum Text User Interface in bash without ncurses.
just edit yaml and deploy or use in everyday workflow.

Table of Contents

features

  • require bash 4.1+ (available in most(repology) os distribution.)
  • simple navigation with keyboard input. no more.
  • simultanious on-off transition to onscreen app like vim.
  • same workflow, actions are available on tui_web, webapp.
  • vim working on tui.sh
  • htop, glancex, tmux, nano can't be run on tui.sh

on terminal, just two files

  • tui.sh - main tui application file.
  • tui.sh.yaml - example main tui menu tree manifest with yaml v1.2(yaml). no support for multiline, flow, anchor, tag, block, doc stream in yaml v1.2.

+ tui on web

  • tui.web.tar.gz - show tui to web. do predefined actions, check logs and process status.
  • require darkhttpd(github) installed. or simply compile it. check availability on your os pkg here(repology).
  • static solidjs webapp will serve as what tui.sh provides.
  • threre are no cgi server, so tui_web communicates on access.log by requesting dummy url with data which encoded insecurly. it could be dangerous on remote connection, better using it through ssh tunnel.

usage

❯ ./tui.sh --help

   Usage: tui.sh [--yaml YAMLFILE] [--root ROOTPATH] [--dbgfile DEBUGFILE] [--rtime TIMESECOND]
                    [--debug] [--dry-run]

   optional arguments:
     -h, --help                 show this help message and exit
     -y, --yaml YAMLFILE        yaml menu file(default./tui.sh.yaml)
     -r, --root ROOTPATH        absolute path of starting point on tree(default. /bkit)
     -b, --dbgfile DEBUGFILE    debug file path(default. ./tui.debug.log)
     -t, --rtime TIMESECOND     screen refresh time in float second(default. 1.1)
     -d, --debug                debug of the bash script
     --dry-run                  do a dry run, check only md file and exit

tui.sh.yaml

menu and what to do in the menu in the tui.sh app. realworld example for bkit tui.sh.yaml(github)

---
bkit: # root name
  _sha256sum: https://pastebin.com/raw/RscMWHhe # hash check for neccessary files.(tui.sh, tui.sh.yaml tui_web.tar.gz)
  _description: various setup scripts for security. # menu description.
  _batch: ["beginner", "advanced"] # set category for inclustion, exclustion at batch run.
  _keycode: b # keycode on enter the menu.
  _cmd:
    - echo "show output. no control" # command to run on screen without control.
    - sleep 100 & # run background as child processor. no control.
    - exec 1>**_tty_** && $EDITOR file # run on foregound over tui. control.
  _link:
    control: "/bkit/submenu" # direct menu link to other tree in control. . not implemented.
    link: "https://github.com/xxx/xxx" # web link. not implemented.
  status: # normal type submenu
    _description: status menu
    _keycode: t
    _cmd: echo "" # command entry to run on background.
  toggle: # on/off toggle type menu
    _keycode: g
    _description: toogle menu for on / off
    _cmd: echo ""
    _type: toggle # toggle type needs, _check_cmd and _disable_cmd attributes.
    _check_cmd: if [ -z ${tui_toggle+x} ]; then echo 1 && tui_toggle=1; else echo 0 && unset tui_toggle; fi # _check_cmd for enabled(print 1 or any string) or disabled(echo 0 or empty string)
    _disable_cmd: echo ""

for developers

stuff to modify tui.sh.

runtime hash check

download tui.sh hash
https://raw.githubusercontent.com/solidjs/solid/v1.8.0/LICENSE https://cdn.jsdelivr.net/gh/solidjs/[email protected]/LICENSE https://cdn.statically.io/gh/solidjs/solid/v1.8.0/LICENSE https://cdn.staticdelivr.com/gh/solidjs/solid/v1.8.0/LICENSE https://ghproxy.com/https://raw.githubusercontent.com/solidjs/solid/v1.8.0/LICENSE

forbid to use git clone, wget, curl commands in yaml file

simple blocker for not to use script for binary download and runner.
tui.sh is scan input yaml file whether including git clone, wget, curl default.
please put your binary or setup script downloaded by end-user themselves if possible.

debug system

tui.sh --loglv 3
_tui_log 4 "test"

cat tui.debug.log

process histories

[UP/DOWN] [C]lose
navigate through node on tree will generates process hitories like book page.
travel histories by arrow-up and arrow-down key. and close it by put [C] key.

pagenations

[j/k]
in single node or process, travel logs by putting [j] key for page-up and page-down for [k] key.

httpd switch

[t]web
httpd can be turned on with [t] key.

communication with darkhttpd

links

todo

  • example is work in progress. make it simpler.
  • caddy is not working properly.
  • webui components is not organized. tui components is not organized.

Releases

No releases published

Packages

No packages published