console

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package console is a terminal client for the same API used by the web UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PickTarget

func PickTarget(in io.Reader, out io.Writer, targets []TargetOption) (int64, error)

PickTarget presents a searchable, keyboard-driven target picker. Callers should resolve an explicit name or ID before invoking this for scripts.

func RunControls added in v2.4.0

func RunControls(c *Client, in io.Reader, out io.Writer, opts DashboardOptions) error

RunControls renders the dashboard without native attachment actions. It is the surface behind `lectern controls` and the attached terminal's Ctrl-] popup: ordinary Lectern actions stay available, but opening another terminal would nest an attachment inside itself.

func RunDashboard

func RunDashboard(c *Client, in io.Reader, out io.Writer, attach func(string, string) error) error

RunDashboard uses a full-screen renderer that owns raw mode, resizing and the suspend/restore boundary around native tmux/SSH. The line client remains useful for pipes and accessibility via console --plain.

func RunDashboardWithOptions added in v2.4.0

func RunDashboardWithOptions(c *Client, in io.Reader, out io.Writer, opts DashboardOptions) error

RunDashboardWithOptions enables native attachment and background workspace tabs.

Types

type Client

type Client struct {
	Base, Token string
	HTTP        *http.Client
}

func New

func New(base, token string) *Client

func (*Client) Download

func (c *Client) Download(path, destination string) error

Download streams arbitrary binary files without the JSON response size limit. Existing local files are preserved, including when the transfer fails.

func (*Client) JSON

func (c *Client) JSON(method, path string, body any) ([]byte, error)

func (*Client) Request

func (c *Client) Request(method, path string, body io.Reader, contentType string) ([]byte, error)

func (*Client) Upload

func (c *Client) Upload(kind, id, path string) ([]byte, error)

type DashboardOptions added in v2.4.0

type DashboardOptions struct {
	Attach            func(string, string) error
	OpenTerminal      func(string, string, bool) error
	OpenBatch         func([]string) error
	TerminalWorkspace bool
	BatchOpen         bool
	InitialSessionID  string
	// Insert types text into the attached terminal without submitting it. Only
	// the Ctrl-] controls popup sets it, where a real pane sits underneath.
	Insert      func(string) error
	ControlOnly bool
	Popup       bool
	FocusKind   string
	FocusID     string
	Action      string
}

DashboardOptions selects which dashboard surface to render.

type HTTPError

type HTTPError struct {
	Status int
	Detail string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type TargetOption

type TargetOption struct {
	ID   int64
	Name string
	Kind string
}

TargetOption is the small, display-oriented target shape used by the command-line target picker.

type UI

type UI struct {
	Client *Client
	In     *bufio.Reader
	Out    io.Writer
	Attach func(string, string) error
}

func NewUI

func NewUI(c *Client, in io.Reader, out io.Writer, attach func(string, string) error) *UI

func (*UI) Run

func (u *UI) Run() error

Jump to

Keyboard shortcuts

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