CLI
@myjsblock/cli
A CLI package to create, maintain, and publish javascript block projects to AppMachine Flutter applications.
Using the CLI package, you're able to connect a local javascript project to your AppMachine Project. The CLI provides multiple commands to create, maintain and publish new blocks.
Installationβ
The CLI can be globally installed on your machine, so you can easily use it across projects.
NPMβ
npm install -g @myjsblock/cli
Yarnβ
yarn global add @myjsblock/cli
Usageβ
myjsblock [command] [options]
Commandsβ
Link commandβ
Links your local directory to a Block Project, saving a credentials file in your project root.
myjsblock link
Push commandβ
Push your local project to the AppMachine server.
myjsblock push
Helpβ
Displays helpful information for the available commands.
myjsblock help
Supported Optionsβ
--token Block token for the AppMachine App.
--secret A Secret to login to the AppMachine server.
--overwrite Overwrites the credential and config files.
--help Displays complete help for [cmd].
--debug Helps debugging the CLI.
Advancedβ
Manual linkingβ
Instead of supplying the --token
and --secret
arguments, you may create a myjsblock.credentials.json
file in your project directory.
This file should follow the following format, using your own token and secret:
{
"token": "TJ9plldgQSL87dnK6ZIVpzTszlG3TPKo",
"secret": "ifb1kEBUYBJ17NSQWdBUNoTTU5O2d1jlTJ9plldgQSL87dnK6ZIVpzTszlG3TPKo"
}
Git ignoring myjsblock.credentials.jsonβ
If you use a version control system like Git, make sure you add the myjsblock.credentials.json
file to the .gitignore
file. This will prevent it from being saved in version control and is a good security measure.
Config Fileβ
Some advanced configuration requires a myjsblock.config.json
file in your project directory. This enables you to change settings like ouputDirectory
and entryFile
for your project.
An example of such a file would be:
{
"entryFile": "index.html",
"outputDirectory": "dist"
}
Config Propertiesβ
entryFile
string
index.html
outputDirectory
string
dist
Output Directoryβ
This changes the output directory for your project. The default value is dist
. The contents of this directory will be uploaded to the server by the CLI.
Issues & Bugsβ
If you run into issues or have a question, please open an issue here.
Last updated
Was this helpful?