# Getting started

# Step 1 - Installation

Gemforge is written in Node.js and works on all the platforms that Node runs on.

It's best to install Gemforge globally in your Node environment, depending on which package manager you use:

pnpm add --global gemforge
npm install --global gemforge
yarn add --global gemforge

At this point you should be able to run the gemforge command:

> gemforge --help
Usage: gemforge [options] [command]

Options:
  -V, --version               output the version number
  -h, --help                  display help for command

Commands:
  init [options]              Initialize a gemforge config file for an existing project.
  scaffold [options]          Generate diamond smart contract project scaffolding.
  build [options]             Build a project.
  deploy [options] [network]  Deploy the diamond to a network.
  help [command]              display help for command

# Step 2 - Project setup

Gemforge provides example projects to get you started.

These can be cloned and setup in an empty folder using the scaffold command:

gemforge scaffold --folder /path/to/new_or_empty_folder
gemforge scaffold --hardhat --folder /path/to/new_or_empty_folder

If you have an existing Diamond Standard project then you can use the init command to create a Gemforge configuration file.

gemforge init
gemforge init --hardhat

The gemforge.config.cjs file will have been created in the current folder. You will probably need to edit this file to customize it for your project.

# Step 3 - Build contracts

To generate all necessary Diamond code and compile your project inside the project folder:

gemforge build

# Step 4 - Deploy contracts

Assuming a local test node is running at http://localhost:8545, use the following to deploy your Diamond code and facets to it:

gemforge deploy local

At this point you've just built and deployed a Diamond Standard project to your local test node using Gemforge!

# Step 5 - Next steps