cmd

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const KernelClientKey contextKey = "kernel_client"

Variables

This section is empty.

Functions

func Execute

func Execute(m Metadata)

Execute executes the root command.

Types

type BoolFlag

type BoolFlag struct {
	Set   bool
	Value bool
}

BoolFlag captures whether a boolean flag was set explicitly and its value.

type BrowserFSService added in v0.5.0

type BrowserFSService interface {
	NewDirectory(ctx context.Context, id string, body kernel.BrowserFNewDirectoryParams, opts ...option.RequestOption) (err error)
	DeleteDirectory(ctx context.Context, id string, body kernel.BrowserFDeleteDirectoryParams, opts ...option.RequestOption) (err error)
	DeleteFile(ctx context.Context, id string, body kernel.BrowserFDeleteFileParams, opts ...option.RequestOption) (err error)
	DownloadDirZip(ctx context.Context, id string, query kernel.BrowserFDownloadDirZipParams, opts ...option.RequestOption) (res *http.Response, err error)
	FileInfo(ctx context.Context, id string, query kernel.BrowserFFileInfoParams, opts ...option.RequestOption) (res *kernel.BrowserFFileInfoResponse, err error)
	ListFiles(ctx context.Context, id string, query kernel.BrowserFListFilesParams, opts ...option.RequestOption) (res *[]kernel.BrowserFListFilesResponse, err error)
	Move(ctx context.Context, id string, body kernel.BrowserFMoveParams, opts ...option.RequestOption) (err error)
	ReadFile(ctx context.Context, id string, query kernel.BrowserFReadFileParams, opts ...option.RequestOption) (res *http.Response, err error)
	SetFilePermissions(ctx context.Context, id string, body kernel.BrowserFSetFilePermissionsParams, opts ...option.RequestOption) (err error)
	Upload(ctx context.Context, id string, body kernel.BrowserFUploadParams, opts ...option.RequestOption) (err error)
	UploadZip(ctx context.Context, id string, body kernel.BrowserFUploadZipParams, opts ...option.RequestOption) (err error)
	WriteFile(ctx context.Context, id string, contents io.Reader, body kernel.BrowserFWriteFileParams, opts ...option.RequestOption) (err error)
}

BrowserFSService defines the subset we use for browser filesystem APIs.

type BrowserLogService added in v0.5.0

type BrowserLogService interface {
	StreamStreaming(ctx context.Context, id string, query kernel.BrowserLogStreamParams, opts ...option.RequestOption) (stream *ssestream.Stream[shared.LogEvent])
}

BrowserLogService defines the subset we use for browser log APIs.

type BrowserProcessService added in v0.5.0

BrowserProcessService defines the subset we use for browser process APIs.

type BrowserReplaysService added in v0.5.0

type BrowserReplaysService interface {
	List(ctx context.Context, id string, opts ...option.RequestOption) (res *[]kernel.BrowserReplayListResponse, err error)
	Download(ctx context.Context, replayID string, query kernel.BrowserReplayDownloadParams, opts ...option.RequestOption) (res *http.Response, err error)
	Start(ctx context.Context, id string, body kernel.BrowserReplayStartParams, opts ...option.RequestOption) (res *kernel.BrowserReplayStartResponse, err error)
	Stop(ctx context.Context, replayID string, body kernel.BrowserReplayStopParams, opts ...option.RequestOption) (err error)
}

BrowserReplaysService defines the subset we use for browser replays.

type BrowsersCmd

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

BrowsersCmd is a cobra-independent command handler for browsers operations.

func (BrowsersCmd) Create

func (BrowsersCmd) Delete

func (BrowsersCmd) FSDeleteDirectory added in v0.5.0

func (b BrowsersCmd) FSDeleteDirectory(ctx context.Context, in BrowsersFSDeleteDirInput) error

func (BrowsersCmd) FSDeleteFile added in v0.5.0

func (b BrowsersCmd) FSDeleteFile(ctx context.Context, in BrowsersFSDeleteFileInput) error

func (BrowsersCmd) FSDownloadDirZip added in v0.5.0

func (b BrowsersCmd) FSDownloadDirZip(ctx context.Context, in BrowsersFSDownloadDirZipInput) error

func (BrowsersCmd) FSFileInfo added in v0.5.0

func (BrowsersCmd) FSListFiles added in v0.5.0

func (b BrowsersCmd) FSListFiles(ctx context.Context, in BrowsersFSListFilesInput) error

func (BrowsersCmd) FSMove added in v0.5.0

func (BrowsersCmd) FSNewDirectory added in v0.5.0

func (b BrowsersCmd) FSNewDirectory(ctx context.Context, in BrowsersFSNewDirInput) error

func (BrowsersCmd) FSReadFile added in v0.5.0

func (BrowsersCmd) FSSetPermissions added in v0.5.0

func (b BrowsersCmd) FSSetPermissions(ctx context.Context, in BrowsersFSSetPermsInput) error

