lesstruct

command module
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Lesstruct

Lesstruct

Everything is a module. The Go CMS you can shrink, extend, and ship as one binary — for humans and AI agents.

Go Version Latest Release CI Docs

The Lesstruct admin panel
Admin panel
The rendered content site
Content site
The admin dashboard
Dashboard

Why Lesstruct?

  • One binary, no Docker. A single static Go binary runs the whole CMS. SQLite is built in. No runtime, no container, no node_modules in production.
  • Everything is a module. Eighteen built-in modules with a declared dependency graph — disable what you don't need with [modules] disabled and dependents cascade. Per-module reference: docs/built-in-modules.md.
  • Multi-database, your choice. SQLite by default; PostgreSQL and MySQL supported via DB_DRIVER. Migrations run on first start.
  • Custom fields, no plugins needed. Define post types, user profile fields, and validation rules in config.toml. The admin form, storage, and queries all read from that file.
  • Extend with WebAssembly plugins. Drop a compiled .wasm into plugins/ and it hooks into before_save, after_create, and after_publish. Plugins are sandboxed, immutable, and can call host functions for HTTP, DB, and logging.
  • AI integrations are opt-in. Bring your own OpenAI-compatible key for text, a Meta or OpenAI-compatible key for speech-to-text dictation, or a Google / OpenAI / Meta key for image generation. The admin panel surfaces them as buttons; nothing else changes.
  • Built for humans AND AI agents. A versioned REST API at /api/v1, a lesstruct-cli client, Markdown as a first-class ingest format, and installable agent skills (npx skills add aristorinjuang/lesstruct).

Quick start

go install github.com/aristorinjuang/lesstruct@latest
export JWT_SECRET="$(head -c 48 /dev/urandom | base64)"
lesstruct

Open http://localhost:8080/admin, sign in as admin / admin and set a new password on first login, then start publishing. (Self-registration creates pending accounts an admin approves — it does not create the first admin.) The full configuration split between config.toml (content schema) and .env (deployment) is in docs/configuration.md.

Installation

Grab the latest build for your platform from the releases page. Each release ships static binaries for linux, darwin, and windows on amd64 and arm64 — the default (blog) edition as lesstruct-<os>-<arch>, the Core edition (headless engine) as lesstruct-core-<os>-<arch>, the eCommerce edition as lesstruct-ecommerce-<os>-<arch>, and the CLI as lesstruct-cli-<os>-<arch>.

OS amd64 arm64
Linux lesstruct-linux-amd64 lesstruct-linux-arm64
macOS lesstruct-darwin-amd64 lesstruct-darwin-arm64
Windows lesstruct-windows-amd64.exe lesstruct-windows-arm64.exe
# Linux / macOS — verify, then install
curl -sSL https://github.com/aristorinjuang/lesstruct/releases/latest/download/lesstruct-linux-amd64 -o lesstruct
chmod +x lesstruct
sudo mv lesstruct /usr/local/bin/
lesstruct
Option B — go install
# The default (blog) edition — every module
go install github.com/aristorinjuang/lesstruct@latest

# The Core edition — the headless engine
go install github.com/aristorinjuang/lesstruct/cmd/lesstruct-core@latest

go install needs v1.1.1 or later — earlier tags predate the publishable module layout (see module development). For an older version, use a release binary or build from source.

Option C — Build from source
git clone https://github.com/aristorinjuang/lesstruct.git
cd lesstruct
make install   # builds the admin panel (npm), the server, and the CLI into $GOBIN

Two builds of one product: go install / make install ships Lesstruct with every module and every database driver — the blog edition, the default. go install github.com/aristorinjuang/lesstruct/cmd/lesstruct-core@latest (or make build-core) builds the Core edition: the headless engine — identity, content, media, plugins; no comment system, no SSR theme engine, no AI text generation, no importers — for sites that render their own frontend against /api/v1. go install github.com/aristorinjuang/lesstruct/cmd/lesstruct-ecommerce@latest (or make build-ecommerce) builds the eCommerce edition: the blog platform plus the commerce stack (catalog pricing and stock, guest carts, and orders with checkout), served by the embedded storefront theme — product pages, cart, checkout, and order tracking. Editions share the same config.toml and data directory; moving between them is installing the other binary. make build-server builds the default edition without the embedded SQLite driver (about 6 MB leaner, for PostgreSQL/MySQL deployments). make build-cli builds the Lesstruct CLI — the companion tool for AI agents.

Option D — Docker (optional)

