mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat(cli): added template feature to cli export command
This commit is contained in:
@@ -33,6 +33,9 @@ Export environment variables from the platform into a file format.
|
||||
|
||||
# Export variables to a YAML file
|
||||
infisical export --format=yaml > secrets.yaml
|
||||
|
||||
# Export variables from a template
|
||||
infisical export --template=<path to template>
|
||||
```
|
||||
|
||||
### Environment variables
|
||||
@@ -57,6 +60,22 @@ Export environment variables from the platform into a file format.
|
||||
</Accordion>
|
||||
|
||||
### flags
|
||||
<Accordion title="--template">
|
||||
The --template flag specifies the path to the template file used for rendering secrets. In template mode, you can omit the other flags since the settings are already configured within the template.
|
||||
|
||||
```bash
|
||||
# Example
|
||||
infisical export --template="/path/to/template"
|
||||
```
|
||||
|
||||
```text my-dot-env-secret-template
|
||||
{{- with secret "<projectId>" "<environment slug>" "/" }}
|
||||
{{- range . }}
|
||||
{{ .Key }}={{ .Value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
```
|
||||
</Accordion>
|
||||
<Accordion title="--env">
|
||||
Used to set the environment that secrets are pulled from.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user