mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 10:27:26 +00:00
Merge pull request #564 from parthvnp/feature/457
Add example in CLI usage docs to show how to utilize secrets in shell aliases
This commit is contained in:
+23
-4
@@ -34,10 +34,29 @@ infisical init
|
|||||||
|
|
||||||
## Inject environment variables
|
## Inject environment variables
|
||||||
|
|
||||||
```bash
|
<Accordion title="Injecting environment variables directly" defaultOpen="true">
|
||||||
# inject environment variables into app
|
```bash
|
||||||
infisical run -- [your application start command]
|
# inject environment variables into app
|
||||||
```
|
infisical run -- [your application start command]
|
||||||
|
```
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
|
<Accordion title="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"
|
||||||
|
```
|
||||||
|
</Accordion>
|
||||||
|
|
||||||
View all available options for `run` command [here](./commands/run)
|
View all available options for `run` command [here](./commands/run)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user