configu export
fetch Configs as configuration data on-demand and in multiple output modes.
configu export [flags]
Flags
--store <label|cs>
(required) the ConfigStore to fetch Configs from.--set <hierarchy>
(required) the ConfigSet to fetch Configs from. use an empty string for the root set.--schema <path/to/cfgu/file>
(required) (multiple) path for a ConfigSchema file to operate the export against. the keys declared in the schema will be fetched from the store. in case of key duplication from mutliple schemas, the order of the schema will come to hand as the rightmost key overriding the rest.
Output-Mode Flags
--format <option>
configuration format to apply on the exported Configs. runconfigu export --help
to see all options. redirect the output to file, if needed.--template <path/to/file/contains/mustache/templates>
path to a file containnig mustache templates to render (inject/subtitute) the exported Configs into.--template-input <object|array>
inject configurations to template as object or array of{key: '', value: ''}[]
.
--sync <option>
3rd party runtime environment to sync the exported Configs to. runconfigu export --help
to see all options. provide neccery credentials using their dedicated flags to connect the runtime.--source
source exported Configs as environment variables to the current shell.(set -a; source <(configu export ... --source); set +a && <command-that-uses-the-envs>)
Examples
# export Configs in json format from the root set of a store with label "my-store" using a schema file at ./config/schema.cfgu.json
configu export --store my-store --set '' --schema ./config/schema.cfgu.json --format JSON
# export Configs in dotenv format from a set called "prod" within a store with label "my-store" using a schema file at ./config/schema.cfgu.json and save the output to a file called ".env"
configu export --store my-store --set 'prod' --schema ./config/schema.cfgu.json --format Dotenv > .env
# export Configs from a set called "prod" within a store with label "my-store" using a schema file at ./config/schema.cfgu.json and inject them into a template file called "config.tmpl"
configu export --store my-store --set 'prod' --schema ./config/schema.cfgu.json --template config.tmpl
# export Configs from a set called "prod" within a store with label "my-store" using a schema file at ./config/schema.cfgu.json and inject them into a template file called "config.tmpl" as an array
configu export --store my-store --set 'prod' --schema ./config/schema.cfgu.json --template config.tmpl --template-input array