The headline is "no Docker required," but Lesstruct runs fine in a container if you prefer one. The official image is not published yet — build your own from the Dockerfile-shaped workflow in .github/workflows/release.yml and the static binary it produces. The binary inside the container is CGO_ENABLED=0, so a FROM scratch or FROM gcr.io/distroless/static works.

Configuration

Two layers, two responsibilities:

  • config.toml — your site's content schema: languages, custom post types, user profile fields, thumbnail variants, and the [modules] block that turns built-in features off. Hand-edited, version-controlled.
  • .env — your deployment configuration: host, port, database, secrets, SMTP, AI keys. Treated as deployment state, not committed.

The only required value is JWT_SECRET (≥ 32 characters). Everything else has a sensible default. See docs/configuration.md for the full reference, validation rules, and troubleshooting recipes.

AI Agent Skills

Lesstruct ships three skills that turn your AI agent into a Lesstruct expert. Theme and plugin skills work from your installed site (themes/ and plugins/ directories); the module skill works from a cloned source checkout (modules/ and internal/editions/) — no access to the source tree is required for themes/plugins, while modules build against it.

# Install all skills — the CLI auto-detects your agent(s) and their skill paths
npx skills add aristorinjuang/lesstruct

# Or install just one
npx skills add aristorinjuang/lesstruct --skill lesstruct-theme-development
npx skills add aristorinjuang/lesstruct --skill lesstruct-plugin-development
npx skills add aristorinjuang/lesstruct --skill lesstruct-module-development

This works with 30+ agents — Claude Code, OpenCode, Cursor, Codex, Gemini CLI, GitHub Copilot, Cline, Roo Code, Windsurf, and more. The CLI detects which are installed and installs to the right path for each; pass -g for a global (user-wide) install, or -a <agent> to target a specific one. See each skill's references/install-paths.md for manual cp -r fallbacks and the full agent list.

Once installed, ask your agent things like:

  • "Help me build a dark theme for my Lesstruct site."
  • "Help me write a WASM plugin that enriches content from an external API."
  • "Help me write a Lesstruct Go module for guest wishlists in my checkout."

Pair them with the recommended Meta AI models below to power the CMS features your agents build on.

Unlock the full potential of Lesstruct with Meta AI

Lesstruct's AI features are opt-in and bring-your-own-key — set the keys in .env (see Configuration). Any OpenAI-compatible endpoint works, but these are the Meta models Lesstruct recommends:

Model Features
Muse Wonder Extend Lesstruct further with the Lesstruct Module Development skill — optimized for Muse Code and Muse Wonder.
Muse Spark Enhance your writing and translate content into any language you've defined in config.toml.
Muse Voice Transcribe Speech-to-content: record your voice in the editor and Lesstruct turns it into publish-ready content — transcribed by Muse Voice Transcribe, then enhanced and formatted by Muse Spark.
Muse Image Generate any image you want, including exact 1200×630 Open Graph previews — guided by up to three reference images.
Muse SAM Keeps the platform safe by blurring faces, license plates, and nudity in images users upload, before anything is stored.

Plugin Development

Plugins are sandboxed WebAssembly modules with a WordPress-familiar hook model — explicit registration, priority-based execution, immutable data flow. The currently-invoked hooks are before_save (create, update, and admin system-fields updates), after_create, after_publish, before_delete, and after_unpublish; the reserved-but-unused hook (on_plugin_loaded) is documented for forward compatibility.

Module Development

Every first-party feature — users, auth, media, comments, SEO, and more — is an independent Go module compiled against the kernel, a small frozen contract module (kernel/v1.0.0). Third parties build on the same surface: write a module, drop it into modules/<name>/, register it in the composition root, and build your own binary — no runtime installation, no recompile of anyone else's code. (Prefer runtime extension without recompiling? That's exactly what WASM plugins are for.)

Theme Development

Themes are a themes/<name>/ directory containing CSS, optional JS, and optional HTML template overrides — pointed at with THEME_DIR=themes/<name>. The embedded theme serves as a working starting point — the default blog theme, or the storefront theme in the eCommerce edition — and the contract (CSS variables, layout/body blocks, standalone commerce pages, JS DOM ids, CDN assets) is documented so a fork-and-modify workflow is safe.

API & CLI

A versioned, API-key-authenticated REST API at /api/v1 covers Content and Media. Markdown is accepted on create/update and converted to canonical Tiptap JSON server-side.

lesstruct-cli is a thin Cobra client over the same API — designed for AI agents and humans who live in the terminal. Install it with Go:

go install github.com/aristorinjuang/lesstruct/cmd/lesstruct-cli@latest

Point it at a running server and create an API key from the admin panel to get started.

Support this project

