Documentation
¶
Overview ¶
Package cli is the `lich` command line — the surface a provider CLI running inside a lich session uses to reach the sessions beside it.
It exists because an agent has a shell and nothing else: no lich window, no RPC client, no knowledge of this app. Every command here reads the loopback coordinates lich already exports into each PTY (LICH_PORT / LICH_TOKEN / LICH_SESSION_ID, see docs/hooks/README.md) and talks to the running lich over the same listener the window uses.
It also works from any other shell on the machine — a script, a scheduled job, the user's own terminal. With no coordinates in the environment it reads them from the running instance's runtime file (internal/singleton), the same one install.sh uses to reach a running lich for /restart. Such a caller has no session of its own, and the message it relays says so.
One command is not about the other sessions at all: `lich rage` collects a bug report from this machine, and answers to the failure where there is no window to ask through (internal/rage). It is here because it is part of the same command line, and because it must work when nothing else does.
The contract is docs/cli.md; the lich-plugin slash commands are written against it, so a flag or an output line that moves here breaks a repo this one cannot see.
Index ¶
Constants ¶
const ( // ExitPending is a send, wait or control that ran out of time and handed back // a live ticket or command id: nothing failed, and no answer is in hand yet. ExitPending = 2 // ExitNoAnswer is an errand or a control over with no answer coming through // lich: never read, never delivered, answered elsewhere, a worker closed // before it answered, or the session ended. ExitNoAnswer = 3 )
Exit codes past 0 (done) and 1 (failed) are outcomes a script branches on without parsing --json. docs/cli.md is the contract for them.
const NotACommand = -1
NotACommand is returned when the arguments name no lich subcommand at all, which is how main tells "the user ran a command" apart from "the user opened the app" (and from `lich -- <chromium flags>`).
Variables ¶
This section is empty.
Functions ¶
func NativeExecutable ¶
NativeExecutable is the native window's binary: the one LICH_NATIVE pins, else lich-native beside this lich binary. A missing one is an error that says how to get one.
Types ¶
This section is empty.