mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
add path to export command
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -99,6 +99,15 @@ Export environment variables from the platform into a file format.
|
||||
Default value: `true`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="--path">
|
||||
The `--path` flag indicates which project folder secrets will be injected from.
|
||||
|
||||
```bash
|
||||
# Example
|
||||
infisical export --path="/path/to/folder" --env=dev
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="--tags">
|
||||
When working with tags, you can use this flag to filter and retrieve only secrets that are associated with a specific tag(s).
|
||||
|
||||
|
||||
@@ -51,6 +51,14 @@ This command enables you to perform CRUD (create, read, update, delete) operatio
|
||||
|
||||
Default value: `dev`
|
||||
</Accordion>
|
||||
<Accordion title="--path">
|
||||
The `--path` flag indicates which project folder secrets will be injected from.
|
||||
|
||||
```bash
|
||||
# Example
|
||||
infisical secrets --path="/" --env=dev
|
||||
```
|
||||
</Accordion>
|
||||
|
||||
</Accordion>
|
||||
|
||||
@@ -90,6 +98,15 @@ $ infisical secrets set STRIPE_API_KEY=sjdgwkeudyjwe DOMAIN=example.com HASH=jeb
|
||||
|
||||
Default value: `dev`
|
||||
</Accordion>
|
||||
<Accordion title="--path">
|
||||
The `--path` flag indicates which project folder secrets will be injected from.
|
||||
|
||||
```bash
|
||||
# Example
|
||||
infisical secrets set <key1=value1> <key2=value2>... --path="/"
|
||||
```
|
||||
|
||||
</Accordion>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="infisical secrets delete">
|
||||
@@ -108,6 +125,14 @@ $ infisical secrets set STRIPE_API_KEY=sjdgwkeudyjwe DOMAIN=example.com HASH=jeb
|
||||
|
||||
Default value: `dev`
|
||||
</Accordion>
|
||||
<Accordion title="--path">
|
||||
The `--path` flag indicates which project folder secrets will be injected from.
|
||||
|
||||
```bash
|
||||
# Example
|
||||
infisical secrets delete <keyName1> <keyName2>... --path="/"
|
||||
```
|
||||
</Accordion>
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="infisical secrets generate-example-env">
|
||||
|
||||
Reference in New Issue
Block a user