Open Assets
CLI

open-assets add

Add a collection, template or export size to assets.json from interactive presets, with the full preset lists, the files each creates and the duplicate checks.

add has three interactive subcommands. Each loads the config, asks questions, writes any new template file and saves the config with two-space indentation. Menus are numbered; an invalid number picks the first option.

add collection

open-assets add collection [options] [dir]
ArgumentDefaultDescription
dir.Project directory containing assets.json

Pick a preset or Custom. The preset creates one template file and a collection with tags, source size, border radius and export entries. Each new tag is also added to the root tags array (label is the capitalized id).

PresetidSourceTemplate fileExportsTags
App Store Screenshotsscreenshots440×956, radius 4src/screenshots/01-hero.htmliphone-6.9, iphone-6.7, iphone-6.5, ipad-13screenshots
App Iconicon1024×1024, radius 224src/icon.html1024, 180, 120, 512, 192, 32 (Favicon 32), 16 (Favicon 16)icon
Logologo800×800src/logo.svg800, 400, 200, copy-source svglogo, branding
Wordmarkwordmark1200×400src/wordmark.svg1200x400, 600x200, 300x100, copy-source svgwordmark, branding
Feature Graphic / Google Playfeature-graphic1024×500src/feature-graphic.html1024x500feature-graphic, android
OG Image / Socialog-image1200×630src/og-image.html1200x630 (OG Image), 1200x675 (Twitter Card)og-image, web

Custom asks for an id (empty aborts), label (default: capitalized id), source width and height (default 800), border radius (default 0) and format (HTML or SVG). It creates src/<id>.html or src/<id>.svg, one export entry named <w>x<h> at source size, plus copy-source svg for SVG. Tags are [id].

The generated template is a gradient placeholder showing the label and "Edit this template to get started", sized to the source size. An existing file at that path is overwritten.

FlagEnv varDefaultDescription
--config <path>OPEN_ASSETS_CONFIGassets.jsonPath to config file

Errors (exit 1): Collection "<id>" already exists in the config.

add template

open-assets add template [options] [dir]
ArgumentDefaultDescription
dir.Project directory containing assets.json
  1. Pick a collection.
  2. Template name, for example 02-features (empty aborts).
  3. Display label (default: the name).
  4. Format: HTML or SVG. The format of the collection's first template is listed first.

The file goes in the same folder as the collection's first template (or src/<id> if it has none), as <name>.html or <name>.svg, sized to the collection's sourceSize. The entry { src, name, label } is appended to templates.

FlagEnv varDefaultDescription
--config <path>OPEN_ASSETS_CONFIGassets.jsonPath to config file

Errors (exit 1): "No collections found. Run open-assets add collection first." and Template "<name>" already exists in collection "<id>".

add size

open-assets add size [options] [dir]
ArgumentDefaultDescription
dir.Project directory containing assets.json

Pick a collection, then a preset:

Menu entrynameSize
iPhone 6.9"iphone-6.91320×2868
iPhone 6.7"iphone-6.71290×2796
iPhone 6.5"iphone-6.51284×2778
iPhone 6.1"iphone-6.11179×2556
iPad 13"ipad-132064×2752
iPad 12.9"ipad-12.92048×2732
Google Play Phonephone1080×1920
Google Play 7" Tablettablet-71200×1920
Mac App Store Retinamac-retina2880×1800
OG Image1200x6301200×630
Twitter Card1200x6751200×675
Product Hunt Gallery1270x7601270×760
Custom dimensionsasks for name, label, width, height

Custom aborts if the name, width or height is empty. The entry is appended to export. It never adds outFile; edit the config for that.

FlagEnv varDefaultDescription
--config <path>OPEN_ASSETS_CONFIGassets.jsonPath to config file

Errors (exit 1): no collections (same message as add template), and Size "<name>" already exists in collection "<id>".

Examples

open-assets add collection
open-assets add template ./marketing
open-assets add size --config assets.staging.json

See /reference/manifest for every field these commands write.

Last updated on

On this page