docs: def init_config(cls):
          """ Initialize Gandi CLI configuration.
  
          Create global configuration directory with API credentials
  
          """
          try:
              # first load current conf and only overwrite needed params
              # we don't want to reset everything
              config_file = os.path.expanduser(cls.home_config)
              config = cls.load(config_file, 'global')
              cls._del('global', 'api.env')
  
              hidden_apikey = '%s...' % cls.get('api.key', '')[:6]
              apikey = click.prompt('Api key (xmlrpc)',
                                    default=hidden_apikey)
              if apikey == hidden_apikey:
                  # if default value then use actual value not hidden one
                  apikey = cls.get('api.key')
              env_choice = click.Choice(list(cls.apienvs.keys()))
              apienv = click.prompt('Environnment [production]/ote',
                                    default=cls.default_apienv,
                                    type=env_choice,
                                    show_default=False)
              sshkey = click.prompt('SSH keyfile',
                                    default='~/.ssh/id_rsa.pub')
              hidden_apikeyrest = '%s...' % cls.get('apirest.key', '')[:6]
              apikeyrest = click.prompt('Api key (REST)',
                                        default=hidden_apikeyrest)
              if apikeyrest == hidden_apikeyrest:
                  # if default value then use actual value not hidden one
                  apikeyrest = cls.get('apirest.key')
  
              config.update({
                  'api': {'key': apikey,
                          'host': cls.apienvs[apienv]},
              })
              if apikeyrest:
                  config.update({
                      'apirest': {'key': apikeyrest},
                  })
  
              if sshkey is not None:
                  sshkey_file = os.path.expanduser(sshkey)
                  if os.path.exists(sshkey_file):
                      config['sshkey'] = [sshkey_file]
  
              directory = os.path.expanduser(os.path.dirname(config_file))
              if not os.path.exists(directory):
                  mkpath(directory, 0o700)
  
              # save to disk
              cls.save(config_file, config)
              # load in memory
              cls.load(config_file, 'global')
          except (KeyboardInterrupt, click.exceptions.Abort):
              cls.echo('Aborted.')
              sys.exit(1)