Getting started with Templates
Fiberplane Templates are programmable workflows that allow you to automate notebook creation for your incident response, infrastructure debugging, and maintenance.
Overview of a template
Templates are defined by a Jsonnet file that is added to your Fiberplane account through the CLI.
Templates export a Jsonnet function that accepts some parameters and creates a Notebook using the helper functions provided by the Fiberplane Jsonnet library (fiberplane.libsonnet). See an example template below:
Let’s break it down line by line:
Setting up Templates
The easiest way to get started with the template is create the structure you want in the Notebook and then in the top right corner click “Share > Download as Template”
This will download the existing notebook with the content saved as a Jsonnet file. Alternatively you can use the fp templates init
CLI command to generate an empty template in your current directory
You can then edit the template using a text editor of your choice. Save the template as a Jsonnet file once you’re happy with it!
Adding templates to your Fiberplane account
You will need to add your template to your workspace to start using it in Fiberplane. To add the template run the following command in your terminal (See CLI, to get started with the Fiberplane CLI):
The fp templates create
command will then ask you to provide the title and description of your template, and will add the template to your Fiberplane account.
You can verify that the template is added by listing out all of your templates with fp templates list
or by navigating to your Fiberplane home screen’s Templates tab.
Updating templates
If you have made changes to your Template that you want to upload to Fiberplane you can run the following command:
The command will fetch a list of current templates and ask you which template you want to update and overwrite.
Removing templates
If you have a template you would like to remove from your gallery, run the following command passing the ID of your template as an argument:
These are the basic functions to get you started with Templates in Fiberplane. To see the full reference of available CLI commands see CLI reference.