From 7aa5ef844cdb1207204c3df86fd1ecbcb567da0b Mon Sep 17 00:00:00 2001 From: Parth Patel Date: Mon, 8 May 2023 01:04:35 -0400 Subject: [PATCH] Update CLI usage docs to showcase the ability to inject environment variables in shell aliases --- docs/cli/usage.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/cli/usage.mdx b/docs/cli/usage.mdx index 0e8c5fce9..b566e2c0b 100644 --- a/docs/cli/usage.mdx +++ b/docs/cli/usage.mdx @@ -39,6 +39,22 @@ infisical init infisical run -- [your application start command] ``` +## Injecting environment variables in custom aliases +Custom aliases can utilize secrets from Infisical. Suppose there is a custom alias `yd` in `custom.sh` that runs `yarn dev` and needs the secrets provided by Infisical. +```bash +#!/bin/sh + +yd() { + yarn dev +} +``` + +To make the secrets available from Infisical to `yd`, you can run the following command: + +```bash +infisical run --command="source custom.sh && yd" +``` + View all available options for `run` command [here](./commands/run) ## Examples: