Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 2.62 KB

CLI.md

File metadata and controls

94 lines (68 loc) · 2.62 KB

fragmentDocumentationAPI → CLI


CLI

Once fragment is properly installed, you can launch it and create sketches from the command line.

Usage

Create

Create a new sketch.

fragment create [filename]

Options

Flag Shortcut Description Default
--template -t Prepopulate template choice 2d

Example

fragment create sketch.js

Run

Run an existing sketch.

fragment run [filename]

The command run can be omitted since it's the default command

fragment [filename]

Options

Flag Shortcut Description Default
--port -p Specify the server port. 3000
--exportDir none Override directory used for exports undefined
--new -n Redirect to create prompts false
--template -t Pre-populate template choice in create prompts 2d
--build -b Redirect to build prompts false
--outDir none Pre-populate outDir in build prompts [/[sketch-name]
--emptyOutDir none Pre-populate emptyOutDir in build prompts false
--base none Pre-populate base path in build prompts undefined
--development none Run Fragment in development mode false
--prompts none Enable interactive prompts in build prompts true

Build

Build a sketch into static files for production.

fragment build [filename]

Options

Flag Shortcut Description Default
--outDir none Pre-populate out directory [/[sketch-name]
--emptyOutDir none Empty outDir before static build false
--base none Base public path when served in production undefined
--development none Run Fragment in development mode false
--prompts none Enable interactive prompts true

Preview

Start a local server to preview a sketch built locally with fragment build.

fragment preview [directory]

Templates

fragment currently has the following templates: