Command-line tools

The command-line tools are the primary interface to the Trigger.io Forge build service.

Using the command-line tools you can:

  • create new apps
  • build your app for various platform
  • run and debug apps
  • package apps for distribution
  • manage app reloads

Installation

The command-line tools are available via npm.

The first thing you'll need is a working Node.js installation.

You can either install Node.js via your favourite package manager or download it here:

https://nodejs.org/

Once you have verified that your Node.js installation is working you can perform the following tasks to get going with a new app:

Create your app directory and initialize npm

mkdir my_app
cd my_app
npm init

Install the forge command-line tools

npm i @triggercorp/forge --save

Create an app

npx forge create

Build app for Android and run it

npx forge build android
npx forge run android

Build app for iOS and run it

npx forge build ios
npx forge run ios

Build app for the Web and run it

npx forge build web
npx forge run web

Global installation

Important: Only use npm to perform a global installation if you know exactly what you are doing and why you are doing it.

It's also possible to install the forge command-line executable globally in your Node.js installation.

npm i @triggercorp/forge -g
forge version

Or, if your npm installation requires root permissions for a global install:

sudo npm i @triggercorp/forge -g --unsafe-perm=true

Command Reference

There are five main commands when using Trigger.io:

  • forge create
  • forge build
  • forge serve
  • forge run
  • forge package

Reload has a number of commands which can be run from the command line:

  • forge reload list
  • forge reload create
  • forge reload push

These are explained in more detail in Using Trigger.io Reload.

There are also some additional commands which may be used:

  • forge check: Perform some sanity checks on the app, including parsing the JavaScript to check for syntax errors.

Run any command with the --help argument to see more information about the particular command.

Note: All commands can be run with the --verbose parameter, to enable the display of more output.

Parameters

Parameters to the forge commands can be given as command-line options, or stored in a file.

Command-line options are dot-separated names, like --android.sdk /path/to/android-sdk.

A complete list of command-line options, is given in Available Forge Parameters.

Location of forge executable in Toolkit

The forge executable can also be found in the legacy Toolkit distribution:

Windows

C:\> "C:\Users\<Your Username>\AppData\Local\Trigger Toolkit\forge.exe"

Mac users

$ $HOME/Library/Trigger\ Toolkit/forge

Linux users

$ ~/TriggerToolkit/forge