Skip to main content

Get started

Let's follow a few steps and we'll get you started in less than 10 minutes.

Choose an installation method​

Blaze comes packaged as a single executable file.

It can be installed on all platforms that support the Rust runtime and Node.js (Linux, MacOS, Windows).

There are two ways to install it :

Installing using pre-built binaries​

Pre-built binaries are provided for the most common platforms.

If you want to skip this guide and install the binary by yourself, you can go ahead and find direct download links for each platform here.

Install for Linux or Mac OSX​

Just copy and paste one of the following scripts into your terminal and Blaze will install itself.

info

These scripts might assume that you are using sudo on your system. You can also run them directly as root.

  • Linux (GNU x64)
  • Linux (Musl x64)
  • OSX (x64)
  • OSX (aarch64)
curl -sSf --tlsv1.3 https://downloads.blaze-monorepo.dev/versions/latest/builds/x86_64-linux-gnu/package | tar zx
sudo install -t /usr/local/bin blaze

Then verify everything went well by checking the installed Blaze version :

blaze version

Install on Windows​

  • Extract blaze.exe anywhere on your system.
  • Add its parent directory to your Path environment variable.
  • Restart your shell environment and run blaze version.

Installing from source code​

Setting up your monorepo​

Once you're ready, you can initialize a new Blaze monorepo in your current working directory using the init command :

blaze init
info

The init command's behavior can be customized. Checkout its documentation in order to know more.

The generated workspace.jsonnet is your monorepo main configuration file. It is where you will be adding your projects.

For now, there should only one declared project (which is just a demo project).

Running your first target​

A target could be defined as a development cycle step (for example compiling, testing, deploying etc...).

The init creates by default a demo project with a simple Hello world target. Let's see how it works.

From the top of our workspace, we should have the following file structure :

├── workspace.jsonnet
├── hello-world-root/
| ├── project.jsonnet

First, explore the workspace.jsonnet file. There should be a project reference named example-project.

workspace.json
{
"name": "<name of your workspace>",
"projects": {
"example-project": {
"path": "example-project",
"tags": [],
"description": "A demo project for your new workspace !"
}
},
"settings": {
// ... more keys ...
}
}

It is indicated that a project named example-project lives inside the example-project directory.

Inside this directory, the project is configured inside a example-project/project.json file.

hello-world/project.json
{
"targets": {
"say-hello": {
"executor": "std:commands",
"options": {
"commands": [
{
"program": "echo",
"arguments": ["{{ vars.demo-message }}"]
}
]
}
}
}
}

In this project, only one target is defined, it is named say-hello.

Any target in Blaze can rely on what we call an executor. It is what makes the target do something.

The one that we are using in this case allows us to run shell commands (std:commands). It is configured through the options key.

Let's try it by running our target :

$ blaze run example-project:say-hello

Let's checkout the output:

[INFO] 1 target(s) will be executed (["example-project:say-hello"])
[INFO] 1 executor reference(s) will be resolved (["std:commands"])
[INFO] + echo Hello world!
Hello world!

Execution graph results:

example-project:say-hello (executed in 1.1286ms)

All good. Now we can create real targets for real projects !