cape.ui Readline-based user interface to CAPE

This class provides an interactive interface for the main CAPE tools (that is, running CFD) without major third-party dependencies. This simplified CAPE UI is launched using

$ cape ui

There are two main applications to using this user interface:

  1. Targeted tab-completion

    The user interface provides CAPE-aware tab completions based on details of the CLI defined in cape.cfdx.cli, including

    • inferring the sub-command such as cape extend, cape run, etc. (see cape.cfdx.cli.CfdxFrontDesk._cmdlist);

    • knowledge of which options are available for each sub-command (for example cape edit-json - and cape c - will have different tab-completion suggestions);

    • knowledge of which options expect file names.

  2. Dedicated history

    The CAPE UI maintains a separate history file so that users can recall previous commands using the “UP” arrow key.

While using the CAPE UI pseudo-shell, users will still be able to run non-CAPE commands, though in that case tab-completion may not be as smart as the native shell.

cape.ui.main(cls: type | None = None) → Tuple[int, dict]

Main interactive UI function

Call:
>>> ierr, result = main(cls)
Inputs:
cls: type

cape.argread.ArgReader subtype, for completions

Outputs:
ierr: int

Return code

result: dict

Information about results of commands run