Documentation
¶
Overview ¶
Package cli implements CLI subcommands that communicate with a running rysh session via NATS.
Index ¶
- func LaneCreate(store *session.Store, sessionName, tabID string) error
- func LaneDelete(store *session.Store, sessionName, tabID, laneID string) error
- func LaneList(store *session.Store, sessionName, tabID string) error
- func PaneCreate(store *session.Store, sessionName, tabID, laneID, paneGroupID string) error
- func PaneDelete(store *session.Store, sessionName, paneID string) error
- func PaneGroupCreate(store *session.Store, sessionName, tabID, laneID string) error
- func PaneGroupDelete(store *session.Store, sessionName, tabID, laneID, paneGroupID string) error
- func PaneGroupList(store *session.Store, sessionName, tabID, laneID string) error
- func PaneList(store *session.Store, sessionName, tabID, laneID string) error
- func PaneSendInput(store *session.Store, sessionName, paneID, text, mode string) error
- func PipelineDisable(store *session.Store, sessionName, tabID string) error
- func PipelineEnable(store *session.Store, sessionName, tabID string) error
- func PipelineList(store *session.Store, sessionName string) error
- func RyshCommand(store *session.Store, sessionName, tabID, paneID, command string) error
- func RyshCommandResult(store *session.Store, sessionName, tabID, paneID, command string) (*msg.MsgCLIResponse, error)
- func StackedPaneCreate(store *session.Store, sessionName, tabID, laneID, paneGroupID string) error
- func StackedPaneList(store *session.Store, sessionName, paneGroupID string) error
- func TabCreate(store *session.Store, sessionName string) error
- func TabDelete(store *session.Store, sessionName, tabID string) error
- func TabList(store *session.Store, sessionName string) error
- type Client
- func (c *Client) Close()
- func (c *Client) Flush() error
- func (c *Client) Request(message interface{}, timeout time.Duration) (interface{}, error)
- func (c *Client) RequestFromSubject(subject string, message interface{}, timeout time.Duration) (interface{}, error)
- func (c *Client) RequestSnapshot(timeout time.Duration) (interface{}, error)
- func (c *Client) Send(message interface{}) error
- func (c *Client) SendToSubject(subject string, message interface{}) error
- func (c *Client) Subscribe(subject string, handler func(interface{})) (*nats.Subscription, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LaneCreate ¶
LaneCreate creates a new lane in the specified tab.
func LaneDelete ¶
LaneDelete deletes a lane by ID.
func PaneCreate ¶
PaneCreate creates a new pane in the specified tab and lane. If paneGroupID is empty, a new pane-group is auto-created first. If paneGroupID is provided, a stacked pane is added to the existing group.
func PaneDelete ¶
PaneDelete deletes a pane by ID.
func PaneGroupCreate ¶
PaneGroupCreate creates a new pane group (split down) in the specified lane.
func PaneGroupDelete ¶
PaneGroupDelete deletes a pane group by ID.
func PaneGroupList ¶
PaneGroupList lists all pane groups.
func PaneSendInput ¶
PaneSendInput sends input (shell command or AI prompt) to a pane in a running or detached session. If paneID is empty, the input is sent to the active pane via the workspace inbox. If paneID is specified, the input is delivered directly to that pane's inbox as a MsgPaneExecShell or MsgPaneExecPrompt (the PaneActor does not handle MsgSubmitInput directly; that conversion is done by PaneGroupActor in the normal routing chain).
func PipelineDisable ¶
PipelineDisable disables pipeline mode for a tab.
func PipelineEnable ¶
PipelineEnable enables pipeline mode for a tab.
func PipelineList ¶
PipelineList lists pipeline state for all tabs.
func RyshCommand ¶
RyshCommand runs a "##" system command on a running/detached session and prints its output. It is the command-line equivalent of typing a "##" command in a pane. command is the rysh command body WITHOUT the leading "##" (e.g. "cmd echo hailo", "pane info", "tab list"). tabID/paneID select the target pane; empty values fall back to the tab's / workspace's active pane.
func RyshCommandResult ¶ added in v0.2.3
func RyshCommandResult(store *session.Store, sessionName, tabID, paneID, command string) (*msg.MsgCLIResponse, error)
RyshCommandResult is RyshCommand without the printing: it runs a "##" system command and hands back the daemon's raw response so the caller decides what to do with the output, the OK flag and the error text.
`rysh exec` needs this to render --json, and to keep "the command failed" (resp.OK == false) distinct from "we could not ask" (a transport error) — the two mean different things to a script and want different exit codes.
func StackedPaneCreate ¶
StackedPaneCreate creates a new stacked pane in the specified pane group.
func StackedPaneList ¶
StackedPaneList lists stacked panes in a pane group.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to a running rysh session's NATS server.
func Connect ¶ added in v0.2.3
Connect opens a client against a running (or detached) session by name, setting the NATS subject prefix to match it.
Exported for `rysh prompt`, which needs a long-lived connection it can subscribe on rather than the single request/reply the helpers here wrap.
func (*Client) Flush ¶ added in v0.2.3
Flush blocks until buffered publishes have reached the server.
func (*Client) RequestFromSubject ¶
func (c *Client) RequestFromSubject(subject string, message interface{}, timeout time.Duration) (interface{}, error)
RequestFromSubject sends a request/reply to a specific subject.
func (*Client) RequestSnapshot ¶
RequestSnapshot requests the full workspace snapshot.
func (*Client) Send ¶
Send publishes a fire-and-forget message to the workspace inbox. It flushes the connection so the message is delivered before the short-lived CLI process exits (Close drains asynchronously).
func (*Client) SendToSubject ¶
SendToSubject publishes a fire-and-forget message to a specific subject. It flushes so the message is delivered before the CLI process exits.
func (*Client) Subscribe ¶ added in v0.2.3
func (c *Client) Subscribe(subject string, handler func(interface{})) (*nats.Subscription, error)
Subscribe registers a handler for a subject, decoding each message through the session's codec registry before handing it over. A message that fails to decode is dropped rather than surfaced: the bus carries types this process may not know about, and a CLI watching one conversation must not fall over on somebody else's traffic.
It exists for `rysh prompt`, which has to watch a pane's agentic phase transitions to know when a turn has finished — a request/reply cannot express "tell me when this is done".