Skip to content

Repository files navigation

STemplate

STemplate is a Winux project in the actual sense: it was created by the Winux Foundation community. It is a local-first workspace and template manager that combines a Python CLI and daemon, a supervised WebUI, and a Rust workspace for filesystem-heavy operations.

The project is designed around one local control plane instead of ad hoc scripts. The daemon owns service lifecycle, the CLI stays short-lived, the browser surface stays local, and generated projects get a canonical .stemplate/project.toml describing what was materialized.

What it does

  • Manages a local daemon over a Unix domain socket.
  • Supervises singleton GUI and Web surfaces per runtime scope.
  • Stores templates in a local library and edits them through the WebUI.
  • Validates, plans, and generates projects from template manifests.
  • Keeps Rust available for filesystem and throughput-sensitive subsystems without moving orchestration policy out of Python.

Stack

  • Python: canonical CLI, daemon, template loader, generator, GUI control surface.
  • Node.js: local Web control plane under web/control-plane/server.mjs.
  • Rust: workspace crate under rust/crates/stemplate-fs for filesystem-focused work.
  • systemd user service: optional always-on daemon and Web startup flow.

Winux identity

Winux here refers to community origin and authorship, not a platform target. This project is part of the Winux Foundation body of work.

Platform target

This repo is built for Linux rather than pretending to be a generic cross-platform app:

  • Runtime control uses Unix domain sockets.
  • Process supervision assumes a local Linux user session.
  • The included service unit targets systemd --user.
  • State and runtime paths follow XDG_STATE_HOME and XDG_RUNTIME_DIR.

If you want the exact process model and boundaries, read Architecture.md.

Repository layout

.
├── stemplate/              # Python CLI, daemon, template, generator, GUI code
├── rust/crates/stemplate-fs/
├── web/
│   ├── app/                # Static browser app
│   └── control-plane/      # Node.js local server
├── scripts/                # Install/update/bootstrap helpers
├── systemd/user/           # User service template
├── tests/
├── pyproject.toml
└── Cargo.toml

Prerequisites

  • Python 3.13+
  • uv
  • Node.js
  • Linux
  • systemd --user if you want the included user service flow

Quick start

Create the Python environment and sync dependencies:

uv python install 3.13
uv sync --python 3.13

Run the CLI directly from the repo:

.venv/bin/python -m stemplate.main status
.venv/bin/python -m stemplate.main serve Web

Install user-level wrapper commands:

./scripts/install-system-command.sh

That installs:

  • stemplate
  • stemplate-webui
  • stemplate-update

Enable the user service and auto-start the daemon plus Web control plane:

./scripts/install-systemd-user.sh

CLI examples

Service management:

stemplate status
stemplate serve Web
stemplate serve GUI
stemplate restart Web
stemplate stop all
stemplate logs Web --lines 200
stemplate policy set Web on-failure --max-restarts 3

Template workflow:

stemplate template validate /path/to/template
stemplate template plan /path/to/template /path/to/output
stemplate template generate /path/to/template /path/to/output --set project.name=demo

Template library behavior

The local template library lives under the state directory by default:

  • default state root: ~/.local/state/stemplate
  • default template library: ~/.local/state/stemplate/templates
  • runtime socket and PID: XDG_RUNTIME_DIR/stemplate when available

Useful overrides:

  • STEMPLATE_STATE_HOME
  • STEMPLATE_RUNTIME_HOME
  • STEMPLATE_TEMPLATE_HOME
  • STEMPLATE_PYTHON_VERSION
  • STEMPLATE_NODE_BIN

Web control plane

The Web control plane is a local Node.js server that fronts the daemon for browser access. The browser app currently covers:

  • daemon and managed service status
  • service start, stop, restart, and restart policy controls
  • template library browsing
  • manifest editing
  • defaults editing
  • template file editing
  • validation, planning, and generation
  • daemon log viewing

Development

Python tests:

.venv/bin/python -m pytest

Rust workspace checks:

cargo check

Web control plane entrypoint:

node web/control-plane/server.mjs

Status

STemplate is an active Winux project, not a polished general-purpose product. The architecture is already opinionated: local-first, daemon-supervised, Unix-native, and split cleanly between Python orchestration, Node.js browser access, and Rust for heavier backend work.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages