CLI - cynchro/OldSchoolFrontFrame GitHub Wiki

CLI

OLS ships with a Node.js CLI for scaffolding new modules and starter projects.

Requirements: Node.js (only needed for the CLI, not for running the app)


Create a module

Generates a new module folder inside the example/ app:

node cli/ols.js create module <name>

Example:

node cli/ols.js create module clientes

Creates:

example/modules/clientes/
├── clientes.html
├── clientes.js
└── clientes.css

After generating, register the module in your app.js:

initApp({
  routes: {
    clientes: 'clientes', // ← add this
  },
});

Create a starter project

Generates a self-contained starter app in a new folder:

node cli/ols.js create starter <project-name>

Example:

node cli/ols.js create starter myapp

Creates:

myapp/
├── framework/          # OLS core (full copy)
├── modules/
│   └── home/
│       ├── home.html
│       ├── home.js
│       └── home.css
├── config/
│   └── app.yaml
├── index.html
└── app.js

The generated project is completely standalone. Copy it anywhere and serve it with any static HTTP server:

cd myapp
python3 -m http.server 8080

CLI help

node cli/ols.js --help
Usage:
  node cli/ols.js create module <name>     Create a module in example/
  node cli/ols.js create starter <name>    Create a standalone starter project
⚠️ **GitHub.com Fallback** ⚠️