LogoLogo
HomepageResellerPricingSign in
  • AppMachine
  • 📃Product Updates
  • 👷Build your app
    • Preview your app
    • App templates
    • App Settings
    • Update payment method
    • Cancel subscription
  • ❔General App Building FAQ
  • How to
  • 🧱Blocks
    • 🔠Admin
    • 📄Blank Page
    • 📞Call
    • 🏢Contact
    • 📝Contact Us
    • 🧾Coupons
    • 📃Custom Form
    • 📧Email
    • 🗓️Events
    • ❔FAQ
    • 🌐Facebook
    • 🕑Hours
    • ℹ️Information
    • 📣Intro
    • ☕JavaScript
    • 🔒Lock
    • 🎧Music
    • 📰News
    • 📃PDF
    • 🗺️POI
    • 👥People
    • 📷Photos
    • 🏬Products
    • 📩Push Messages
    • 📻Radio
    • ↪️Submenu
    • 🐦Twitter
    • 👨‍💻URLs
    • 🖥️Web Page
    • 📺Video
    • 📱WhatsApp
  • 📃Data
    • Appmachine Data
    • Delete (test) data from Custom Form
    • Google Sheets
    • Web services
  • 🖌️Style your app
    • Theme
    • Home Screen
    • FAQ Style
  • 🎨Style your screens
    • Elements
  • Share your app
    • ✈️Publishing your app
      • Technical Setup Quick Start Guide
      • Update your app
      • Unpublish an app from the app stores
    • 🌐Web App Publishing
      • Hosting on custom domain
    • 🍏Apple App Store
      • iOS developer account
      • App Store Connect API keys
      • Link your app
      • New app record in App Store Connect
      • App privacy details
      • Edit Store information
      • Fix App publish issues
      • Push certificates
      • App Store Connect app status overview
      • App Store Review Guidelines
      • Publish app Unlisted
      • Accept updated License agreement
      • Apple App Store FAQ
      • iPad
      • Enterprise
        • Setup your Enterprise app
        • Create iOS Distribution Certificate
        • Create App ID
        • Create Mobile Provisioning Profile
        • Downloading and installing an Enterprise app
    • 🍐Google Play
      • Create a Google Developer Account
      • Setup your Android app
      • How to request a Google Maps API Key
      • Test your Android app before publishing to Google Play
      • Upload your Android app to Google Play Store for the first time
      • Update Android app (short)
      • Update an Android app (extended)
      • Data safety details on the Google Play Store
      • Sell your app in Google Play Store
      • Create Google merchant account
      • Force Store Update for your Android App
      • Authorise an additional user to your Google Play developer account
      • What if my app is suspended by Google?
  • App details
    • 🕵️Google Analytics
      • Google Analytics setup overview
      • Setup iOS analytics
      • Setup Android analytics
      • Inviting a new Google Analytics user
    • 🔥Firebase
      • Create Firebase project
      • Locate Firebase Server key
      • Renew Firebase Server Key
      • Register iOS app
      • Register Android app
      • Enable Cloud Messaging
      • Enable Google Analytics
      • Google Analytics via Firebase
    • 📨Push notifications
      • Setup Apple Push certificate
    • 🧑‍🤝‍🧑User management
      • Create Apple Sign In key
      • Setup Azure Active Directory
      • Create Facebook App ID Secret
    • 🐦Twitter API keys
    • 🔏Privacy policy
    • 👩‍🔧Your Account
      • Account Settings
      • Account FAQ
      • Payment FAQ
    • 📱Admin CMS
  • Developers
    • 👩‍💻JavaScript
      • Develop locally
      • SDK
        • Core
        • JS Data
        • Media
        • Navigation
        • Notification
        • User
      • CLI
        • CLI Token and Secret
        • Errors
          • CONFIG_PROPERTIES_INVALID
          • CONFIG_VALUES_INVALID
          • ENTRY_FILE_NOT_FOUND
          • OUTPUT_DIRECTORY_IS_EMPTY
          • OUTPUT_DIRECTORY_NOT_FOUND
          • TOKEN_SECRET_NOT_PROVIDED
          • TOKEN_SECRET_NOT_VALID
      • Migrate from old Custom JS
    • 💻Web services
Powered by GitBook
On this page
  • Installation​
  • Usage​
  • Commands​
  • Advanced​
  • Issues & Bugs​

Was this helpful?

  1. Developers
  2. JavaScript

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​

Config Property
Type
Default

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.

PreviousUserNextCLI Token and Secret

Last updated 2 years ago

Was this helpful?

👩‍💻