lib/utils/autocomplete.js/autocomplete
const autocomplete = () => {
  const servicePath = process.cwd();
  return getServerlessConfigFile({ processedInput: { options: {} }, config: { servicePath } }).then(
    serverlessConfigFile =>
      getCacheFile(servicePath)
        .then(cacheFile => {
          if (!cacheFile || !cacheFileValid(serverlessConfigFile, cacheFile.validationHash)) {
            const serverless = new Serverless();
            return serverless.init().then(() => getCacheFile(servicePath));
          }
          return cacheFile;
        })
        .then(cacheFile => {
          if (!cacheFile || !cacheFileValid(serverlessConfigFile, cacheFile.validationHash)) {
            return null;
          }
          return getSuggestions(cacheFile.commands, require('tabtab').parseEnv(process.env));
        })
  );
};