Skip to main content

Tools for turning terminal sessions into JSON/HTML.

Project description

A fairly generic tool that allows you to capture all of the output from
a terminal application (including shells). This output is then rendered in
a pure-python terminal emulator (pyte), and the resulting virtual "screen"
is dumped to either generic JSON or a generic HTML snippet that can then
be used to by other tools or inserted into a webpage.

There are issues with some complex curses applications that use certain
CSI control codes not (yet) supported by pyte. For example, htop will not

This tool was designed specifically to turn zsh themes into a gallery.


echo "ls\\nexit\\n" > omt-py html -- /bin/zsh

omt-py json - Generates a JSON representation of the screen.
omt-py html - Generates a generic HTML snippet or a standalone
omt-py iterm-to-css - Converts an iTerm2 theme into CSS suitable for
usage with the HTML snippets generated by omt.

omt-py json [options] -- <argv>...
omt-py html [options] -- <argv>...
omt-py iterm-to-css [--prefix=<prefix>] <source>

--width=<columns> The number of columns for the pseudo-terminal.
[default: 80]
--height=<lines> The number of lines for the pseudo-terminal.
[default: 24]
--standalone When generating HTML, generate a standalone page
instead of a generic snippet.
--theme=<source> When generating standalone HTML, use this iTerm2
theme for the CSS.
--prefix=<prefix> The prefix to use for CSS selectors.
[default: omt]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omt-0.1.0.tar.gz (4.3 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page