@microtronics/studio-cli
v0.63.0
Published
Microtronics Studio CLI Tool
Readme
@microtronics/studio-cli
The Microtronics Studio CLI Tool
This tool assists in installing, packaging and publishing Microtronics Studio libraries and apps.
Installation
Make sure you have Node.js installed. Then run:
$ npm i -g @microtronics/studio-cliUsage
$ studio-cli --versionFor a reference on all the available studio-cli commands, run studio-cli --help
Requirements
Node.js version 22 or higher.
Commands
install (alias: i)
Install all dependencies in your project.
$ studio-cli install [dependency...]Options:
-e, --env <environment>- CLI target environment (defaults to STUDIO_ENV environment variable)--token <API-token>- API Access Token (defaults to STUDIO_TOKEN environment variable)
Examples:
$ studio-cli install
$ studio-cli i
$ studio-cli install dependency-namebuild
Build the project.
$ studio-cli build [options]Options:
-p, --part <APM part>- APM part that should be built- Available parts:
dde,dlo,pov,blo,dfiles
- Available parts:
-e, --env <environment>- CLI target environment- Available environments:
lucky,wynni,production(default)
- Available environments:
--token <API-token>- API Access Token
Manifest Overrides:
You can overwrite manifest options using the --option=value syntax.
Examples:
$ studio-cli build
$ studio-cli build --part dlo
$ studio-cli build --env wynni
$ studio-cli build --dlo.mainFile="./dlo/test.dlo"publish
Publish the project to the registry.
$ studio-cli publish [options]Options:
-ph, --phase <release phase>- Specify a release phase (default:release)- Available phases:
alpha,beta,rc,release,stage,passive,withdrawn
- Available phases:
--allowedBackends <null|*|server.xz;server.yz>- Specify the allowedBackends deployment for this versionnull- No restrictions (default)*- All backends allowedserver.xz;server.yz- Specific backend servers (semicolon-separated)
-e, --env <environment>- CLI target environment- Available environments:
lucky,wynni,production(default)
- Available environments:
--token <API-token>- API Access Token-i, --packagePath <path>- Publish the provided library or app package. Use "*" for autodetection
Examples:
$ studio-cli publish
$ studio-cli publish --phase beta
$ studio-cli publish --allowedBackends "*"
$ studio-cli publish --packagePath ./my-package.tar.gz --env wynnipackage (alias: pack)
Package the project.
$ studio-cli package [options]Options:
-ph, --phase <release phase>- Specify a release phase (default:release)- Available phases:
alpha,beta,rc,release,stage,passive,withdrawn
- Available phases:
-e, --env <environment>- CLI target environment- Available environments:
lucky,wynni,production(default)
- Available environments:
--token <API-token>- API Access Token
Examples:
$ studio-cli package
$ studio-cli pack --phase alpha
$ studio-cli pack --env wynnirun
Build, upload to USB device, and create development site on myDatanet. This command is designed for development and integration testing purposes.
$ studio-cli run -s <serial> --server <url> [options]Options:
-s, --serial <serial>- Device serial number (16 characters hex) [required]--server <url>- myDatanet instance URL (https:// prefix optional). Defaults toMYDATANET_HOSTenvironment variable--customer <customerId>- myDatanet customer UID or ID. Defaults toMYDATANET_CUSTOMERenvironment variable--mdn-token <token>- myDatanet API token. Defaults toMYDATANET_TOKENenvironment variable-p, --part <APM part>- APM part that should be built- Available parts:
dde,dlo,pov,blo,dfiles
- Available parts:
-e, --env <environment>- CLI target environment- Available environments:
lucky,wynni,production(default)
- Available environments:
--token <API-token>- Studio API Access Token--debug- Enable debug logging--silent- Suppress intermediate progress output. Only the final result and errors are printed--json- Print the deployment result as a JSON object ({"siteUid", "siteName", "apmId"}) instead of the human-readable summary. Best combined with--silentfor machine-readable output--siteName <name>- Override the auto-generated development site name (max 50 characters). By default, the site name is derived from the device serial number (for DLO projects) or from the app name and current user (e.g.MyApp_JohnDoe)
Exit Codes:
0- Success1- Build failed2- USB device not found3- USB upload failed4- myDatanet authentication failed5- Development tag upload failed6- Site creation failed
Output: On success, the command outputs:
- Site UID of the newly created/reused development site
- Site name
- APM ID of the development tag
With --json, the output is a single JSON line:
{"siteUid":"<uid>","siteName":"<name>","apmId":"<id>"}Examples:
# Basic usage with environment variables
$ export MYDATANET_TOKEN=your_token
$ export MYDATANET_HOST=myserver.mydatanet.net
$ export MYDATANET_CUSTOMER=your_customer_id
$ studio-cli run -s 1234567890ABCDEF
# Explicit options
$ studio-cli run -s 1234567890ABCDEF --server myserver.mydatanet.net --customer CUST123 --mdn-token your_token
# With build part selection
$ studio-cli run -s 1234567890ABCDEF --server myserver.mydatanet.net --part dlo --debug
# With manifest overrides
$ studio-cli run -s 1234567890ABCDEF --server myserver.mydatanet.net --dlo.mainFile="./dlo/test.dlo"
# With custom site name
$ studio-cli run -s 1234567890ABCDEF --server myserver.mydatanet.net --siteName "My Test Site"
# Machine-readable output for CI/CD (suppress progress, output JSON)
$ studio-cli run -s 1234567890ABCDEF --server myserver.mydatanet.net --silent --jsonusb
USB device management commands.
usb list
List available USB devices.
$ studio-cli usb listusb upload
Upload an AMX binary to a USB device.
$ studio-cli usb upload -s <serial> -f <path> [--debug]Options:
-s, --serial <serial>- Device serial number (16 characters hex) [required]-f, --file <path>- Path to the AMX file (relative to current directory) [required]--debug- Enable debug logging
Example:
$ studio-cli usb upload -s 1234567890ABCDEF -f ./app.amx
$ studio-cli usb upload -s 1234567890ABCDEF -f ./app.amx --debugusb sync
Sync a USB device with the myDatanet server. This triggers a full device synchronization including optional MNT and MDN communication phases.
$ studio-cli usb sync -s <serial> [--debug]Options:
-s, --serial <serial>- Device serial number (16 characters hex) [required]--debug- Enable debug logging (shows sync mode, phases, and message counts)
Example:
$ studio-cli usb sync -s 1234567890ABCDEF
$ studio-cli usb sync -s 1234567890ABCDEF --debugDevelopment
Execute commands from the root dir
$ npm run watch:build # or `watch:test` to also build testsOnce the watcher is up and running, you can run out of sources with:
$ node studio-cliTests can be executed with:
$ npm test