No description
  • Go 65.7%
  • Python 28.1%
  • Go Template 4.2%
  • D2 1.4%
  • JavaScript 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
hum3 b7027d252f
Some checks are pending
CI / test-python (macos-latest, 3.10) (push) Waiting to run
CI / test-python (macos-latest, 3.11) (push) Waiting to run
CI / test-python (macos-latest, 3.12) (push) Waiting to run
CI / test-python (macos-latest, 3.9) (push) Waiting to run
CI / test-python (ubuntu-latest, 3.10) (push) Waiting to run
CI / test-python (ubuntu-latest, 3.11) (push) Waiting to run
CI / test-python (ubuntu-latest, 3.12) (push) Waiting to run
CI / test-python (ubuntu-latest, 3.9) (push) Waiting to run
CI / test-python (windows-latest, 3.10) (push) Waiting to run
CI / test-python (windows-latest, 3.11) (push) Waiting to run
CI / test-python (windows-latest, 3.12) (push) Waiting to run
CI / test-python (windows-latest, 3.9) (push) Waiting to run
CI / lint (push) Waiting to run
CI / test-go (push) Waiting to run
CI / security (push) Waiting to run
CI / check-licenses (push) Waiting to run
CI / build (push) Blocked by required conditions
Migrate forge references from codeberg.org to git.bytestone.uk
Module path and self-referencing URLs now point at the new Forgejo
instance following the move off Codeberg.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-08 16:54:55 +02:00
.claude adding seaweedfs app update 2026-03-06 15:05:16 +00:00
.github/workflows Add go-licenses check for license compliance 2025-10-30 10:26:04 +00:00
cmd Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
docs Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
examples Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
lofigui add docs index 2026-03-12 18:00:03 +00:00
tests Decouple Python App from FastAPI, add docs index 2026-03-12 17:55:09 +00:00
wasmassets Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
widgets/watertank widgets/watertank: shared schematic; rework geometry; capture infra; incremental docs 2026-05-03 12:16:09 +01:00
.gitignore examples: gitignore + remove tracked example binaries 2026-05-03 12:27:07 +01:00
.go-licenses-allowed.txt Add go-licenses check for license compliance 2025-10-30 10:26:04 +00:00
app.go Bulma: serve locally with CDN fallback; register ServeBulma in hand-rolled examples 2026-05-01 15:24:25 +01:00
app_test.go Split example 01 into compact/explicit/gzip variants + wasm-deploy CLI 2026-04-18 13:17:06 +02:00
app_wasm.go Bulma: serve locally with CDN fallback; register ServeBulma in hand-rolled examples 2026-05-01 15:24:25 +01:00
bulma.go Vendor Bulma locally and clean up example 03 docs 2026-04-21 07:34:12 +01:00
bulma.min.css Vendor Bulma locally and clean up example 03 docs 2026-04-21 07:34:12 +01:00
CHANGELOG.md Update CHANGELOG for v0.17.39 2026-05-03 14:26:12 +01:00
CLAUDE.md Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
CODE_OF_CONDUCT.md Adding in Claudes tidy up 2025-10-21 19:41:58 +01:00
CONTRIBUTING.md Converting to uv 2025-10-21 19:48:58 +01:00
controller.go Sweep pongo2 references from docs and code comments 2026-05-01 11:24:29 +01:00
controller_states.d2 Centralize controller functions in Go to match Python architecture 2025-10-28 23:04:51 +00:00
controller_test.go Replace pongo2 with Go stdlib html/template 2026-04-13 17:08:29 +01:00
examples_test.go Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
favicon.go Reorganising examples 2025-10-22 12:34:44 +01:00
favicon_test.go v0.5.0 extended controller 2025-10-23 10:56:04 +01:00
go.mod Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
go.sum Add App.RunWASM() for service worker WASM and switch example 01 to use it 2026-04-14 13:47:13 +01:00
GO_CONTROLLER_GUIDE.md Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
layouts.go Bulma: serve locally with CDN fallback; register ServeBulma in hand-rolled examples 2026-05-01 15:24:25 +01:00
layouts_test.go layouts: serve Bulma locally, drop dead {{.refresh}} block 2026-05-01 15:13:42 +01:00
LICENSE Comprehensive project improvements: security, testing, and documentation 2025-10-21 17:01:40 +00:00
lofigui.code-workspace Adding index 2026-03-12 17:33:02 +00:00
lofigui.go Simplify example 01 with Handle, lazy controller, auto-flush and graceful shutdown 2026-03-29 14:30:13 +01:00
pyproject.toml Update pyproject.toml version to 0.17.39 2026-05-03 14:25:24 +01:00
README.md Migrate forge references from codeberg.org to git.bytestone.uk 2026-08-08 16:54:55 +02:00
RESEARCH.md Doc cleanup: rewrite controller guide, drop stale bugs research, fix refresh-mechanism docs 2026-05-01 11:39:42 +01:00
ROADMAP.md Add WASM service worker research and example 09 PoC 2026-04-10 06:29:01 +01:00
serve.go Updating example 01 2026-04-02 22:04:07 +01:00
task-plus.yml Simplify WASM examples to use RunWASM and unify demo templates 2026-04-05 20:27:59 +01:00
Taskfile.yml widgets/watertank: shared schematic; rework geometry; capture infra; incremental docs 2026-05-03 12:16:09 +01:00
uv.lock Update README.md for v0.17.39 2026-05-03 14:25:49 +01:00
wasm.go Updating example 01 2026-04-02 22:04:07 +01:00
yield.go Simplify example 01 with Handle, lazy controller, auto-flush and graceful shutdown 2026-03-29 14:30:13 +01:00
yield_test.go Add lofigui.Yield() for WASM-friendly cooperative scheduling (issue #4) 2026-03-26 01:07:15 +00:00
yield_wasm.go Simplify example 01 with Handle, lazy controller, auto-flush and graceful shutdown 2026-03-29 14:30:13 +01:00

lofigui

Latest: v0.17.39

Lofi GUI - A minimalist Go library for creating really simple web-based GUIs for CLI tools and small projects. It provides a print-like interface for building lightweight web UIs with minimal complexity.

The application is where you have a single real object (e.g. machine or long-running process) which then has a number of pages around it to show various aspects of it.

In the spirit of Niklaus Wirth — computer systems should be simpler and more readable. Every dependency, every JavaScript byte, every layer of indirection has to justify itself against the alternative of just printing HTML. See Philosophy for the longer argument.

Go Version License: MIT

Overview

lofigui provides a print-like interface for building lightweight web applications with minimal complexity. Perfect for:

  • Creating quick GUIs for command-line tools
  • Internal tools for small teams (1-10 users)
  • Single-process or single-object front-ends
  • Rapid prototyping without JavaScript overhead

Key Features

  • Simple API: Print-like interface (Print(), Markdown(), HTML(), Table())
  • No JavaScript: Pure HTML/CSS using the Bulma framework
  • Single binary: Deploy as one executable, no dependencies
  • WebAssembly: Same code runs in the browser via WASM
  • Responsive layouts: Bulma-based templates with optional base.html inheritance — see example 03 (Style Sampler) for the catalogue

Quick Start

package main

import (
    "net/http"
    "git.bytestone.uk/hum3/lofigui"
)

func model(app *lofigui.App) {
    lofigui.Print("Hello world")
    app.EndAction()
}

func main() {
    ctrl, _ := lofigui.NewControllerWithLayout(lofigui.LayoutNavbar, "My App")
    app := lofigui.NewApp()
    app.SetController(ctrl)
    app.SetDisplayURL("/display")

    http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
        app.HandleRoot(w, r, model, true)
    })
    http.HandleFunc("/display", func(w http.ResponseWriter, r *http.Request) {
        app.HandleDisplay(w, r)
    })
    http.HandleFunc("/favicon.ico", lofigui.ServeFavicon)
    http.ListenAndServe(":8080", nil)
}

