
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@modyo/cli
Advanced tools
====================================
The Modyo Command Line Interface (CLI) is a command line tool based in two principles acceleration and integration, and this principles has a command get and push respectively.
First, you need to bring the Modyo CLI on your local machine to have the modyo-cli
command available, this will allow you to initialize a project with some Front end architectural decisions already taken, or use to initialize a widget from the catalog if you have access.
To use the Modyo's CLI, you have these options.
Global installation on your local machine
npm i -g @modyo/cli #via npm
yarn global add @modyo/cli #via yarn
This command will make the command modyo-cli available on the terminal session globally
Through NPX without installation
npx @modyo/cli #via npx
npx @modyo/cli@version #via npx - specific version
modyo-cli autocomplete [SHELL]
modyo-cli get NAME [DIRECTORY]
modyo-cli help [COMMANDS]
modyo-cli preview
modyo-cli push [NAME]
modyo-cli version
modyo-cli autocomplete [SHELL]
display autocomplete installation instructions
USAGE
$ modyo-cli autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
display autocomplete installation instructions
EXAMPLES
$ modyo-cli autocomplete
$ modyo-cli autocomplete bash
$ modyo-cli autocomplete zsh
$ modyo-cli autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
modyo-cli get NAME [DIRECTORY]
Pull a widget from our catalog into a new directory
USAGE
$ modyo-cli get NAME [DIRECTORY] [-f] [-h] [-o <value>]
ARGUMENTS
NAME The name of the widget
DIRECTORY Name of directory to init
FLAGS
-f, --force Override folder if exist
-h, --help Output usage information
-o, --organization=<value> [default: dynamic-framework] Github Organization
DESCRIPTION
Pull a widget from our catalog into a new directory
In general, the `get` command is used to obtain a boilerplate widget.
EXAMPLES
There are some public widget names that can be accessed via this command
To initialize a widget
$ modyo-cli get dynamic-react-base-template [DIRECTORY]
From this command and on you can continue using the widget like any other front-end widget.
Your organization can create its own custom templates to initialize new widgets and use them with the `organization`
option
$ modyo-cli get --organization=myOrganization my-custom-template-repo [DIRECTORY]
See code: src/commands/get.ts
modyo-cli help [COMMANDS]
Display help for modyo-cli.
USAGE
$ modyo-cli help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for modyo-cli.
See code: @oclif/plugin-help
modyo-cli preview
Preview local widget over Modyo platform
USAGE
$ modyo-cli preview -t <value> -u <value> [-h] [-v 8|9|10] [-i <value> | -n <value>] [-p <value>] [-s
<value>] [-j <value>]
FLAGS
-h, --help Output usage information
-i, --site-id=<value> Id of the site where the widget will be previewed
-j, --entry-js=<value> [default: main.js] Entry JS file of the widget
-n, --site-host=<value> Host of the site where the widget will be previewed
-p, --port=<value> [default: 8080] Deploy port local widget running
-s, --dom-id=<value> [default: widgetName] Container id of the widget
-t, --token=<value> (required) Modyo Api token
-u, --account-url=<value> (required) URL of your ®Modyo account ex("https://account.modyo.com")
-v, --version=<option> [default: 9] Version of Modyo platform
<options: 8|9|10>
DESCRIPTION
Preview local widget over Modyo platform
The `preview` command is responsible for informing the platform about local entry points so that the widget can be
rendered on the platform locally.
MODYO_VERSION=version
MODYO_TOKEN=token
MODYO_ACCOUNT_URL=account-url
MODYO_SITE_ID=siteId
MODYO_SITE_HOST=siteHost
MODYO_LOCAL_PORT=port
MODYO_LOCAL_DOM_ID=domId
MODYO_LOCAL_ENTRY_JS=entryJs
EXAMPLES
$ modyo-cli preview
See code: src/commands/preview.ts
modyo-cli push [NAME]
Push widget to Modyo platform
USAGE
$ modyo-cli push [NAME] -t <value> -u <value> [-p] [-h] [-d <value>] [-v 8|9|10] [-i <value> | -n
<value>] [-b <value>] [-e] [-l | -f <value>] [-z] [-j <value>] [-c <value>]
ARGUMENTS
NAME The name of the widget
FLAGS
-b, --build-command=<value> [default: build] Build command in package.json
-c, --zip-entry-css=<value> [default: main.css] Entry css file when use --zip flag
-d, --build-directory=<value> [default: dist] Build directory path
-e, --[no-]remove-emojis Remove emojis from the widget that will be push
-f, --disable-liquid-regex=<value> Disable liquid on files that match a regex
-h, --help Output usage information
-i, --site-id=<value> Id of the site where the widget will be push
-j, --zip-entry-js=<value> [default: main.js] Entry js file when use --zip flag
-l, --disable-liquid Disable liquid on all files
-n, --site-host=<value> Host of the site where the widget will be push
-p, --publish Force widget publication
-t, --token=<value> (required) Modyo Api token
-u, --account-url=<value> (required) URL of your ®Modyo account ex("https://account.modyo.com")
-v, --version=<option> [default: 9] Version of Modyo platform
<options: 8|9|10>
-z, --zip Zip bundle to publish
DESCRIPTION
Push widget to Modyo platform
The `push` command is the one in charge of the integration principle, used to send the widget to the selected site in
the modyo platform.
It will use an argument called name to upload the widget to the platform and some required flags like token site_base
id or host to can identify the ®Modyo platform which host the widget and have an additional flag to avoid the manual
process flow of widget publication.
Many of the options can be defined as environment variables or inside an .env file that is recommended to avoid the
publication to the GitHub registry because can contain some delicate information
MODYO_BUILD_DIRECTORY=buildDirectoryPath
MODYO_VERSION=version
MODYO_TOKEN=token
MODYO_ACCOUNT_URL=account-url
MODYO_SITE_ID=siteId
MODYO_SITE_HOST=siteHost
MODYO_BUILD_COMMAND=buildCommand
MODYO_REGEX_EXCLUDE=regexToExcludeFiles
MODYO_DISABLE_LIQUID_REGEX=regexToDisableLiquidOnFiles
MODYO_ZIP=true
MODYO_ZIP_ENTRY_JS=main.js
MODYO_ZIP_ENTRY_CSS=main.css
EXAMPLES
$ modyo-cli push
--zip
Flag and Code Splitting SupportThe --zip
flag is specifically designed for uploading widgets that use code splitting. This means the widget's build, typically configured through Webpack, splits the code into multiple JavaScript files (chunks) instead of a single bundled file.
When using the --zip
flag, the CLI will package all widget files (JS, CSS, assets, etc.) into a .zip
file. This ensures that Modyo's platform can correctly manage and load the chunks as needed.
Additionally, the --zip-entry-js
and --zip-entry-css
flags specify which files within the ZIP should be used as the widget's entry points. By default, these are set to main.js
and main.css
, but it can be customized if the project has a different build configuration.
The --zip
flag is only compatible with Webpack. This is because Modyo uses a dynamic runtime path to load assets, which is specifically supported through Webpack’s configuration.
Bundlers other than Webpack are not supported with this flag since they lack the necessary runtime path injection for chunk loading.
The CLI also supports uploading .wasm
(WebAssembly) files. However, this support is conditional:
--zip
flag must be enabled.If .wasm
files are present in your widget but the upload is performed without the --zip
flag, these files will be ignored and won’t be available on the Modyo platform.
See code: src/commands/push.ts
modyo-cli version
USAGE
$ modyo-cli version [--json] [--verbose]
FLAGS
--verbose Show additional information about the CLI.
GLOBAL FLAGS
--json Format output as json.
FLAG DESCRIPTIONS
--verbose Show additional information about the CLI.
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
See code: @oclif/plugin-version
Use the debug for debugging. The CLI uses this module for all of its debugging. If you set the environment variable DEBUG=*
it will print all the debug output to the screen.
Depending on your shell you may need to escape this with DEBUG=\*
. On Windows you can't set environment variables in line, so you'll need to run set DEBUG=*
before running the command.
this will output the full error trace and all the pushed information to modyo will be printed in the folder .debug to accomplish a more detailed error.
Modyo CLI is licensed under the .
FAQs
Modyo CLI Command line to expose local development tools
The npm package @modyo/cli receives a total of 1,486 weekly downloads. As such, @modyo/cli popularity was classified as popular.
We found that @modyo/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.