cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivateLicenseCmd added in v0.2.0

type ActivateLicenseCmd struct {
	Key  string `help:"License key to activate" required:""`
	Name string `help:"Instance name (default: hostname)" default:""`
}

ActivateLicenseCmd activates a license key for this server.

func (*ActivateLicenseCmd) Run added in v0.2.0

func (cmd *ActivateLicenseCmd) Run(globals *Globals, _ platform.CommandRunner, output *ui.UI) error

Run activates a license key.

type BackupCmd added in v0.2.0

type BackupCmd struct{}

BackupCmd backs up world data with rotation.

func (*BackupCmd) Run added in v0.2.0

func (cmd *BackupCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run performs a backup.

type CLI added in v0.2.0

type CLI struct {
	Globals

	Install           InstallCmd           `cmd:"" help:"Install and configure a Minecraft server"`
	Start             StartCmd             `cmd:"" help:"Start the Minecraft server in a screen session"`
	Stop              StopCmd              `cmd:"" help:"Gracefully stop the Minecraft server"`
	Status            StatusCmd            `cmd:"" help:"Show server status and resource usage"`
	Backup            BackupCmd            `cmd:"" help:"Backup world data with rotation"`
	SetupParkour      SetupParkourCmd      `cmd:"setup-parkour" help:"Set up parkour world (first-time setup)"`
	RotateParkour     RotateParkourCmd     `cmd:"rotate-parkour" help:"Rotate the featured parkour map"`
	VoteMap           VoteMapCmd           `cmd:"vote-map" help:"Start a map vote (CS:GO style)"`
	ValidateLicense   ValidateLicenseCmd   `cmd:"validate-license" help:"Validate your license key"`
	ActivateLicense   ActivateLicenseCmd   `cmd:"activate-license" help:"Activate a license key for this server"`
	DeactivateLicense DeactivateLicenseCmd `cmd:"deactivate-license" help:"Deactivate the license for this server"`
}

CLI is the top-level command tree parsed by Kong.

type DeactivateLicenseCmd added in v0.2.0

type DeactivateLicenseCmd struct{}

DeactivateLicenseCmd deactivates the license for this server.

func (*DeactivateLicenseCmd) Run added in v0.2.0

func (cmd *DeactivateLicenseCmd) Run(globals *Globals, _ platform.CommandRunner, output *ui.UI) error

Run deactivates the license.

type Globals added in v0.2.0

type Globals struct {
	Dir     string           `help:"Server directory (default: ~/minecraft-server)" default:""`
	Session string           `help:"Screen session name" default:"minecraft"`
	Version kong.VersionFlag `help:"Print version" short:"v" hidden:""`
}

Globals holds flags shared by all subcommands.

func (*Globals) AfterApply added in v0.2.0

func (g *Globals) AfterApply() error

AfterApply sets Dir to ~/minecraft-server when the user hasn't provided one.

type InstallCmd added in v0.2.0

type InstallCmd struct {
	Edition    string `help:"Server edition" default:"java" enum:"java,bedrock"`
	Port       int    `help:"Server port" default:"25565"`
	Memory     string `help:"RAM allocation (e.g., 2G, 4G)" default:"2G"`
	Type       string `help:"Server type" default:"paper" enum:"paper,fabric,vanilla" name:"type"`
	MOTD       string `help:"Message of the day" default:"Dads Minecraft Server" name:"motd"`
	Players    int    `help:"Max players" default:"20" name:"players"`
	Difficulty string `help:"Difficulty" default:"normal" enum:"peaceful,easy,normal,hard"`
	Gamemode   string `help:"Game mode" default:"survival" enum:"survival,creative,adventure" name:"gamemode"`
	GC         string `help:"Garbage collector" default:"g1gc" enum:"g1gc,zgc,G1GC,ZGC" name:"gc"`
	Whitelist  bool   `help:"Enable whitelist" default:"true" negatable:""`
	ChatFilter bool   `help:"Install chat filter plugin" default:"true" name:"chat-filter" negatable:""`
	Playit     bool   `help:"Set up playit.gg tunnel" default:"true" negatable:""`
	MCVersion  string `help:"Minecraft version" default:"latest" name:"mc-version"`
}

InstallCmd installs and configures a Minecraft server.

func (*InstallCmd) Run added in v0.2.0

func (cmd *InstallCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run installs and configures a Minecraft server.

type RotateParkourCmd added in v0.2.0

type RotateParkourCmd struct{}

RotateParkourCmd rotates the featured parkour map.

func (*RotateParkourCmd) Run added in v0.2.0

func (cmd *RotateParkourCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run rotates the featured parkour map.

type SetupParkourCmd added in v0.2.0

type SetupParkourCmd struct{}

SetupParkourCmd sets up the parkour world (first-time setup).

func (*SetupParkourCmd) Run added in v0.2.0

func (cmd *SetupParkourCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run sets up the parkour world.

type StartCmd added in v0.2.0

type StartCmd struct{}

StartCmd starts the Minecraft server in a screen session.

func (*StartCmd) Run added in v0.2.0

func (cmd *StartCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run starts the server.

type StatusCmd added in v0.2.0

type StatusCmd struct{}

StatusCmd shows server status and resource usage.

func (*StatusCmd) Run added in v0.2.0

func (cmd *StatusCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run shows server status.

type StopCmd added in v0.2.0

type StopCmd struct{}

StopCmd gracefully stops the Minecraft server.

func (*StopCmd) Run added in v0.2.0

func (cmd *StopCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run stops the server.

type ValidateLicenseCmd added in v0.2.0

type ValidateLicenseCmd struct {
	Key string `help:"License key to validate" default:""`
}

ValidateLicenseCmd validates a license key.

func (*ValidateLicenseCmd) Run added in v0.2.0

func (cmd *ValidateLicenseCmd) Run(globals *Globals, _ platform.CommandRunner, output *ui.UI) error

Run validates a license key.

type VoteMapCmd added in v0.2.0

type VoteMapCmd struct {
	Duration int `help:"Vote duration in seconds" default:"30"`
	Choices  int `help:"Number of maps to vote on" default:"5" name:"choices"`
}

VoteMapCmd starts a map vote (CS:GO style).

func (*VoteMapCmd) Run added in v0.2.0

func (cmd *VoteMapCmd) Run(globals *Globals, runner platform.CommandRunner, output *ui.UI) error

Run starts a map vote.

Jump to

Keyboard shortcuts

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