Open Assets
CLI

open-assets init

Scaffold an Open Assets project interactively with an assets.json, starter HTML templates for screenshots, icons, logos and more, plus public and src folders.

open-assets init [options] [dir]
ArgumentDefaultDescription
dir.Target directory

init asks a few questions and writes a starter project into [dir].

Prompts

  1. Project name, defaulting to the folder name. The config name becomes <name> Assets.
  2. Which assets do you need? Any of: App Store Screenshots, App Icon, Logo, Wordmark, Feature Graphic (Google Play). Selecting none aborts.
  3. Which platforms are you targeting? Asked only if you picked screenshots or the icon: iOS / App Store, Android / Google Play, Web. Selecting none defaults to iOS.
  4. Proceed? Y/n.

In a terminal the lists are checkboxes (arrow keys, space to toggle, enter to confirm). When stdin is not a TTY, they become numbered lists and you type comma-separated numbers such as 1,2.

What it creates

PathContents
assets.jsonversion: 1, name, publicDir: "public", command: "npx open-assets render", tags (every collection tag, labelled with a capitalized id), collections
src/Templates for the chosen assets
public/, dist/Empty folders
.gitignoredist/, exports/, node_modules/ (overwrites an existing one)

Collections per asset type (all templates are HTML):

AssetidSource sizeTemplateExport sizes
Screenshotsscreenshots440×956, radius 4src/screenshots/01-hero.htmliOS: iphone-6.9, iphone-6.7, iphone-6.5, ipad-13. Android: phone 1080×1920, tablet-7 1200×1920, tablet-10 1600×2560. Also customExport 1320×2868
App Iconicon1024×1024, radius 224src/icon.htmliOS: 1024, 180, 120, 87, 80, 60, 40. Android: 512, 192, 144, 96, 72, 48. Web: 512, 192, 180, 32, 16
Logologo800×800src/logo.html800, 400, 200, 64
Wordmarkwordmark1200×400src/wordmark.html1200x400, 600x200, 300x100
Feature Graphicfeature-graphic1024×500src/feature-graphic.html1024x500

Screenshot and icon collections are tagged with their id plus each chosen platform (ios, android, web).

Choosing both Android and Web for the icon adds two sizes named 512 and two named 192. --size 512 then matches only the first, and both write to exports/icon/512.png. Rename one after init.

Examples

open-assets init
open-assets init ./marketing

Options

This command has no options.

Exit codes

CodeWhen
0Created, or you aborted
1assets.json already exists in [dir] (Error: assets.json already exists in this directory.)

Next: /quick-start.

Last updated on

On this page