cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 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.

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) 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) RunInputCommand

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

RunInputCommand runs an input command.

func (*CommandExecutor) RunMouseCommand

func (e *CommandExecutor) RunMouseCommand(action string, x, y int, button string, durationTicks int64) 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, 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) RunWheelCommand

func (e *CommandExecutor) RunWheelCommand(x, y float64) 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