Skip to main content

cmdgui

Simple terminal GUIs in Python. Draw your layout as text, fill in the widgets, and keep writing your program — the view runs on its own thread, so there's no event loop to hand control to and no draw calls to make.

┌─ name ───────────────────┐
│quinn                     │[         Greet          ] ON   fast
├─ fruit ──────────────────┼─ scores ──────────────────────────────────┐
│ apple                    │name      score  city                      │
│ banana                   │Ada       98     London                    │
│ cherry                   │Linus     87     Helsinki                  │
│                          ├─ log ─────────────────────────────────────┤
│                          │Hello, quinn! 👋                           │
│                          │picked cherry                              │
└──────────────────────────┴───────────────────────────────────────────┘
 ████████████████████████████████░░░░░░░░░░░░░░░░  67%[ ] done

No dependencies. macOS and Linux; Windows support is written but untested.

Install

pip install cmdgui

Quick start

from cmdgui import View, Button, Stdout
import time

class App(View):
    layout = """
        start  pause  .
        log    -      -
    """
    start = Button("Start", on_click=lambda: print("started"))
    pause = Button("Pause", on_click=lambda: print("paused"))
    log = Stdout()

view = App()

for i in range(100):
    print(f"tick {i}")   # shows up in the log box
    time.sleep(0.5)

Press q to quit (or Ctrl+C). Because the widgets are class attributes, your editor knows view.start is a Button — autocomplete and type checking work.

What's in it

  • Layouts drawn as text: each word is a grid cell, - and | stretch a widget across cells, and borders between neighbours join up.
  • Widgets: text, labels, buttons, one-line and multi-line text boxes (with password mode and history), checkboxes, toggles, radio buttons, dropdowns, sliders, progress bars, menus, folding trees, tables, a calendar and date picker, tabs, split panes to drag, a log viewer with levels and search, a box that shows everything you print, and a pixel canvas with lines, shapes and curves.
  • Styled text: "[bold red]Error:[/] couldn't open [cyan]notes.txt[/]" in labels, buttons and text.
  • Text boxes that behave: select with the mouse or Shift, copy, cut and paste, pasting in one go, and dim hints before, after and ahead of the cursor for autocomplete.
  • Inline views: draw in a few rows under the prompt instead of the whole screen, with printed text scrolling above.
  • Popups: dialogs, dropdowns and command menus that float over the layout.
  • Mouse and keyboard: clicks, dragging, the scroll wheel, Tab between widgets, and your own key bindings.
  • Timers: view.every(1, tick) and view.after(5, fn), no threads needed.
  • Themes: restyle any part, with 73 named colors, the 256-color palette, or exact hex colors.
  • Your own widgets: subclass Widget, draw into a canvas, and it works in layouts.

Documentation

The examples folder has a widget demo, a dashboard, popups, tabs, a console, a file browser, pixel graphics, a log viewer with split panes, date pickers, and an inline progress display.

Metadata

Release files for cmdgui 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cmdgui 0.3.0
File Size Uploaded Provenance
cmdgui-0.3.0.tar.gz 79.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cmdgui 0.3.0
File Interpreter ABI Platform
cmdgui-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 168.0 kB

Release files / cmdgui-0.3.0.tar.gz

Download URL cmdgui-0.3.0.tar.gz
Size 79.6 kB
Tags Source
SHA-256 checksum
How to use checksums
032fdb6513f195c9e8d2e2bf55cd00262adcb7a2ed26d1c3eecfe80a5e1c448a
BLAKE2b-256 checksum
How to use checksums
b7a1f0a240cda170b48fe74c682e7432403bfb06cae8c742a7935c71493ced4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / cmdgui-0.3.0-py3-none-any.whl

Download URL cmdgui-0.3.0-py3-none-any.whl
Size 88.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c10d230aa234d7ab1121487b939d11412c5b8971bb056d66f4ced974b6036506
BLAKE2b-256 checksum
How to use checksums
996c3f9127f42cefe6da8a2de6a1cff9e08bebec982a1f5e9f9afe801d7c8e3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Security for cmdgui 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cmdgui-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page