code: func (s *Action) TemplateEdit(ctx context.Context, c *cli.Context) error {
  	name := c.Args().First()
  
  	var content []byte
  	if s.Store.HasTemplate(ctx, name) {
  		var err error
  		content, err = s.Store.GetTemplate(ctx, name)
  		if err != nil {
  			return ExitError(ctx, ExitIO, err, "failed to retrieve template: %s", err)
  		}
  	} else {
  		content = []byte(templateExample)
  	}
  
  	ed := editor.Path(c)
  	nContent, err := editor.Invoke(ctx, ed, content)
  	if err != nil {
  		return ExitError(ctx, ExitUnknown, err, "failed to invoke editor %s: %s", ed, err)
  	}
  
  	// If content is equal, nothing changed, exiting
  	if bytes.Equal(content, nContent) {
  		return nil
  	}
  
  	return s.Store.SetTemplate(ctx, name, nContent)
  }
docs: // TemplateEdit will load and existing or new template into an
  // editor