Getting Started with Forge

To use Forge, you will first need to install the toolkit from: https://trigger.io/forge/toolkit

After completing the install process, start the toolkit and you will be prompted to create an account. You can use the toolkit UI to build and test your apps or you can use the command-line tools that are bundled with the toolkit.

Read on to get started with the toolkit or learn about Getting started with command-line tools

Getting started with the toolkit

Read the instructions on the toolkit download page to learn how to install and start the toolkit on your platform.

After signing up or logging in, you will see your Projects. A project is a collection of apps and native modules that you work on as part of a team.

Toolkit projects list

Creating your first app

Click through into the project you want to work on, then click the "Create a new app" button. You will be prompted for a name and location and then you will be returned to the project page where you will now see the new app listed.

Toolkit app list for a project

Congratulations, you've created your first app and are ready to build and test it!

Working with an existing app

If you have an existing app, for example you may have cloned it from an existing Github repos or created it with the command-line tools, then you will need to import it.

Simply click the "Import an app" button. You will be prompted for the location and then returned to the project view where you will now see the app listed ready to be built and tested.

What next?

By now, you have a development environment set up.

From here, you could take a look at:

Getting started with the command-line tools

To run forge commands use the forge executable in your Toolkit installation.

Note: It is recommended that you add the directory that the forge executable is in to your path, otherwise you will have to use the full path to the forge executable each time you want to run any forge command.

Windows

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

Mac users

$ $HOME/Library/Trigger\ Toolkit/forge create

Linux users

$ ~/TriggerToolkit/forge create

Creating your first app

Note: If you have an existing app you'd like to work with, see Working with an existing app.

To keep each of your apps separate, we expect that you will want to work on them in different directories. In the terminal, we'll create a new directory and move into it:

mkdir "../demo-app"
cd "../demo-app"

Now, we'll create our app, with the forge create command. The first time you run this you will be prompted to enter your username and password. On each run you will need to enter a descriptive name for your new app and the Project ID to associate it with.

You can find the Project ID on your account page.

$ forge create 
[   INFO] Forge tools running at version 3.3.49
[   INFO] Update result: you already have the latest tools

You can find the ID for your project at https://trigger.io/account/
Project ID: 18

This name is what your application will be called on devices. You can change it later through config.json.
App Name: Weather Demo
[   INFO] Registering new app "Weather Demo" with trigger.io...
[   INFO] Fetching initial project template
[   INFO] Building app for the first time...
[   INFO] Update result: you already have the latest tools
[   INFO] Your Forge platform has been updated, downloading updated build instructions.
[   INFO] Fetching generation instructions for v1.4 into "/var/folders/g8/4rrh3bkx36qdcj819nkqgpj00000gn/T/forge-templates-zumPv5/.template"
[   INFO] Removing old templates if present
[   INFO] Using new templates
[   INFO] App structure created. To proceed:
[   INFO] 1) Put your code in the "src" folder
[   INFO] 2) Run forge build to make a build
[   INFO] 3) Run forge run to test out your build

At this point, you're ready to edit your app and start running builds!

Working with an existing app

If you are already working with an app on your machine, simply change directory to where the app is:

cd "../my-existing-app"

In that directory, you should have a src directory, containing the code for your app as well as the config.json and identity.json which are required by Forge

What next?

By now, you have a development environment set up.

From here, you could take a look at: