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.2

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.2
File Size Uploaded Provenance
cmdgui-0.4.2.tar.gz 107.5 kB With provenance Details

Built distribution (wheel)

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

Total release size: 225.3 kB

Release files / cmdgui-0.4.2.tar.gz

Download URL cmdgui-0.4.2.tar.gz
Size 107.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b368bc9c2a02000ea4b6bb3dc96ce8a9e28c2850ebda84a86791e945df2717fd
BLAKE2b-256 checksum
How to use checksums
208147d31119224f308efbd3e1a0a0a78fc52f9b0fc23137ed1d9fd385b3ab5e
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 12, 2026.

Transparency log

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

Download URL cmdgui-0.4.2-py3-none-any.whl
Size 117.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cceba4255b0c5dc66ce4fffb25ff8e6b8945abe37baeaf9c9a015f5b022ae381
BLAKE2b-256 checksum
How to use checksums
1b7d15354ef67273d3d81933af97b4be467c6d275bf50fdc6c28df882a1e3ce4
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 12, 2026.

Transparency log

Security for cmdgui 0.4.2

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.2.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 12, 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