@microtronics/studio-cli
v0.50.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
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
- APM ID of the development tag
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"usb
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 --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