cli

package
v0.0.0-...-2efa35c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TEMPLATES = []TemplateInfo{
	{
		Name:    "React Lua",
		RepoUrl: "https://github.com/blue-monads/potato-app-react-lua-template",
		Slug:    "potato-app-react-lua-template",
	},
	{
		Name:    "Vanilla Lua",
		RepoUrl: "https://github.com/blue-monads/potato-app-vannilla-lua-template",
		Slug:    "potato-app-vannilla-lua-template",
	},
}

Functions

func GetExtraCommand

func GetExtraCommand(name string) func(args []string) error

func PackageFiles

func PackageFiles(potatoYamlFile string, outputZipFile string) (string, error)

func PushPackage

func PushPackage(potatoYamlFile string, outputZipFile string) error

func RegisterExtraCommand

func RegisterExtraCommand(name string, runner func(args []string) error)

func Run

func Run()

func RunBuildCommand

func RunBuildCommand(potatoYamlFile string) error

func RunServerStartCommand

func RunServerStartCommand(config string, autoSeed bool) error

Types

type CLI

type CLI struct {
	Server     ServerCmd     `cmd:"" help:"Server management commands."`
	Package    PackageCmd    `cmd:"" help:"Package management commands."`
	Operations OperationsCmd `cmd:"" help:"Backup and restore operations."`
	Dev        DevCmd        `cmd:"" help:"Development utilities."`
	Extra      ExtraCmd      `cmd:"" help:"Extra commands."`
	Skills     SkillsCmd     `cmd:"" help:"Skills management commands."`
	Verbose    bool          `name:"verbose" short:"v" help:"Enable verbose output."`
}

type DevCmd

type DevCmd struct {
	Push DevPushCmd `cmd:"" help:"Push development changes."`
}

type DevPushCmd

type DevPushCmd struct {
	Target string `arg:"" help:"Push target."`
}

func (*DevPushCmd) Run

func (c *DevPushCmd) Run(ctx *kong.Context) error

type DevRunStatelessCmd

type DevRunStatelessCmd struct {
	Port int    `name:"port" short:"p" help:"Server port." default:"7777"`
	Host string `name:"host" help:"Server host." default:"*.localhost"`
}

func (*DevRunStatelessCmd) Run

func (c *DevRunStatelessCmd) Run(ctx *kong.Context) error

type ExtraCmd

type ExtraCmd struct {
	CombinedArgs []string `arg:"" passthrough:"partial" help:"Extra command and its arguments."`
	Command      string
	Args         []string
}

func (*ExtraCmd) Run

func (e *ExtraCmd) Run(ctx *kong.Context) error

type OperationsBackupCmd

type OperationsBackupCmd struct {
	Output string `name:"output" short:"o" help:"Backup output path." type:"path"`
}

func (*OperationsBackupCmd) Run

func (c *OperationsBackupCmd) Run(ctx *kong.Context) error

type OperationsCmd

type OperationsCmd struct {
	Backup  OperationsBackupCmd  `cmd:"" help:"Backup the database and files."`
	Restore OperationsRestoreCmd `cmd:"" help:"Restore from a backup."`
}

type OperationsRestoreCmd

type OperationsRestoreCmd struct {
	Input string `arg:"" help:"Backup file to restore from." type:"path"`
	Force bool   `name:"force" short:"f" help:"Force restore without confirmation."`
}

func (*OperationsRestoreCmd) Run

func (c *OperationsRestoreCmd) Run(ctx *kong.Context) error

type PackageBuildCmd

type PackageBuildCmd struct {
	PotatoYamlFile string `name:"potato-yaml-file" help:"Path to potato manifest file." type:"path" default:"./potato.yaml"`
	OutputZipFile  string `name:"output-zip-file" help:"Output path for built package." type:"path"`
}

func (*PackageBuildCmd) Run

func (c *PackageBuildCmd) Run(_ *kong.Context) error

type PackageCmd

type PackageCmd struct {
	Init  PackageInitCmd  `cmd:"" help:"Initialize a new project from a template."`
	Build PackageBuildCmd `cmd:"" help:"Build the package."`
	Push  PackagePushCmd  `cmd:"" help:"Push the package."`
}

type PackageInitCmd

type PackageInitCmd struct {
	Template  string `name:"template" help:"Template slug or name to use. If omitted, choose interactively."`
	Slug      string `name:"slug" help:"Project slug (letters, digits and hyphens only). If omitted, prompt interactively."`
	Directory string `name:"directory" short:"d" help:"Destination directory for new project." type:"path" default:"."`
}

