cuxcli

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package cuxcli is cuxdeck's only write path into cux: a thin, allowlisted bridge to the `cux` command-line tool. Every mutation the panel offers maps to exactly one CLI invocation, so cux's own validation, locking, and business rules apply unchanged — cuxdeck forks no logic.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownAction = errors.New("cuxcli: unknown action")

ErrUnknownAction is returned for actions outside the allowlist.

Functions

This section is empty.

Types

type AttachResult added in v0.3.0

type AttachResult int

AttachResult is the outcome of EnsureAttach.

const (
	AttachAlreadyOn AttachResult = iota // cux attach was already enabled
	AttachEnabled                       // cuxdeck just turned it on
	AttachFailed                        // couldn't enable (cux < 0.3.2, or an error)
)

func EnsureAttach added in v0.3.0

func EnsureAttach() (AttachResult, string)

EnsureAttach makes sure cux's `attach` setting is on. cuxdeck mirrors sessions over the PTY socket cux exposes only when attach is enabled, and it's opt-in (off by default) as of cux 0.3.2 — the always-on PTY was taxing every session (inulute/cux#33). It flips the setting on only when it's actually off, so the caller can warn about restarting running sessions exactly when that matters (enabling only affects cux sessions started afterwards). The second return is a detail string for the AttachFailed case.

type Result

type Result struct {
	OK     bool   `json:"ok"`
	Output string `json:"output"`
}

Result carries one invocation's outcome back to the panel.

func Do

func Do(action string, args map[string]string) (Result, error)

Do executes one allowlisted action. Unknown actions and malformed arguments fail before anything runs.

Jump to

Keyboard shortcuts

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