diff --git a/cli/packages/cmd/export.go b/cli/packages/cmd/export.go
index c41750134..475aee802 100644
--- a/cli/packages/cmd/export.go
+++ b/cli/packages/cmd/export.go
@@ -70,7 +70,12 @@ var exportCmd = &cobra.Command{
util.HandleError(err, "Unable to parse flag")
}
- secrets, err := util.GetAllEnvironmentVariables(models.GetAllSecretsParameters{Environment: environmentName, InfisicalToken: infisicalToken, TagSlugs: tagSlugs, WorkspaceId: projectId})
+ secretsPath, err := cmd.Flags().GetString("path")
+ if err != nil {
+ util.HandleError(err, "Unable to parse flag")
+ }
+
+ secrets, err := util.GetAllEnvironmentVariables(models.GetAllSecretsParameters{Environment: environmentName, InfisicalToken: infisicalToken, TagSlugs: tagSlugs, WorkspaceId: projectId, SecretsPath: secretsPath})
if err != nil {
util.HandleError(err, "Unable to fetch secrets")
}
@@ -110,6 +115,7 @@ func init() {
exportCmd.Flags().String("token", "", "Fetch secrets using the Infisical Token")
exportCmd.Flags().StringP("tags", "t", "", "filter secrets by tag slugs")
exportCmd.Flags().String("projectId", "", "manually set the projectId to fetch secrets from")
+ exportCmd.Flags().String("path", "/", "get secrets within a folder path")
}
// Format according to the format flag
diff --git a/docs/cli/commands/export.mdx b/docs/cli/commands/export.mdx
index 59d15ed2f..9ba15c34d 100644
--- a/docs/cli/commands/export.mdx
+++ b/docs/cli/commands/export.mdx
@@ -99,6 +99,15 @@ Export environment variables from the platform into a file format.
Default value: `true`
+
+ The `--path` flag indicates which project folder secrets will be injected from.
+
+ ```bash
+ # Example
+ infisical export --path="/path/to/folder" --env=dev
+ ```
+
+
When working with tags, you can use this flag to filter and retrieve only secrets that are associated with a specific tag(s).
diff --git a/docs/cli/commands/secrets.mdx b/docs/cli/commands/secrets.mdx
index 3b1ccd3fb..a15829d5f 100644
--- a/docs/cli/commands/secrets.mdx
+++ b/docs/cli/commands/secrets.mdx
@@ -51,6 +51,14 @@ This command enables you to perform CRUD (create, read, update, delete) operatio
Default value: `dev`
+
+ The `--path` flag indicates which project folder secrets will be injected from.
+
+ ```bash
+ # Example
+ infisical secrets --path="/" --env=dev
+ ```
+
@@ -90,6 +98,15 @@ $ infisical secrets set STRIPE_API_KEY=sjdgwkeudyjwe DOMAIN=example.com HASH=jeb
Default value: `dev`
+
+ The `--path` flag indicates which project folder secrets will be injected from.
+
+ ```bash
+ # Example
+ infisical secrets set ... --path="/"
+ ```
+
+
@@ -108,6 +125,14 @@ $ infisical secrets set STRIPE_API_KEY=sjdgwkeudyjwe DOMAIN=example.com HASH=jeb
Default value: `dev`
+
+ The `--path` flag indicates which project folder secrets will be injected from.
+
+ ```bash
+ # Example
+ infisical secrets delete ... --path="/"
+ ```
+