gitwtfhub

wtf is cosmo?

alerque/cosmo — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2026-02-05

Audience · developerComplexity · 2/5MaintainedSetup · moderate

TL;DR

Cosmo is a safe templating engine for Lua that lets you fill in placeholders in text templates without the security risks of templates that can run arbitrary code. Use it to generate dynamic text like HTML pages or emails where template authors shouldn't have full system access.

Mindmap

mindmap
  root((repo))
    What it does
      Safe text templating
      Fills placeholders
      No arbitrary code
    Use cases
      Dynamic HTML pages
      Config file generation
      Email and reports
    Audience
      Lua developers
      Web app builders
    Setup
      Install as Lua rock
      Needs C compiler
      UNIX-based systems
    Key features
      Nested templates
      Subtemplates support
      Lua 5.3 support

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Generate dynamic HTML pages in a Lua web app where users can customize their own templates safely.

REASON 2

Create configuration files from templates without giving template authors code execution rights.

REASON 3

Build a report or email generation system where non-technical users design templates without security risk.

REASON 4

Let users theme and customize pages in a web application without exposing your system to harmful code.

What's in the stack?

LuaCLuaRocks

How it stacks up

alerque/cosmo0verflowme/alarm-clock0xhassaan/nn-from-scratch
Stars0
LanguageCSSPython
Last pushed2026-02-052022-10-03
MaintenanceMaintainedDormant
Setup difficultymoderateeasymoderate
Complexity2/52/54/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires a C compiler toolchain on UNIX-based systems to build from source via LuaRocks.

Wtf does this do

Cosmo is a templating engine for the Lua programming language that lets you fill in placeholder values in text templates safely. The key benefit is that it provides much of the flexibility of full-powered template systems without the security risks that come from letting templates run arbitrary code. In many template systems, the template itself can contain programming logic, which means anyone who writes or edits a template could potentially run harmful code on your system. Cosmo avoids this by design. It supports nested templates, expressions, and subtemplates, but keeps the template language restricted so it cannot execute arbitrary commands. This makes it suitable for situations where templates might be user-generated or where you want to keep presentation logic safely separated from application logic. You would use Cosmo if you are building an application in Lua that needs to generate dynamic text, such as HTML pages, configuration files, emails, or reports, and you want to let people design or customize those templates without giving them the keys to your entire system. For example, if you are running a web application and want to allow users to theme their own pages, a safe template engine lets them control layout and content without risking a security hole. The project is installed as a Lua "rock," which is the standard package format for Lua libraries. It requires a C compiler toolchain on UNIX-based systems. The README does not go into detail on usage specifics or advanced configuration, it mainly notes that the current version adds support for Lua 5.3 and lists a few historical bug fixes and feature additions from prior releases.

Yoink these prompts

Prompt 1
Show me how to install Cosmo as a Lua rock and write a simple template with placeholders that I can fill in from my Lua code.
Prompt 2
Help me set up a Cosmo template for generating HTML pages in my Lua web app, where users can customize the template without running arbitrary code.
Prompt 3
Walk me through using nested templates and subtemplates in Cosmo to generate dynamic email content from user-provided templates.
Prompt 4
Create a safe template system using Cosmo where my users can design their own page layouts without risking security holes.

Frequently asked questions

wtf is cosmo?

Cosmo is a safe templating engine for Lua that lets you fill in placeholders in text templates without the security risks of templates that can run arbitrary code. Use it to generate dynamic text like HTML pages or emails where template authors shouldn't have full system access.

Is cosmo actively maintained?

Maintained — commit in last 6 months (last push 2026-02-05).

How hard is cosmo to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is cosmo for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.