From 205ec6154916bdfde89b06ca9bd8ee4e4b56ee15 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Wed, 1 Mar 2023 18:01:09 -0500 Subject: [PATCH] improve export and run command docs --- docs/cli/commands/export.mdx | 93 ++++++++++++++++++++++++++++-------- docs/cli/commands/run.mdx | 13 +++++ 2 files changed, 86 insertions(+), 20 deletions(-) diff --git a/docs/cli/commands/export.mdx b/docs/cli/commands/export.mdx index 3ddf8ef6d..206a85cc6 100644 --- a/docs/cli/commands/export.mdx +++ b/docs/cli/commands/export.mdx @@ -11,31 +11,84 @@ infisical export [options] Export environment variables from the platform into a file format. -## Options +## Subcommands & flags -| Option | Description | Default value | -| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -| `--env` | Used to set the environment that secrets are pulled from. Accepted values: `dev`, `staging`, `test`, `prod` | `dev` | -| `--projectId` | By default the project id isretrieved from the `.infisical.json` located at the root of your local project. This flag allows you to override this behavior | `None` | -| `--expand` | Parse shell parameter expansions in your secrets (e.g., `${DOMAIN}`) | `true` | -| `--format` | Format of the output file. Accepted values: `dotenv`, `dotenv-export`, `csv` and `json` | `dotenv` | + + Use this command to export environment variables from the platform into a raw file formats -## Examples + ```bash + $ infisical export -```bash -# Export variables to a .env file -infisical export > .env + # Export variables to a .env file + infisical export > .env -# Export variables to a .env file (with export keyword) -infisical export --format=dotenv-export > .env + # Export variables to a .env file (with export keyword) + infisical export --format=dotenv-export > .env -# Export variables to a CSV file -infisical export --format=csv > secrets.csv + # Export variables to a CSV file + infisical export --format=csv > secrets.csv -# Export variables to a JSON file -infisical export --format=json > secrets.json + # Export variables to a JSON file + infisical export --format=json > secrets.json -# Export variables to a YAML file -infisical export --format=yaml > secrets.yaml + # Export variables to a YAML file + infisical export --format=yaml > secrets.yaml + ``` -``` + ### flags + + Used to set the environment that secrets are pulled from. + + ```bash + # Example + infisical export --env=prod + ``` + + Note: this flag only accepts environment slug names not the fully qualified name. To view the slug name of an environment, visit the project settings page. + + default value: `dev` + + + + By default the project id is retrieved from the `.infisical.json` located at the root of your local project. + This flag allows you to override this behavior by explicitly defining the project to fetch your secrets from. + + ```bash + # Example + + infisical export --projectId=XXXXXXXXXXXXXX + ``` + + + + Parse shell parameter expansions in your secrets (e.g., `${DOMAIN}`) + + Default value: `true` + + + + Format of the output file. Accepted values: `dotenv`, `dotenv-export`, `csv` and `json` + + Default value: `dotenv` + + + + Prioritizes personal secrets with the same name over shared secrets + + Default value: `true` + + + + When working with tags, you can use this flag to filter and retrieve only secrets that are associated with a specific tag(s). + + ```bash + # Example + infisical run --tags=tag1,tag2,tag3 -- npm run dev + ``` + + Note: you must reference the tag by its slug name not its fully qualified name. Go to project settings to view all tag slugs. + + By default, all secrets are fetched + + + diff --git a/docs/cli/commands/run.mdx b/docs/cli/commands/run.mdx index fcc9be549..18c0069bc 100644 --- a/docs/cli/commands/run.mdx +++ b/docs/cli/commands/run.mdx @@ -79,4 +79,17 @@ Inject secrets from Infisical into your application process. Default value: `true` + + When working with tags, you can use this flag to filter and retrieve only secrets that are associated with a specific tag(s). + + ```bash + # Example + infisical run --tags=tag1,tag2,tag3 -- npm run dev + ``` + + Note: you must reference the tag by its slug name not its fully qualified name. Go to project settings to view all tag slugs. + + By default, all secrets are fetched + +