launchcodedev / app-config

Easy Configuration Loader with Strict Validation
https://app-config.dev
Mozilla Public License 2.0
68 stars 11 forks source link

Add support for a CLI ConfigSource #43

Open joelgallant opened 3 years ago

joelgallant commented 3 years ago

A common thread in config libraries in other ecosystems is the ability to use CLI args as an augmentation / override. I think supporting a simple set of CLI flag types is basically in-line with app config. This may make sense as a separate NPM package, however. I'm fairly convinced that encryption and others will end up as separate packages at some point anyway.

joelgallant commented 3 years ago

Simple pseudo-code from prototyping:

# this would merge all properties from CLI yargs parsed object
$yargs: true

# this would pull --foo=... option
$yargs: foo

Maybe $loadYargs like #142.

pats commented 1 year ago

Great idea! +1