Skip to content

2.0.1

Compare
Choose a tag to compare
@shazron shazron released this 01 Aug 03:52
· 326 commits to master since this release

INSTALLATION

In your terminal, type:
npm install @adobe/aio-cli

WHAT'S NEW

  • local configuration file support ($CWD/.aio file)
# This a HJSON/JSON file named ".aio"
# This file is read from your current working directory (a.k.a $CWD)

$ cat .aio
{
   foo: bar
   mykey: myvalue
}

# now when your command is run, your config will have
console.log(config['foo']) // will print 'bar'
console.log(config['mykey']) // will print 'myvalue'
  • environmental variable file support ($CWD/.env file)
# This a properties file named ".env", the keys and values will be added to `process.env`
# This file is read from your current working directory (a.k.a $CWD)

$ cat .env
foo=bar
mykey=myvalue

# now when your command is run, process.env will have
console.log(process.env['foo']) // will print 'bar'
console.log(process.env['mykey']) // will print 'myvalue'
  • AIO_ prefixed environmental variable support: these variables will be added to your config at runtime
$ cat .env
AIO_mykey_mysubkey=myvalue
# for keys with underscores, use double underscores
AIO_akey_sub__key=avalue

# now when your command is run, your config will have
console.log(config['mykey.mysubkey']) // will print 'myvalue'
console.log(config['akey.sub_key']) // will print 'avalue'

# you can also prefix your command on unix-y systems with the key
AIO_mykey_mysubkey=myvalue aio console:list-integrations
  • HJSON "human json" format support for configuration files:

    • object names don't have to be quoted
    • comments are allowed (block, single line etc)
    • multi-line strings are allowed
    • omit commas at the end of lines
    • trailing commas are allowed at the end of lists
  • If you want to specify the location of the global configuration file, you can do so via environment variables (in order of precedence):

    • AIO_CONFIG_FILE
      if you set AIO_CONFIG_FILE=/my/global/folder/config.json to a file location, the CLI will load /my/global/folder/config.json as the global configuration
    • XDG_CONFIG_HOME
      if you set XDG_CONFIG_HOME=/my/global/folder to a a folder location, the cli will load the aio file from that folder, e.g. /my/global/folder/aio, as the global configuration
    • $HOME/.config/aio
      This is the default file location for your global configuration. $HOME is the current user's home folder
  • The configuration is merged from the .env, local, and global configuration file locations. The precedence of the configuration values are:

    • .env file
    • local configuration file (.aio)
    • global configuration file

BREAKING CHANGES AND NEW FEATURES

  1. Config Plugin
  2. Jwt-Auth Plugin
  3. Console Plugin