Skip to Content

CLI

The Fubam CLI provides a simple command-line interface for managing projects, building templates, and running development environments.

It is designed to keep workflows minimal, fast, and fully aligned with Fubam’s lightweight philosophy.

The CLI helps automate common tasks such as project initialization, rendering templates, and exporting optimized output.


1. Installation

If Fubam is installed via pip, the CLI becomes available automatically:

pip install fubam

Verify installation:

fubam --version

If installed correctly, the current version will be displayed.


2. Initialize a Project

Create a new Fubam project:

fubam init my-project

This generates a recommended project structure:

my-project/ ├── Templates/ │ ├── layouts/ │ ├── components/ │ └── pages/ ├── static/ └── fubam.config.py
  • Templates/ contains .pmx files
  • static/ stores assets (CSS, JS, images)
  • fubam.config.py holds project configuration

3. Run Development Server

Start the development environment:

fubam serve
  • Launches a local development server
  • Automatically renders templates
  • Enables rapid prototyping
  • Designed for small-scale development and testing

By default, the server runs at:

http://localhost:8000

4. Build / Export Project

To generate optimized static output:

fubam build

This will:

  • Render all templates
  • Apply optimization steps
  • Inject SEO enhancements
  • Minify assets (if enabled)
  • Export final HTML files

The output is typically generated in:

dist/

5. Configuration Options

You can customize CLI behavior inside fubam.config.py.

Example configuration:

DEBUG = True MINIFY = True INLINE_ASSETS = False OUTPUT_DIR = "dist"

Configuration allows control over:

  • Debug mode
  • Optimization pipeline
  • Asset handling
  • Export directory

6. Common Commands

fubam init <project-name> # Create new project fubam serve # Start development server fubam build # Export optimized output fubam --version # Show current version fubam help # Display available commands

7. Best Practices

  • Use serve during development
  • Use build for production export
  • Keep configuration minimal
  • Organize templates clearly before building
  • Enable optimization flags for production

Summary

  • The Fubam CLI simplifies project management
  • Supports initialization, development, and export
  • Aligns with Fubam’s lightweight philosophy
  • Automates rendering and optimization workflows
Last updated on