client

package
v1.0.40 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attach

func Attach(sockPath string, name string, create bool, pfxKey byte) error

Attach connects to the server, sends an attach or new-session command, and pipes the terminal with prefix key interception. pfxKey is the prefix key byte (0 = default Ctrl-]).

func AuthAdd added in v1.0.1

func AuthAdd(key string) error

AuthAdd adds a public key to ~/.latch/authorized_keys. key can be a path to a file or an inline key string.

func AuthList added in v1.0.1

func AuthList() error

AuthList prints the keys in ~/.latch/authorized_keys.

func AuthRemove added in v1.0.1

func AuthRemove(match string) error

AuthRemove removes a key from ~/.latch/authorized_keys by fingerprint or comment.

func EnableSSH

func EnableSSH(sockPath, addr string) error

EnableSSH tells the running daemon to start the SSH listener.

func EnableWeb

func EnableWeb(sockPath, addr string) error

EnableWeb tells the running daemon to start the web listener.

func Kill

func Kill(sockPath string, name string) error

Kill sends a kill command.

func List

func List(sockPath string) error

List sends a list command and prints sessions.

func OnResize

func OnResize(fn func(cols, rows uint16)) func()

OnResize calls fn on terminal resize. Returns a stop function.

func ReadScreen added in v1.0.29

func ReadScreen(sockPath, session string) (string, error)

ReadScreen returns the plain text content of a session's screen.

func RelayAdd

func RelayAdd(configPath string) error

RelayAdd adds this device to an existing relay account. Sends an approval email — the user clicks the link, and the CLI detects it automatically.

func RelayCancel added in v1.0.1

func RelayCancel(configPath string) error

RelayCancel cancels the relay subscription.

func RelayChangeEmail added in v1.0.1

func RelayChangeEmail(configPath string) error

RelayChangeEmail changes the email on the relay account.

func RelayDeleteAccount added in v1.0.1

func RelayDeleteAccount(configPath string) error

RelayDeleteAccount permanently deletes the relay account.

func RelayDisable

func RelayDisable(configPath string) error

RelayDisable sets relay-enabled = false in the config file.

func RelayEnable

func RelayEnable(configPath string) error

RelayEnable sets relay-enabled = true in the config file.

func RelayKeys

func RelayKeys(configPath string) error

RelayKeys lists devices and keys on the account.

func RelayRegister

func RelayRegister(configPath string) error

RelayRegister creates a new relay account: generates a key, calls the API, and the server emails the payment link.

func RelayRevoke

func RelayRevoke(configPath string) error

RelayRevoke revokes a device's key from the account.

func RelayRotateKey

func RelayRotateKey(configPath string) error

RelayRotateKey generates a new relay key and rotates it via the API.

func RelaySSHConfig

func RelaySSHConfig(configPath string) error

RelaySSHConfig prints an SSH config snippet for connecting through the relay.

func RelaySessions

func RelaySessions(configPath string) error

RelaySessions lists currently connected devices.

func RelayStatus

func RelayStatus(configPath string) error

RelayStatus prints the current relay configuration.

func SendInput added in v1.0.29

func SendInput(sockPath, session, text string) error

SendInput injects text into a named session's PTY.

func ShellsCreate added in v1.0.13

func ShellsCreate(cfgPath string) error

ShellsCreate creates a new shell.

func ShellsDestroy added in v1.0.13

func ShellsDestroy(cfgPath, nameOrID string) error

ShellsDestroy initiates shell destruction (sends verification email).

func ShellsExec added in v1.0.29

func ShellsExec(cfgPath, nameOrID, command string) error

ShellsExec runs a command on a shell via the server API.

func ShellsKeyAdd added in v1.0.13

func ShellsKeyAdd(cfgPath, nameOrID, keyFile string) error

ShellsKeyAdd adds an SSH key to a shell (sends verification email).

func ShellsKeyList added in v1.0.13

func ShellsKeyList(cfgPath, nameOrID string) error

ShellsKeyList lists SSH keys on a shell.

func ShellsList added in v1.0.13

func ShellsList(cfgPath string) error

ShellsList lists the user's shells.

func ShellsRestart added in v1.0.13

func ShellsRestart(cfgPath, nameOrID string) error

ShellsRestart initiates shell restart (sends verification email).

func ShellsSSH added in v1.0.13

func ShellsSSH(cfgPath, nameOrID string) error

ShellsSSH connects to a shell via SSH through the relay.

func ShellsScreen added in v1.0.29

func ShellsScreen(cfgPath, nameOrID string) error

ShellsScreen reads the terminal screen from a shell via the server API.

func ShellsSend added in v1.0.29

func ShellsSend(cfgPath, nameOrID, text string) error

ShellsSend injects text into a session on a shell via the server API.

Types

type RawTerminal

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

func EnterRawMode

func EnterRawMode() (*RawTerminal, error)

func (*RawTerminal) Restore

func (r *RawTerminal) Restore()

func (*RawTerminal) Size

func (r *RawTerminal) Size() (cols, rows uint16, err error)

Jump to

Keyboard shortcuts

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