code: def command_convert(config):
      
  
      _, ext = os.path.splitext(config)
      if 'json' in ext:
          if click.confirm('convert to <%s> to yaml?' % config):
              configparser = kaptan.Kaptan()
              configparser.import_config(config)
              newfile = config.replace(ext, '.yaml')
              newconfig = configparser.export('yaml', indent=2, default_flow_style=False)
              if click.confirm('Save config to %s?' % newfile):
                  buf = open(newfile, 'w')
                  buf.write(newconfig)
                  buf.close()
                  print('New config saved to %s' % newfile)
      elif 'yaml' in ext:
          if click.confirm('convert to <%s> to json?' % config):
              configparser = kaptan.Kaptan()
              configparser.import_config(config)
              newfile = config.replace(ext, '.json')
              newconfig = configparser.export('json', indent=2)
              print(newconfig)
              if click.confirm('Save config to <%s>?' % newfile):
                  buf = open(newfile, 'w')
                  buf.write(newconfig)
                  buf.close()
                  print('New config saved to <%s>.' % newfile)
docs: Convert a tmuxp config between JSON and YAML.