func (BrowsersCmd) FSUpload added in v0.5.0

func (BrowsersCmd) FSUploadZip added in v0.5.0

func (b BrowsersCmd) FSUploadZip(ctx context.Context, in BrowsersFSUploadZipInput) error

func (BrowsersCmd) FSWriteFile added in v0.5.0

func (b BrowsersCmd) FSWriteFile(ctx context.Context, in BrowsersFSWriteFileInput) error

func (BrowsersCmd) List

func (b BrowsersCmd) List(ctx context.Context) error

func (BrowsersCmd) LogsStream added in v0.5.0

func (BrowsersCmd) ProcessExec added in v0.5.0

func (b BrowsersCmd) ProcessExec(ctx context.Context, in BrowsersProcessExecInput) error

func (BrowsersCmd) ProcessKill added in v0.5.0

func (b BrowsersCmd) ProcessKill(ctx context.Context, in BrowsersProcessKillInput) error

func (BrowsersCmd) ProcessSpawn added in v0.5.0

func (b BrowsersCmd) ProcessSpawn(ctx context.Context, in BrowsersProcessSpawnInput) error

func (BrowsersCmd) ProcessStatus added in v0.5.0

func (b BrowsersCmd) ProcessStatus(ctx context.Context, in BrowsersProcessStatusInput) error

func (BrowsersCmd) ProcessStdin added in v0.5.0

func (b BrowsersCmd) ProcessStdin(ctx context.Context, in BrowsersProcessStdinInput) error

func (BrowsersCmd) ProcessStdoutStream added in v0.5.0

func (b BrowsersCmd) ProcessStdoutStream(ctx context.Context, in BrowsersProcessStdoutStreamInput) error

func (BrowsersCmd) ReplaysDownload added in v0.5.0

func (b BrowsersCmd) ReplaysDownload(ctx context.Context, in BrowsersReplaysDownloadInput) error

func (BrowsersCmd) ReplaysList added in v0.5.0

func (b BrowsersCmd) ReplaysList(ctx context.Context, in BrowsersReplaysListInput) error

func (BrowsersCmd) ReplaysStart added in v0.5.0

func (b BrowsersCmd) ReplaysStart(ctx context.Context, in BrowsersReplaysStartInput) error

func (BrowsersCmd) ReplaysStop added in v0.5.0

func (b BrowsersCmd) ReplaysStop(ctx context.Context, in BrowsersReplaysStopInput) error

func (BrowsersCmd) View

type BrowsersCreateInput

type BrowsersCreateInput struct {
	PersistenceID      string
	TimeoutSeconds     int
	Stealth            BoolFlag
	Headless           BoolFlag
	ProfileID          string
	ProfileName        string
	ProfileSaveChanges BoolFlag
}

Inputs for each command

type BrowsersDeleteInput

type BrowsersDeleteInput struct {
	Identifier  string
	SkipConfirm bool
}

type BrowsersFSDeleteDirInput added in v0.5.0

type BrowsersFSDeleteDirInput struct {
	Identifier string
	Path       string
}

type BrowsersFSDeleteFileInput added in v0.5.0

type BrowsersFSDeleteFileInput struct {
	Identifier string
	Path       string
}

type BrowsersFSDownloadDirZipInput added in v0.5.0

type BrowsersFSDownloadDirZipInput struct {
	Identifier string
	Path       string
	Output     string
}

type BrowsersFSFileInfoInput added in v0.5.0

type BrowsersFSFileInfoInput struct {
	Identifier string
	Path       string
}

type BrowsersFSListFilesInput added in v0.5.0

type BrowsersFSListFilesInput struct {
	Identifier string
	Path       string
}

type BrowsersFSMoveInput added in v0.5.0

type BrowsersFSMoveInput struct {
	Identifier string
	SrcPath    string
	DestPath   string
}

type BrowsersFSNewDirInput added in v0.5.0

type BrowsersFSNewDirInput struct {
	Identifier string
	Path       string
	Mode       string
}

FS (minimal scaffolding)

type BrowsersFSReadFileInput added in v0.5.0

type BrowsersFSReadFileInput struct {
	Identifier string
	Path       string
	Output     string
}

type BrowsersFSSetPermsInput added in v0.5.0

type BrowsersFSSetPermsInput struct {
	Identifier string
	Path       string
	Mode       string
	Owner      string
	Group      string
}

type BrowsersFSUploadInput added in v0.5.0

type BrowsersFSUploadInput struct {
	Identifier string
	Mappings   []struct {
		Local string
		Dest  string
	}
	DestDir string
	Paths   []string
}

Upload inputs

type BrowsersFSUploadZipInput added in v0.5.0

type BrowsersFSUploadZipInput struct {
	Identifier string
	ZipPath    string
	DestDir    string
}

type BrowsersFSWriteFileInput added in v0.5.0

