Skip to content

docs(): update cli commands #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions content/CLI/cli-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,36 @@ Export `Configs` as configuration data in various modes

```bash
USAGE
$ configu export [--empty] [--explain | --format
$ configu export [--explain | --format
JSON|CompactJSON|YAML|Dotenv|KubernetesConfigMap|HelmValues|TerraformTfvars|TOML | --template <value> | --source |
--run <value>] [--label <value>] [--eol ] [--template-input object|array ]
--run <value>] [--label <value>] [--eol ] [--template-input object|array ] [--prefix <value>] [--suffix <value>]
[--casing CamelCase|CapitalCase|ConstantCase|DotCase|KebabCase|NoCase|PascalCase|PascalSnakeCase|PathCase|SentenceCa
se|SnakeCase|TrainCase] [--pick-label <value>] [--omit-label <value>] [--pick-key <value>] [--omit-key <value>]
[--pick-hidden | --omit-hidden] [--pick-empty | --omit-empty]

FLAGS
--[no-]empty Omits all empty (non-value) from the exported `Configs`
--casing=<option> Transforms the casing of Config Keys in the export result to camelCase, PascalCase, Capital
Case, snake_case, param-case, CONSTANT_CASE and others
<options: CamelCase|CapitalCase|ConstantCase|DotCase|KebabCase|NoCase|PascalCase|PascalSnak
eCase|PathCase|SentenceCase|SnakeCase|TrainCase>
--eol Adds EOL (\n on POSIX \r\n on Windows) to the end of the stdout
--explain Outputs metadata on the exported `Configs`
--format=<option> Format exported `Configs` to common configuration formats. Redirect the output to file, if
needed
<options: JSON|CompactJSON|YAML|Dotenv|KubernetesConfigMap|HelmValues|TerraformTfvars|TOML>
--label=<value> Metadata required in some formats like Kubernetes ConfigMap
--omit-empty Exclude config keys with empty values. By default, empty values are included
--omit-hidden Explicitly exclude config keys marked as hidden. By default, hidden keys are omitted
--omit-key=<value>... Omit a specific key from the previous eval command return to export
--omit-label=<value>... Omit a specific label from the previous eval command return to export
--pick-empty Include config keys with empty values. By default, empty values are included
--pick-hidden Explicitly include config keys marked as hidden. By default, hidden keys are omitted
--pick-key=<value>... Pick a specific key from the previous eval command return to export
--pick-label=<value>... Pick a specific label from the previous eval command return to export
--prefix=<value> Append a fixed string to the beginning of each Config Key in the export result
--run=<value> Spawns executable as child-process and pass exported `Configs` as environment variables
--source Source exported `Configs` as environment variables to the current shell
--suffix=<value> Append a fixed string to the end of each Config Key in the export result
--template=<value> Path to a file containing {{mustache}} templates to render (inject/substitute) the exported
`Configs` into
--template-input=<option> Inject `Configs` to template as object or array of `{key: string, value: string}[]`
Expand Down Expand Up @@ -170,6 +186,30 @@ EXAMPLES
Pipe eval commands result to export command to pass `Configs` as environment variables to a child-process

$ configu eval ... | configu export --run 'node index.js'

Pipe eval commands result to export command and apply a prefix / suffix to each Config Key in the export result

$ configu eval ... | configu export --prefix "MYAPP_" --suffix "_PROD"

Pipe eval commands result to export command and apply casing to each Config Key in the export result

$ configu eval ... | configu export --casing "SnakeCase"

Pipe eval commands result to export command and exclude specific labels

$ configu eval ... | configu export --omit-label 'deprecated' --omit-label 'temporary'

Pipe eval commands result to export command and include only configs under specific labels

$ configu eval ... | configu export --pick-label 'production' --pick-label 'secure'

Pipe eval commands result to export command and exclude specific keys

$ configu eval ... | configu export --omit-key 'DEBUG_MODE' --omit-key 'TEST_ACCOUNT'

Pipe eval commands result to export command. Include hidden configs and exclude configs with empty values

$ configu eval ... | configu export --pick-hidden --omit-empty
```

## configu find
Expand Down