attach

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttachCmd = &cobra.Command{
	Use:   "attach",
	Short: "Attach to a running agent",
	Long:  `Attach to a running agent`,
	Run: func(cmd *cobra.Command, args []string) {
		remoteUrl := remoteUrlArg
		if remoteUrl == "" {
			fmt.Fprintln(os.Stderr, "URL is required")
			os.Exit(1)
		}
		if !strings.HasPrefix(remoteUrl, "http") {
			remoteUrl = "http://" + remoteUrl
		}
		remoteUrl = strings.TrimRight(remoteUrl, "/")
		if err := runAttach(remoteUrl); err != nil {
			fmt.Fprintf(os.Stderr, "Attach failed: %+v\n", err)
			os.Exit(1)
		}
	},
}

Functions

func ReadScreenOverHTTP

func ReadScreenOverHTTP(ctx context.Context, url string, ch chan<- httpapi.ScreenUpdateBody) error

func WriteRawInputOverHTTP

func WriteRawInputOverHTTP(ctx context.Context, url string, msg string) error

Types

type ChannelWriter

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

func (*ChannelWriter) Receive

func (c *ChannelWriter) Receive() ([]byte, bool)

func (*ChannelWriter) Write

func (c *ChannelWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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