Install

This page explains the way to install spear and create project.

Create Project

You need to install only npm, no additional global package like other CLI tools.
You just execute the following command.

# npm create spear@spear

After execute this command, create project wizard will start.

Wizard

Spear wizard will ask the several questions for building web site.

# npm create spear 
### Welcome to Spear CLI ###


? Name of your project
? Use Spearly CMS
? Enter your Spearly CMS API KEY
? Choose template type
? Generate Sitemap?
? Enter your hosting URL (Example: https://foobar.netlify.app/)
? Add ESLint for JavaScript code quality?

Spear Project Configuration

Spear will built based on spear.config.mjs like bellow:

export default {
  "projectName": "Sample Project",
  "generateSitemap": false,
  "siteURL": "https://sample.com",
  "spearlyAuthKey": "***********"
}

You can edit this configuration file, an allowed option parameter is

Setting parameter

Setting keySetting value typeDescriptionprojectNamestringProject Name. (This value used by title tag if title has {{ projectName }})spearlyAuthKeystringTeam's Spearly Authentication Key (Token)generateSitemapbooleanIf this option is true, spear will generate sitemap.xml.siteURLstringIf generateSitemap option is true, you need to specify own url.pluginsarrayYou can specify plugin. Spear provide three plugins. For detail, see Plugins.quietModebooleanIf this option is true, Spear doesn't any output.embedModebooleanIf this option is true, Spear will embed image resource into HTML.debugModebooleanIf this option is true, Spear will inject debug information into Element.generateComponentsbooleanIf this option is true, Spear will generate component's HTML.componentsFolderstringSpecify components foldersrcDirstringSpecify source directoryportnumberServer port number of dev mode.hoststringServer host name of dev mode.apiDomainstringYou can specify the api domain.crossOriginIsolationbooleanIf run spear in browswer with Web Containers, enable this option.