argparse-tui is a Python package that can convert your Argparse CLI into a Textual UI (TUI). It is also able to provide a TUI interface to existing command-line apps using Argparse as a declarative DSL. This library is a soft-fork of Trogon, powered by the Textual TUI framework, refactored for use with Python’s native Argparse, instead of Click.
argparse-tui
Present your Argparse CLI as a Textual UI (TUI).
Documentation | Git Repo
argparse-tuiis a Python package that can convert your Argparse CLI into a Textual UI (TUI). It is also able to provide a TUI interface to existing command-line apps using Argparse as a declarative DSL. This library is a soft-fork of Trogon, powered by the Textual TUI framework, refactored for use with Python’s native Argparse, instead of Click.Distinguishing Features
This package also has these distinguishing features from it’s upstream relative, Trogon:
Vim-friendly Nav
j/k./to focus search.Enterto focus the selected command.Escapeto focus the command-tree.Ctrl+yto copy the current command.Redaction
Redact sensitive values in the TUI by including the term
<secret>in the argument’s help text.Pre-populating TUI
Command-line args are used to filter and pre-populate the TUI form.
Use
argparse-tui can display a TUI of your Python Argparse CLI in one of two ways:
Examples
Example scripts for Argparse, Yapx, are provided in the
examples/directory.Install
Related Projects
fresh2dev/TUIview is a Python CLI that uses argparse-tui TUIs for existing CLI applications.
fresh2dev/yapx is a Python library for building a Python CLI from your existing Python functions, with
argparse-tuisupport built-in.fresh2dev/myke is a Python CLI that builds on argparse-tui and Yapx to serve as a task runner with a CLI and TUI interface.