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. Panels group widgets, can be scrolled when they don't fit, and lines between widgets can be made draggable.
  • 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, a log viewer with levels and search, a box that shows everything you print, a terminal that runs a shell or any program inside the layout, 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, and Markdown documents with Text(markdown=True).
  • 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, and questions that wait for the answer: if view.confirm("Delete it?"): ..., and notifications in the corner: view.notify("Saved", "ok").
  • Mouse and keyboard: clicks, dragging, the scroll wheel, right-click menus, Tab between widgets, your own key bindings, and a footer that shows the keys that work right now.
  • Timers: view.every(1, tick) and view.after(5, fn), no threads needed.
  • Forms: view.values is every input's value as a dict (panels nested inside), and setting it fills them back in, so saving settings is one json.dump.
  • Progress from a loop: for f in view.bar.track(files): ... shows how many are done and how long is left.
  • 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, dialogs that wait for an answer, tabs, a console, a file browser, pixel graphics, a log viewer with draggable lines, date pickers, a shell and a Python REPL side by side, a reader for these docs, a long form that scrolls, a settings form saved as JSON, progress bars driven by loops, and an inline progress display.

Metadata

Release files for cmdgui 0.4.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.4.0
File Size Uploaded Provenance
cmdgui-0.4.0.tar.gz 107.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 224.4 kB

Release files / cmdgui-0.4.0.tar.gz

Download URL cmdgui-0.4.0.tar.gz
Size 107.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b1081a97393fa88142a4eed9289af9d20b78ce91525d9a69196c3a2b72d8ec10
BLAKE2b-256 checksum
How to use checksums
78c66c2af7169fc973895f302d944104b4215fe759d290a3d4130b2adcc76bd0
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 8, 2026.

Transparency log

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

Download URL cmdgui-0.4.0-py3-none-any.whl
Size 117.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48145a015d5a66967f4bfc8f7df33adf5f3250d6acb7053db65ecdc6263a84a3
BLAKE2b-256 checksum
How to use checksums
0ac30cda30c0e81e1fb025e58bfa01965f4d0024874465785d1ca8654a45974a
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 8, 2026.

Transparency log

Security for cmdgui 0.4.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.4.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 8, 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