Element

Your project is essentially a web site. To make design simple you completely refresh pages so no code for partial refreshes. To make things dynamic it has to be asynchronous, using goroutines for background processing.

Like a normal terminal program you essentially just print things to a screen but now have the ability to print enriched objects.

Model View Controller architecture

All I really want to do is to write the model. The controller and view (in the browser and templating system) are a necessary evil. The controller includes the routing and web server. The controller is split between the app (single instance) and a model-specific controller. The view is the HTML templating (html/template in Go, Jinja2 in Python) and the browser.

Buffer

In order to decouple the display from the output and be able to refresh, you need to buffer the output. It is more efficient to buffer the output in the browser but more complicated. Moving the buffer to the server simplifies the software but requires you to refresh the whole page. lofigui relies on hyperlinks to perform updates. HTMX plays nicely here for improving interactivity (examples 09-10).

Installation

go get git.bytestone.uk/hum3/lofigui

Examples & Documentation

See the documentation site for interactive examples (including WASM demos), research notes, and the roadmap.

To run examples locally, use Task:

task --list              # Show all available tasks
task go-example:09       # Run any Go example by number

Python

A Python implementation also exists with the same API using FastAPI and Jinja2. See Python Notes for installation, API reference, and development instructions.

Roadmap

See ROADMAP.md for planned features and future direction.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE file for details.

Author

Humphrey Drummond - hum3@drummond.info

Documentation https://h3-lofigui.statichost.page/
PyPI https://pypi.org/project/lofigui/
Source (Codeberg) https://git.bytestone.uk/hum3/lofigui
Mirror (GitHub) https://github.com/drummonds/lofigui