marmot-cli
A collection of cli commands for Marmot.
Installation
npm i marmot-cli -g
Commands
marmot upload
Archive the current directory as marmot-source.tgz
and upload to Marmot.
Use the following environmental variables to configure the storage location and credentials:
Key | Value |
---|
MARMOT_SERVER_URL | Marmot server URL |
MARMOT_ACCESS_KEY_ID | Marmot Access Key ID |
MARMOT_ACCESS_KEY_SECRET | Marmot Access Key Secret |
marmot genkey
Generate a new RSA private key that can be used for signing at ~/.marmot/rsa-key/
.
marmot pack
Pack the content from ./dist
folder into ./._temp/{APP_ID}.tar
, where APP_ID
is an environmental variable.
marmot sign
Sign the artifact generated by the pack command at ./._temp/{APP_ID}.tar
into ./_packages/{APP_ID}_{VERSION}.amr
, where APP_ID
and VERSION
are environmental variables.
marmot create
Create new app package based on templates.
$ marmot create <template> [path-to-project] [options]
For example:
$ marmot create h5-app path/to/project -c yarn
Architecture
The CLI is split into two parts, bin
and lib
:
bin
contains logic for command line invocation, parsing options, parameters and environmental variables. Files inside bin
are meant to be executed directly and they should not contain business logic.lib
contains the business logic. Files inside lib
expose functions that can be used by bin
.
The separation between bin
and lib
allows business logic to be unit-tested in isolated without actually running the commands.