Getting started
This guide will help you install the Gram ecosystem and compile your first recipe.
-
Installation
Install the
gramCLI globally with your package manager of choice — it runs on both Node.js (>=20) and Bun: -
Editor Setup
Because Gram treats recipes as code, having the right editor makes a huge difference.
Search for “Gram - Recipe Language” in the Extensions view (
Ctrl+Shift+X/Cmd+Shift+X) and install it, or grab it directly from the VS Code Marketplace.Building from source instead
-
Initializing a Project
Before writing any recipe, it’s highly recommended to initialize a Gram workspace. Run this command in a new folder:
This command scaffolds a
.gram/directory with a configuration file and a starter database. -
Writing a Simple Recipe
Let’s make some pancakes, shall we?
Create a new file named
pancakes.gram, open it in the editor, and add the following basic recipe: -
Compiling the Recipe
Time to see the compiler in action!
Run the following command in the terminal to compile the recipe into a structured JSON format:
This command will parse the recipe and output its structured JSON representation. By default, it prints to the console, but you can save it to a file:
While the JSON output is incredibly useful for building applications around Gram, it is not the most readable format for humans!
To see your recipe rendered directly in your terminal, you can use the
viewcommand:
Next steps
Section titled “Next steps”Now that you have seen the basics, it’s time to discover the true power of Gram’s relational variables, timers, and automatic math scaling by writing a more complex recipe: