Forge repo instructions - 00-dev-environment-setup

Forge getting started guide

In order to prepare for the hands-on session, you’ll need to setup your development environment.

  • Install the Forge CLI (Command Line Interface)

  • Log in with an Atlassian API token

  • Create an Atlassian Developer Test Site

  • Create an API Ninjas account and generate an API key

[Prerequisite] Setting up Node.js

If you missed the Know Before You Go (KBYG) email, you need to setup your Node.js first. You can check the link below:

Check the rest of the KBYG document here.

Install the Forge CLI

Install the Forge CLI using npm. You’ll install the CLI globally so that the commands can be run across your system.

  1. Install the Forge CLI globally by running:

    npm install -g @forge/cli
    
    
  2. Verify that the CLI is installed correctly by running:

    forge --version
    
    

You should see a version number reported in the terminal. If a version number is not shown then the installation failed. Repeat step 1 and look for errors reported in the terminal.

With the CLI installed, view the complete list of Forge commands by running forge --help.

Log in with an Atlassian API token

Create or use an existing Atlassian API token to log in to the CLI. The CLI uses your token when running commands.

  1. Go to https://id.atlassian.com/manage/api-tokens.
  2. Click Create API token.
  3. In the Name mandatory field, enter a label to describe your API token. For example, team-26-eu-forge-workshop.
  4. In the Expires on mandatory field, select a future date no longer than a year e.g., 1/1/2027.
  5. Click Create.
  6. Click the Copy button
  7. Open a text editor of your choice e.g., Notepad, Sublime, or vi, and paste your API token. This is a temporary file that you will close as soon as you finish logging in to Forge CLI.
  8. Click the Done button.

Log in to the Forge CLI to start using Forge commands.

NOTE: Do not use sudo or root user when running forge. Doing so may cause issues with file permissions and ownership, potentially leading Forge CLI not functioning properly when run by a non-privileged user.

  1. Start the process by running:

    forge login
    
    
  2. Enter the email address associated with your Atlassian account.

  3. Enter your Atlassian API token. You copied this to the clipboard and a temporary text file in the previous task.

You will see a message similar to this confirming you are logged in:

✔ Logged in as Ian Gil Ragudo

Create an Atlassian Developer Test Site

To install and test your app, you’ll need to create a test site for it. For Confluence and Jira apps, you need an Atlassian cloud developer site; for Bitbucket apps, you’ll need a shared Bitbucket team space.

Jira and Confluence: set up a cloud developer site

Creating an Atlassian cloud developer site allows you to install and test your app with Confluence and Jira products set up for you. You can install your app to multiple Atlassian sites however, app data won’t be shared between separate Atlassian sites, products, or Forge environments.

[Recommended] Option 1 Create a development site with pre-loaded test data using the Forge CLI

  1. In your terminal, run the command

    forge site provision
    
    
  2. Once the provisioning state is completed, copy the site URL from the table and open it in your browser of choice

    ┌────────────────┬──────────────────────────────────────┬────────┬────────────┐
    │ Site name      │ Site URL                             │ Status │ Expires    │
    ├────────────────┼──────────────────────────────────────┼────────┼────────────┤
    │ one-atlas-xxxx │ https://one-atlas-xxxx.atlassian.net │ active │ 2026-12-03 │
    └────────────────┴──────────────────────────────────────┴────────┴────────────┘
    
    

Option 2 Create a cloud bundle via the browser

  1. Go to http://go.atlassian.com/cloud-dev and create a site using the email address associated with your Atlassian account.

  2. Once your site is ready, log in and complete the setup wizard.

Create an API Ninjas account and generate an API key

  1. Navigate to API Ninjas.

  2. Click the Get Free API Key button.

  3. Proceed with the registration then login. If you already have an account, proceed with the login.

  4. Grab the generated API key.

Troubleshooting guide for common errors

[macOS] Error setting up Node.js, causing permission errors in macOS

Cause:

There are two ways to set up Node.js on macOS:

  1. [Recommended] Using Node Version Manager (NVM), or
  2. Using the Node.js installer (i.e. downloading from Node.js — Download Node.js®)

Solution:

If you setup Node.js using the installer, try calling npm config set unsafe-perm true in the Terminal window to fix the permissions problem.

If that doesn’t work, install Node.js using NVM as explained in this document.

Working behind a proxy server

Cause:

Some companies require working behind a proxy server. To ensure Node.js can retrieve dependencies, you need to configure it to work with the proxy server.

Solution:

To configure Node.js to work with a proxy, use the following commands:

npm config set proxy http://user:password@proxy-url:port
npm config set https-proxy http://user:password@proxy-url:port

Replace user, password, proxy-url, and port with your specific proxy settings.

[Windows] Unable to install Node.js on Windows

Casue:

A range of issues may prevent installing Node.js on Windows

Solution:

Following the guide at Fix problems that block programs from being installed or removed | Microsoft Support.

Installing the Forge CLI returns “spawn ts-node ENOENT” error

When running npm install -g @forge/cli, the following error is returned:

Error: spawn ts-node ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    ...

Cause:

Node could be configured to run in development mode.

Solution:

Try running unset NODE_ENV on macOS and Linux or set NODE_ENV= on Windows to remove the environment variable and then try running npm install -g @forge/cli to re-attempt installing the Forge CLI.

Ngrok error running the Forge tunnel

Cause:

The use of Ngrok by Forge is now obsolete and you are running a version of the Forge CLI that depends on Ngrok (i.e. a version < 10.1.0).

Solution:

Update the Forge CLI by running:

npm install -g @forge/cli@latest

Check the version of the Forge CLI is now >= 10.1.0 by running:

forge --version

Running a Forge command fails with “Error: Command failed due to validation error”

Cause:

The command was run outside the project directory. This normally happens after the initial forge create and forgetting to change the directory.

Solution:

Go to the newly created forge project directory i.e., cd .

Cannot login into the Forge CLI

When running forge login, the following error is returned:

Error: Unable to get local issuer certificate

Cause:

Your VPN could be blocking access to our APIs.

Solution:

Disconnect from your VPN and run the command again.

These sort of guides are very redundant now.

  1. Open Codex or Claude
  2. Type “build a Forge app on Atlassian”
  3. Smash enter