code: function(key, cb) {
  
    // ensure the plugin is loaded if registration succeeds
    var success = function() {
      shared.plugin_manager.force_enable('control-panel', function(err) {
        cb();
      });
    }
  
    // set API key and clear Device key
    shared.keys.set_api_key(key, function(err) {
      if (err) return cb(err);
  
      log('Linking device...');
      shared.panel.link(function(err) {
        if (!err) return success();
  
        // ok, we got an error. clear the API key before returning.
        // call back the original error as well.
        shared.keys.set_api_key('', function(e) {
          cb(err);
        });
      });
    })
  }
docs: set api key and call setup so device gets linked called from cli.js after signing up or signing in