cli

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureTargetPID

func EnsureTargetPID() error

EnsureTargetPID auto-detects the game PID if not already set.

func GenerateSchema added in v0.3.0

func GenerateSchema() ([]byte, error)

GenerateSchema generates a JSON Schema from the Go structs.

func PrintSchema added in v0.3.0

func PrintSchema() error

PrintSchema prints the JSON schema to stdout.

Types

type CommandExecutor

type CommandExecutor struct {
	// contains filtered or unexported fields
}

CommandExecutor executes CLI commands via RPC.

func NewCommandExecutor

func NewCommandExecutor() *CommandExecutor

NewCommandExecutor creates a new CommandExecutor.

func (*CommandExecutor) ListCustomCommands added in v0.3.0

func (e *CommandExecutor) ListCustomCommands() error

ListCustomCommands lists all registered custom commands.

func (*CommandExecutor) ListKeysCommand

func (e *CommandExecutor) ListKeysCommand() error

ListKeysCommand lists all available key names.

func (*CommandExecutor) ListMouseButtonsCommand

func (e *CommandExecutor) ListMouseButtonsCommand() error

ListMouseButtonsCommand lists all available mouse button names.

func (*CommandExecutor) RunCustomCommand added in v0.3.0

func (e *CommandExecutor) RunCustomCommand(name, request string) error

RunCustomCommand runs a custom command.

func (*CommandExecutor) RunGetMousePositionCommand added in v0.3.0

func (e *CommandExecutor) RunGetMousePositionCommand() error

RunGetMousePositionCommand runs a get_mouse_position command.

func (*CommandExecutor) RunGetWheelPositionCommand added in v0.3.0

func (e *CommandExecutor) RunGetWheelPositionCommand() error

RunGetWheelPositionCommand runs a get_wheel_position command.

func (*CommandExecutor) RunInputCommand

func (e *CommandExecutor) RunInputCommand(key, action string, durationTicks int64, async bool) error

RunInputCommand runs an input command.

func (*CommandExecutor) RunMouseCommand

func (e *CommandExecutor) RunMouseCommand(action string, x, y int, button string, durationTicks int64, async bool) error

RunMouseCommand runs a mouse command.

func (*CommandExecutor) RunPingCommand

func (e *CommandExecutor) RunPingCommand() error

RunPingCommand runs a ping command to check connection.

func (*CommandExecutor) RunScreenshotCommand

func (e *CommandExecutor) RunScreenshotCommand(output string, b64 bool, async bool) error

RunScreenshotCommand runs a screenshot command.

func (*CommandExecutor) RunScriptCommand

func (e *CommandExecutor) RunScriptCommand(input string, isFile bool) error

RunScriptCommand runs a script from a file path or inline JSON string.

func (*CommandExecutor) RunVersionCommand added in v0.4.0

func (e *CommandExecutor) RunVersionCommand() error

RunVersionCommand runs the version command. Shows CLI version and attempts to get game version via ping.

func (*CommandExecutor) RunWheelCommand

func (e *CommandExecutor) RunWheelCommand(x, y float64, async bool) error

RunWheelCommand runs a wheel command.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer handles CLI output formatting.

func NewWriter

func NewWriter() *Writer

NewWriter creates a new Writer.

func (*Writer) Errorln

func (w *Writer) Errorln(a ...any)

Errorln prints an error line to stderr.

func (*Writer) ExitWithError

func (w *Writer) ExitWithError(message string)

ExitWithError prints an error and exits with code 1.

func (*Writer) Failure

func (w *Writer) Failure(message string)

Failure prints a failure message.

func (*Writer) PrintJSON

func (w *Writer) PrintJSON(v any) error

PrintJSON prints a value as JSON.

func (*Writer) Println

func (w *Writer) Println(a ...any)

Println prints a line.

func (*Writer) Success

func (w *Writer) Success(message string)

Success prints a success message.

Jump to

Keyboard shortcuts

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