Skip to main content

sos applet generate

Generate new signageOS applet projects with boilerplate code

Description

Creates a new applet project with all necessary configuration files, dependencies, and boilerplate code. Supports both TypeScript and JavaScript, multiple bundlers (webpack/rspack), various package managers (npm/pnpm/yarn/bun), and includes git repository initialization.

Usage

sos applet generate [options]

Options

OptionTypeDescriptionDefault
--namestringApplet name. Match RegExp: /^\w(\w\d
--applet-versionstringApplet initial version. Use semantic version0.0.0
--target-dirstringDirectory where will be the applet generated to
--gitstringInit applet as git repository "no" (default) or "yes"
--packagerstringUse preferred package manager "npm" (default), "pnpm", "yarn" or "bun"
--npm-registrystringNPM registry URL. If you have your private npm registry
--languagestringGenerate applet with "typescript" or "javascript" source code
--bundlerstringGenerate applet with "webpack" (default) or "rspack"

Examples

# Interactive generation with prompts
sos applet generate

# Generate TypeScript applet with webpack
sos applet generate --name my-applet --language typescript --bundler webpack

# Generate with custom settings
sos applet generate --name my-app --target-dir ./projects --git yes --packager pnpm

# Generate with npm registry
sos applet generate --name my-applet --npm-registry https://registry.npmjs.org/ --packager npm

# Generate applet with specific configuration
sos applet generate --name my-applet --applet-version 1.0.0 --target-dir ./output --language typescript --bundler webpack --git yes

Advanced Usage

Platform Notes

Windows Users

There is an unresolved issue with NPX tool on Windows when your username contains spaces (e.g., John Doe). To prevent this issue, run the following command in your Command Line (replace John with your real first name). Administrator privileges may be required:

npm config set cache "C:\Users\John~1\AppData\Roaming\npm-cache" --global

For more details, see: https://stackoverflow.com/a/58354623/4609457

Development Workflow

# Complete workflow from generation to deployment
sos applet generate --name my-sample-applet --language typescript --bundler webpack --git yes
cd my-sample-applet

# Start development with hot reload
npm start

# Build for production
npm run build

# Upload to platform
npm run upload

Since

0.1.0

Global Options

All commands support the following global options:

OptionAliasDescription
--help-hDisplay help information for any command
--version-vDisplay the installed version of the CLI
--api-url-uOverride the API URL for REST requests
--profileUse a specific profile from ~/.sosrc config

Examples

# Show version
sos --version

# Get help for any command
sos applet --help
sos applet upload --help

# Use custom API endpoint
sos --api-url https://api.example.com applet upload

# Use specific profile
sos --profile production organization list