Framework7 Command-Line Interface (CLI)

Framework7 CLI is an extremely powerful tool and the most recommended way to start Framework7 app development.

It allows to create project using different variants to choose:

  • Framework: Framework7 Core, Framework7-Vue, Framework7-React
  • Target platform: Web app, PWA or Cordova app
  • Starter template: Single View, Tabs, Split View
  • Custom color theme
  • Generate required icons and splash screen

Installation

First of all make sure you have globally installed Cordova (may require "sudo"):

$ npm install -g cordova

Then install Framework7 CLI (may require "sudo"):

$ npm install -g framework7-cli

Create App

To create Framework7 app, run the following command in the directory where you want to create app:

$ framework7 create

Program will prompt for few questions about framework and template you want to start with.

Create App User Interface

Run the following command in the directory where you want to create app:

$ framework7 create --ui

It will launch UI where you will be able to configure the project. By default it launches server on localhost:3001 address. If you want to change the port then use --port <n> argument:

$ framework7 create --ui --port 8080

Generate Assets

In created project there is an assets-src directory. It contains required icons and splash screens source images. To generate your own icons and splash screen images, you will need to replace all assets in this directory with your own images (pay attention to image size and format), and run the following command in the project directory:

$ framework7 generate-assets

That is all, script will generate all required sizes of icons and splash screens and place them automatically where they need to be.

Generate Assets User Interface

Run the following command in the directory with Framework7 project:

$ framework7 generate-assets --ui

It will launch UI where you will be able to change icons and splash screens. By default it launches server on localhost:3001 address. If you want to change the port then use --port <n> argument:

$ framework7 generate-assets --ui --port 8080

Cordova APIs

To run cordova related commands run the following command in the project root directory:

$ framework7 cordova [..args]

For example:

$ framework7 cordova plugin add cordova-plugin-statusbar
$ framework7 cordova plugin add cordova-plugin-splashscreen
$ framework7 cordova build ios
...