code: def setup_shiny():
      '''Manage a Shiny instance.'''
  
      name = 'shiny'
      def _get_shiny_cmd(port):
          conf = dedent().format(
              user=getpass.getuser(),
              port=str(port),
              site_dir=os.getcwd()
          )
  
          f = tempfile.NamedTemporaryFile(mode='w', delete=False)
          f.write(conf)
          f.close()
          return ['shiny-server', f.name]
  
      return {
          'command': _get_shiny_cmd,
          'launcher_entry': {
              'title': 'Shiny',
              'icon_path': os.path.join(os.path.dirname(os.path.abspath(__file__)), 'icons', 'shiny.svg')
          }
      }
docs: Manage a Shiny instance.