Skip to Content
DocumentationCLIQuick Start

Quick Start

Start using Zare CLI to build Zare websites without setting up the backend server

Installation

Global Installation

npm i -g @zarejs/cli

DevDependency Installation

npm i --save-dev @zarejs/cli

About Zare CLI

@zarejs/cli is an official, open source command line interface for creating, building and serving the Zare template engine code without setting up a backend server.

Prerequisites

  1. Install Node.js on your machine, for more information visit https://nodejs.org/ 
  2. NPM or any package manager (e.g. yarn, pnpm) should be installed

Useful Commands

Creating A New Project

Using npx

npx zare init myapp

Using zare

If you have installed @zarejs/cli globally.

zare init myapp

Hit enter and it will create a new directory where required files and folders were setup

Adding Dependencies

npx zare add Button

This command will add Button component from ZareUI (IsmailBinMujeeb/zare/main). You can also add dependencies from other github projects.

I DON’T LIKE ZAREUI

npx zare add Button USERNAME/REPO/BRANCH [projectDir]

It will add Button as a dependency from specified github project. And last option is project path which is ”.” by default.

Start Serving

npx zare serve myapp

This start a local express server, myapp is should be a valid project directory path which contains pages folder and zare config file.

Build HTML

npx zare build myapp

This will build the static html files from your zare files.

Further Reading

Last updated on