func Run(ctx *ccli.Context) {
	name := ctx.String("name")
	address := ctx.String("address")
	endpoint := ctx.String("endpoint")
	metadata := make(map[string]string)
	for _, md := range ctx.StringSlice("metadata") {
		parts := strings.Split(md, "=")
		if len(parts) < 2 {
			continue
		}
		key := parts[0]
		val := strings.Join(parts[1:], "=")
		metadata[key] = val
	}
	var opts []service.Option
	if len(metadata) > 0 {
		opts = append(opts, service.Metadata(metadata))
	}
	if len(name) > 0 {
		opts = append(opts, service.Name(name))
	}
	if len(address) > 0 {
		opts = append(opts, service.Address(address))
	}
	if len(endpoint) == 0 {
		endpoint = prox.DefaultEndpoint
	}
	var p prox.Proxy
	switch {
	case strings.HasPrefix(endpoint, "grpc"):
		endpoint = strings.TrimPrefix(endpoint, "grpc://")
		p = grpc.NewProxy(prox.WithEndpoint(endpoint))
	case strings.HasPrefix(endpoint, "http"):
		p = http.NewProxy(prox.WithEndpoint(endpoint))
	case strings.HasPrefix(endpoint, "file"):
		endpoint = strings.TrimPrefix(endpoint, "file://")
		p = file.NewProxy(prox.WithEndpoint(endpoint))
	case strings.HasPrefix(endpoint, "exec"):
		endpoint = strings.TrimPrefix(endpoint, "exec://")
		p = exec.NewProxy(prox.WithEndpoint(endpoint))
	default:
		p = mucp.NewProxy(prox.WithEndpoint(endpoint))
	}
	if ctx.Args().Len() > 0 {
		args := []rt.CreateOption{
			rt.WithCommand(ctx.Args().Slice()...),
			rt.WithOutput(os.Stdout),
		}
		r := rt.DefaultRuntime
		r.Start()
		r.Create(&rt.Service{
			Name: name,
		}, args...)
		defer func() {
			r.Delete(&rt.Service{
				Name: name,
			})
			r.Stop()
		}()
	}
	logger.Infof("Service [%s] Serving %s at endpoint %s\n", p.String(), name, endpoint)
	srv := service.New(opts...)
	srv.Server().Init(
		server.WithRouter(p),
	)
	srv.Run()
}
Run starts a micro service sidecar to encapsulate any app
package service
import (
	"fmt"
	"os"
	"strings"
	"github.com/micro/micro/v3/cmd"
	"github.com/micro/micro/v3/plugin"
	"github.com/micro/micro/v3/service"
	"github.com/micro/micro/v3/service/logger"
	prox "github.com/micro/micro/v3/service/proxy"
	"github.com/micro/micro/v3/service/proxy/grpc"
	"github.com/micro/micro/v3/service/proxy/http"
	"github.com/micro/micro/v3/service/proxy/mucp"
	rt "github.com/micro/micro/v3/service/runtime"
	"github.com/micro/micro/v3/service/server"
	ccli "github.com/urfave/cli/v2"
	api "github.com/micro/micro/v3/service/api/server"
	auth "github.com/micro/micro/v3/service/auth/server"
	broker "github.com/micro/micro/v3/service/broker/server"
	config "github.com/micro/micro/v3/service/config/server"
	events "github.com/micro/micro/v3/service/events/server"
	network "github.com/micro/micro/v3/service/network/server"
	proxy "github.com/micro/micro/v3/service/proxy/server"
	registry "github.com/micro/micro/v3/service/registry/server"
	runtime "github.com/micro/micro/v3/service/runtime/server"
	store "github.com/micro/micro/v3/service/store/server"
	"github.com/micro/micro/v3/cmd/service/handler/exec"
	"github.com/micro/micro/v3/cmd/service/handler/file"
)