type BrowsersFSWriteFileInput struct {
	Identifier string
	DestPath   string
	Mode       string
	SourcePath string
}

type BrowsersLogsStreamInput added in v0.5.0

type BrowsersLogsStreamInput struct {
	Identifier        string
	Source            string
	Follow            BoolFlag
	Path              string
	SupervisorProcess string
}

Logs

type BrowsersProcessExecInput added in v0.5.0

type BrowsersProcessExecInput struct {
	Identifier string
	Command    string
	Args       []string
	Cwd        string
	Timeout    int
	AsUser     string
	AsRoot     BoolFlag
}

Process

type BrowsersProcessKillInput added in v0.5.0

type BrowsersProcessKillInput struct {
	Identifier string
	ProcessID  string
	Signal     string
}

type BrowsersProcessSpawnInput added in v0.5.0

type BrowsersProcessSpawnInput = BrowsersProcessExecInput

type BrowsersProcessStatusInput added in v0.5.0

type BrowsersProcessStatusInput struct {
	Identifier string
	ProcessID  string
}

type BrowsersProcessStdinInput added in v0.5.0

type BrowsersProcessStdinInput struct {
	Identifier string
	ProcessID  string
	DataB64    string
}

type BrowsersProcessStdoutStreamInput added in v0.5.0

type BrowsersProcessStdoutStreamInput struct {
	Identifier string
	ProcessID  string
}

type BrowsersReplaysDownloadInput added in v0.5.0

type BrowsersReplaysDownloadInput struct {
	Identifier string
	ReplayID   string
	Output     string
}

type BrowsersReplaysListInput added in v0.5.0

type BrowsersReplaysListInput struct {
	Identifier string
}

Replays

type BrowsersReplaysStartInput added in v0.5.0

type BrowsersReplaysStartInput struct {
	Identifier         string
	Framerate          int
	MaxDurationSeconds int
}

type BrowsersReplaysStopInput added in v0.5.0

type BrowsersReplaysStopInput struct {
	Identifier string
	ReplayID   string
}

type BrowsersService

type BrowsersService interface {
	List(ctx context.Context, opts ...option.RequestOption) (res *[]kernel.BrowserListResponse, err error)
	New(ctx context.Context, body kernel.BrowserNewParams, opts ...option.RequestOption) (res *kernel.BrowserNewResponse, err error)
	Delete(ctx context.Context, body kernel.BrowserDeleteParams, opts ...option.RequestOption) (err error)
	DeleteByID(ctx context.Context, id string, opts ...option.RequestOption) (err error)
}

BrowsersService defines the subset of the Kernel SDK browser client that we use. See https://github.com/onkernel/kernel-go-sdk/blob/main/browser.go

type BrowsersViewInput

type BrowsersViewInput struct {
	Identifier string
}

type JWTClaims

type JWTClaims struct {
	Sub     string `json:"sub"`      // User ID
	Email   string `json:"email"`    // User email
	Exp     int64  `json:"exp"`      // Expiration time
	Iss     string `json:"iss"`      // Issuer
	OrgID   string `json:"org_id"`   // Organization ID
	OrgName string `json:"org_name"` // Organization name
}

JWTClaims represents the claims in a JWT token

type Metadata

type Metadata struct {
	Version   string
	Commit    string
	Date      string
	GoVersion string
}

type ProfilesCmd added in v0.7.0

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

ProfilesCmd handles profile operations independent of cobra.

func (ProfilesCmd) Create added in v0.7.0

func (ProfilesCmd) Delete added in v0.7.0

func (ProfilesCmd) Download added in v0.7.0

func (ProfilesCmd) Get added in v0.7.0

func (ProfilesCmd) List added in v0.7.0

func (p ProfilesCmd) List(ctx context.Context) error

type ProfilesCreateInput added in v0.7.0

type ProfilesCreateInput struct {
	Name string
}

type ProfilesDeleteInput added in v0.7.0

type ProfilesDeleteInput struct {
	Identifier  string
	SkipConfirm bool
}

type ProfilesDownloadInput added in v0.7.0

type ProfilesDownloadInput struct {
	Identifier string
	Output     string
	Pretty     bool
}

type ProfilesGetInput added in v0.7.0

type ProfilesGetInput struct {
	Identifier string
}

type ProfilesService added in v0.7.0

type ProfilesService interface {
	Get(ctx context.Context, idOrName string, opts ...option.RequestOption) (res *kernel.Profile, err error)
	List(ctx context.Context, opts ...option.RequestOption) (res *[]kernel.Profile, err error)
	Delete(ctx context.Context, idOrName string, opts ...option.RequestOption) (err error)
	New(ctx context.Context, body kernel.ProfileNewParams, opts ...option.RequestOption) (res *kernel.Profile, err error)
	Download(ctx context.Context, idOrName string, opts ...option.RequestOption) (res *http.Response, err error)
}

ProfilesService defines the subset of the Kernel SDK profile client that we use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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