Skip to content

Krishanth-K/stencil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 Stencil

PyPI version License: MIT Python Versions

Quick throwaway UIs for developers testing logic or wrapping scripts.

Write YAML → get a working UI in seconds. Terminal, desktop, or browser. No frontend knowledge required.

Stencil Example


Why Stencil?

You need a UI to test backend logic or wrap a script — not a production app, just something functional. Skip the boilerplate. Describe your UI once, generate it instantly.

Backends:

  • HTML — browser-based, shareable
  • curses — terminal UI, SSH-friendly
  • imgui — desktop GUI, immediate mode

Installation

pip install stencil-ui  # Python 3.12+

Usage

stencil init              # create stencil.yaml
stencil                   # generate HTML (default)
stencil -b curses         # terminal UI
stencil -b imgui          # desktop GUI
stencil --watch           # auto-regenerate on changes

Example Config

config:
  backend: "html"

app:
  - title: "Task Manager"
  - input:
      label: "Task"
      placeholder: "Buy groceries..."
  - button:
      label: "Add"
      callback: "addTask"
  - separator
  - text: "© 2025"

Components: title, text, input, button, separator


Extending

Add backends by dropping a folder in stencil/backends/<name>/:

mybackend/
  backend.yaml      # metadata
  _layout.j2        # wrapper template
  Button.j2         # component templates
  Input.j2
  Text.j2

No Python changes needed. Engine auto-discovers backends. See CONTRIBUTING.md for details.


License

MIT — use it however you want.

Contributing? Open an issue or PR. Easiest contribution: add a new backend for your favorite framework.

About

A lightweight CLI tool that generates UI files directly from a simple YAML or JSON configuration

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors