func CreateAppCmd(appsAPIService AppsAPIService) *cobra.Command {
	var appmakerCmd = &cobra.Command{
		Use:   "app [FILENAME] [LANGUAGE]",
		Short: "Create an application",
		Args:  cobra.MaximumNArgs(2),
		Run: func(cmd *cobra.Command, args []string) {
			var (
				err         error
				language    string
				application openapi.Application
			)
			if gctltoken == "" {
				gctltoken, err = middlewares.SetToken(client)
				if err != nil {
					cmd.Print(err)
					return
				}
			}
			if len(args) == 2 {
				filename := strings.Split(args[0], ".")[0]
				language = args[1]
				application, err = middlewares.ReadAppJSON(filename)
				if err != nil {
					cmd.Print(err)
					return
				}
			} else {
				language, application = middlewares.AppForm()
			}
			auth := context.WithValue(context.Background(), openapi.ContextAccessToken, gctltoken)
			res, _, err := appsAPIService.CreateApp(auth, language, application)
			if res.Success {
				res, _, err := appsAPIService.FetchAppByUser(auth, application.Name)
				if res.Success {
					for i := 0; i < len(res.Data); i++ {
						cmd.Println("App created successfully "+"\n"+"Container Id: "+res.Data[i].ContainerId,
							"Container Port: ", res.Data[i].ContainerPort, "Docker Image: "+res.Data[i].DockerImage,
							"App Url: "+res.Data[i].AppUrl, "Host Ip: "+res.Data[i].HostIp,
							"Name Servers: ", res.Data[i].NameServers, "Instance Type: "+res.Data[i].InstanceType,
							"Language: "+res.Data[i].Language, "Owner: "+res.Data[i].Owner,
							"Ssh Cmd: "+res.Data[i].SshCmd, "Id: "+res.Data[i].Id)
					}
				} else {
					cmd.Println(err)
				}
			} else {
				cmd.Println(err)
			}
		},
	}
	return appmakerCmd
}
CreateAppCmd is command to create an app
package cmd
import (
	"context"
	_context "context"
	_nethttp "net/http"
	"strconv"
	"strings"
	"github.com/antihax/optional"
	openapi "github.com/sdslabs/gctl/client"
	"github.com/sdslabs/gctl/cmd/middlewares"
	"github.com/spf13/cobra"
)
type AppsAPIService interface {
	CreateApp(ctx _context.Context, language string, application openapi.Application) (openapi.InlineResponse2002, *_nethttp.Response, error)
	DeleteAppByUser(ctx _context.Context, app string) (openapi.InlineResponse2002, *_nethttp.Response, error)
	FetchAppByUser(ctx _context.Context, app string) (openapi.InlineResponse2003, *_nethttp.Response, error)
	FetchAppsByUser(ctx _context.Context) (openapi.InlineResponse2003, *_nethttp.Response, error)
	FetchLogsByUser(ctx _context.Context, app string, localVarOptionals *openapi.FetchLogsByUserOpts) (openapi.InlineResponse2005, *_nethttp.Response, error)
	RebuildAppByUser(ctx _context.Context, app string) (openapi.InlineResponse2002, *_nethttp.Response, error)
	UpdateAppByUser(ctx _context.Context, app string, application openapi.Application) (openapi.InlineResponse2002, *_nethttp.Response, error)
}
var appName string
var appsAPIService AppsAPIService = client.AppsAPI
func init() {
	createCmd.AddCommand(CreateAppCmd(appsAPIService))
	fetchCmd.AddCommand(FetchAppCmd(appsAPIService))
	deleteCmd.AddCommand(DeleteAppCmd(appsAPIService))
	rootCmd.AddCommand(RebuildAppCmd(appsAPIService))
	updateCmd.AddCommand(UpdateAppCmd(appsAPIService))
	fetchCmd.AddCommand(FetchLogsCmd(appsAPIService))
}