Lesstruct is a spare-time project. I — Ari — design, build, test, and document it in the hours outside my day job. If it saves you time, the most helpful thing you can do is sponsor the work on GitHub Sponsors. Sponsorship funds the small stuff that compounds: CI minutes, a real domain for documentation, and the occasional dedicated weekend for plugin/theme polish.

And if you want to rep the brand, official merch is at merch.lesstruct.dev.

Starring the repo, opening well-scoped issues, and sending PRs with a failing test are all just as valuable — and they cost nothing.

License

MIT. See the LICENSE file for the full text.

Documentation

Overview

Command lesstruct is the default (blog) edition: every first-party module, every database driver. Server-only deployments build this same package with `-tags nosqlite` (make build-server) — postgres/mysql, no sqlite. The headless engine edition lives at ./cmd/lesstruct-core.

Directories

Path Synopsis
cmd
lesstruct-cli command
Command lesstruct-cli authors and manages Lesstruct content and media over the versioned /api/v1 REST API.
Command lesstruct-cli authors and manages Lesstruct content and media over the versioned /api/v1 REST API.
lesstruct-cli/cmd
Package cmd holds the cobra command tree for the lesstruct-cli binary.
Package cmd holds the cobra command tree for the lesstruct-cli binary.
lesstruct-core command
Command lesstruct-core is the Core edition: the headless engine.
Command lesstruct-core is the Core edition: the headless engine.
lesstruct-ecommerce command
Command lesstruct-ecommerce is the eCommerce edition: the blog module list plus the commerce stack (catalog products with native pricing, variant matrices, stock, and SKUs; token-keyed carts; first-class orders with checkout and the admin lifecycle surface).
Command lesstruct-ecommerce is the eCommerce edition: the blog module list plus the commerce stack (catalog products with native pricing, variant matrices, stock, and SKUs; token-keyed carts; first-class orders with checkout and the admin lifecycle surface).
internal
app
Package app is the Lesstruct composition root: the shared platform — config, database, identity, content engine, media stack, plugin system, boot — that every edition wires its module list into.
Package app is the Lesstruct composition root: the shared platform — config, database, identity, content engine, media stack, plugin system, boot — that every edition wires its module list into.
editions/blog
Adapters between the platform services and the blog edition's modules: comments, SEO, the SSR engine, and the WordPress importer.
Adapters between the platform services and the blog edition's modules: comments, SEO, the SSR engine, and the WordPress importer.
editions/commerce
Package commerce is the eCommerce edition: the blog module list plus the catalog module — native pricing, variant matrices, stock, and SKUs keyed to a configured product post type — and the official storefront theme in place of the blog theme.
Package commerce is the eCommerce edition: the blog module list plus the catalog module — native pricing, variant matrices, stock, and SKUs keyed to a configured product post type — and the official storefront theme in place of the blog theme.
editions/core
Package core is the Lesstruct Core edition: the headless engine.
Package core is the Lesstruct Core edition: the headless engine.
email
Catalog stock notifications: the commerce sends the platform offers out of the box.
Catalog stock notifications: the commerce sends the platform offers out of the box.
identity
Package identity bridges kernel.Principal to the v0 int-ID, single-role model during the Phase 2 transition.
Package identity bridges kernel.Principal to the v0 int-ID, single-role model during the Phase 2 transition.
modules
Package modules hosts the core-side adapters between the composition root and the real v1 modules under modules/: repository-to-seam bridges whose only layer may import both sides (user policy, auth notifications, soft delete, profile pictures), plus the logger adapter.
Package modules hosts the core-side adapters between the composition root and the real v1 modules under modules/: repository-to-seam bridges whose only layer may import both sides (user policy, auth notifications, soft delete, profile pictures), plus the logger adapter.
kernel module
modules
adminpanel module
auth module
cart module
catalog module
comments module
importers module
media module
modgen module
orders module
payments module
plugingen module
privacy module
seo module
site-ssr module
speech module
textgen module
theme-default module
themegen module
users module
pkg
sdk
Package sdk provides constants and documentation for developing WASM plugins for Lesstruct.
Package sdk provides constants and documentation for developing WASM plugins for Lesstruct.
skills
tools
stylecheck
Package stylecheck enforces the Lesstruct Go file-layout contract: methods stay with the struct that owns them, constructors close their type, and package-level helpers precede public declarations.
Package stylecheck enforces the Lesstruct Go file-layout contract: methods stay with the struct that owns them, constructors close their type, and package-level helpers precede public declarations.
stylecheck/cmd/stylecheck command
Command stylecheck enforces the Lesstruct Go file-layout contract.
Command stylecheck enforces the Lesstruct Go file-layout contract.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL