Getting started
Welcome to Toki! This tutorial will guide you through the essentials of installing Toki and creating your first pipeline config. By the end of this tutorial, you’ll have a working Toki pipeline with your custom command.
Prerequisites
Section titled “Prerequisites”Before we begin make sure you have a terminal or command prompt.
Step 1: Downloading Toki binary
Section titled “Step 1: Downloading Toki binary”First, let’s download Toki binary file for your OS from releases page
Step 2: Writing your first pipeline config
Section titled “Step 2: Writing your first pipeline config”Toki is driven via config(s). We’ll start by creating a simple pipeline config. Copy and paste the following config into pipeline-config.json file:
[ { "command": "sleep 120", "auth": [ { "strategy": "custom", "params": { "expiry": 2, "refresh_after": 1, "command": "sleep 1 && echo 1" } } ] }]The above config contains a single step with sleep 120 as the main command and a custom auth strategy with refresh rate set to 1 minute interval.
To run this config run the following command in your terminal: toki pipeline-config.json, this would spawn a child process which will run the main command in the background while the main process takes care of handling auth expiry logic.
🚀 Congratulations you just ran your first Toki pipeline!
Next steps
Section titled “Next steps”Now that you have a simple pipeline config, you can:
- Try adding more steps,
- Learn about different config types,
- Explore examples
Happy orchestrating with Toki!