code: func (e *Empire) Run(ctx context.Context, opts RunOpts) error {
  	event := opts.Event()
  
  	if err := opts.Validate(e); err != nil {
  		return err
  	}
  
  	if e.RunRecorder != nil && (opts.Stdout != nil || opts.Stderr != nil) {
  		w, err := e.RunRecorder()
  		if err != nil {
  			return err
  		}
  
  		// Add the log url to the event, if there is one.
  		if w, ok := w.(interface {
  			URL() string
  		}); ok {
  			event.URL = w.URL()
  		}
  
  		msg := fmt.Sprintf("Running `%s` on %s as %s", opts.Command, opts.App.Name, opts.User.Name)
  		msg = appendCommitMessage(msg, opts.Message)
  		io.WriteString(w, fmt.Sprintf("%s\n", msg))
  
  		// Write output to both the original output as well as the
  		// record.
  		if opts.Stdout != nil {
  			opts.Stdout = io.MultiWriter(w, opts.Stdout)
  		}
  		if opts.Stderr != nil {
  			opts.Stderr = io.MultiWriter(w, opts.Stderr)
  		}
  	}
  
  	if err := e.PublishEvent(event); err != nil {
  		return err
  	}
  
  	if err := e.runner.Run(ctx, opts); err != nil {
  		return err
  	}
  
  	event.Finish()
  	return e.PublishEvent(event)
  }
docs: // Run runs a one-off process for a given App and command.