func (*PackageInitCmd) Run

func (c *PackageInitCmd) Run(_ *kong.Context) error

type PackagePushCmd

type PackagePushCmd struct {
	PotatoYamlFile string `name:"potato-yaml-file" help:"Path to potato manifest file." type:"path" default:"./potato.yaml"`
	OutputZipFile  string `name:"output-zip-file" help:"Output path for built package." type:"path"`
}

func (*PackagePushCmd) Run

func (c *PackagePushCmd) Run(_ *kong.Context) error

type ServerActualStartCmd

type ServerActualStartCmd struct {
	Config   string `name:"config" short:"c" help:"Path to configuration file." type:"path" default:"./config.yaml"`
	AutoSeed bool   `name:"auto-seed" short:"s" help:"Auto seed the server." default:"false"`
}

func (*ServerActualStartCmd) Run

func (c *ServerActualStartCmd) Run(ctx *kong.Context) error

type ServerCmd

type ServerCmd struct {
	InitAndStart ServerInitCmd        `cmd:"" help:"Initialize the server with default options and start the server."`
	Init         ServerInitCmd        `cmd:"" help:"Initialize the server with default options."`
	Start        ServerStartCmd       `cmd:"" help:"Start the server."`
	Stop         ServerStopCmd        `cmd:"" help:"Stop the server."`
	ActualStart  ServerActualStartCmd `cmd:"" help:"Actual start the server, called internally by the server start command."`
}

type ServerInitCmd

type ServerInitCmd struct {
	DBFile          string `name:"db" help:"Path to database file." default:"data.db"`
	Port            int    `name:"port" short:"p" help:"Server port." default:"7777"`
	Host            string `name:"host" help:"Server host." default:"*.localhost"`
	Name            string `name:"name" help:"Name of node." default:"PotatoVerse"`
	SocketFile      string `name:"socket-file" help:"Socket file of node."`
	MasterSecret    string `name:"master-secret" help:"Master secret of node."`
	MasterSecretEnv string `name:"master-secret-env" help:"Master secret environment variable of node."`
	Debug           bool   `name:"debug" help:"Debug mode of node." default:"false"`
	WorkingDir      string `name:"working-dir" help:"Working dir of node."`
	Force           bool   `name:"force" short:"f" help:"Force initialization even if server is already initialized."`
}

func (*ServerInitCmd) Run

func (c *ServerInitCmd) Run(ctx *kong.Context) error

type ServerStartCmd

type ServerStartCmd struct {
	Config   string `name:"config" short:"c" help:"Path to configuration file." type:"path" default:"./config.yaml"`
	AutoSeed bool   `name:"auto-seed" short:"s" help:"Auto seed the server." default:"false"`
}

func (*ServerStartCmd) Run

func (c *ServerStartCmd) Run(ctx *kong.Context) error

type ServerStopCmd

type ServerStopCmd struct {
	Force bool `name:"force" short:"f" help:"Force stop the server."`
}

func (*ServerStopCmd) Run

func (c *ServerStopCmd) Run(ctx *kong.Context) error

type SingletonCmd

type SingletonCmd struct {
	Start SingletonStartCmd `cmd:"" help:"Start the singleton."`
}

type SingletonStartCmd

type SingletonStartCmd struct {
	Port           int    `name:"port" short:"p" help:"Server port." default:"7777"`
	PackageOutPath string `name:"package-out-path" short:"pop" help:"Package output path." default:"./.single"`
}

type SkillsCmd

type SkillsCmd struct {
	List   SkillsListCmd   `cmd:"" help:"List available skills."`
	Show   SkillsShowCmd   `cmd:"" help:"Show skill file content."`
	Export SkillsExportCmd `cmd:"" help:"Export all skills to local directory."`
}

type SkillsExportCmd

type SkillsExportCmd struct {
	Dest string `arg:"" help:"Destination directory." default:"."`
}

func (*SkillsExportCmd) Run

func (c *SkillsExportCmd) Run() error

type SkillsListCmd

type SkillsListCmd struct{}

func (*SkillsListCmd) Run

func (c *SkillsListCmd) Run() error

type SkillsShowCmd

type SkillsShowCmd struct {
	Path string `arg:"" help:"Path to the file to show (relative to skills root)."`
}

func (*SkillsShowCmd) Run

func (c *SkillsShowCmd) Run() error

type TemplateInfo

type TemplateInfo struct {
	Name    string
	RepoUrl string
	Slug    string
}

Directories

Path Synopsis
extra

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL