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]| Argument | Default | Description |
|---|---|---|
dir | . | Target directory |
init asks a few questions and writes a starter project into [dir].
Prompts
- Project name, defaulting to the folder name. The config
namebecomes<name> Assets. - Which assets do you need? Any of: App Store Screenshots, App Icon, Logo, Wordmark, Feature Graphic (Google Play). Selecting none aborts.
- 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.
- 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
| Path | Contents |
|---|---|
assets.json | version: 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 |
.gitignore | dist/, exports/, node_modules/ (overwrites an existing one) |
Collections per asset type (all templates are HTML):
| Asset | id | Source size | Template | Export sizes |
|---|---|---|---|---|
| Screenshots | screenshots | 440×956, radius 4 | src/screenshots/01-hero.html | iOS: 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 Icon | icon | 1024×1024, radius 224 | src/icon.html | iOS: 1024, 180, 120, 87, 80, 60, 40. Android: 512, 192, 144, 96, 72, 48. Web: 512, 192, 180, 32, 16 |
| Logo | logo | 800×800 | src/logo.html | 800, 400, 200, 64 |
| Wordmark | wordmark | 1200×400 | src/wordmark.html | 1200x400, 600x200, 300x100 |
| Feature Graphic | feature-graphic | 1024×500 | src/feature-graphic.html | 1024x500 |
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 ./marketingOptions
This command has no options.
Exit codes
| Code | When |
|---|---|
| 0 | Created, or you aborted |
| 1 | assets.json already exists in [dir] (Error: assets.json already exists in this directory.) |
Next: /quick-start.
Last updated on
open-assets validate
Check assets.json for missing fields, duplicate ids, missing template files and broken localizations, fix them interactively, and fail CI with exit code 1.
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.