Documentation
¶
Overview ¶
Package cli holds the `loom workspace` and `loom account` subcommands, which are clients of the loom daemon (daemon stage 3C+4), and the daemon half of `loom reset` (Reset).
Each command joins the daemon as the TUI does (Join, which main sets: the daemon is started when none runs, the newer build wins, and a loom inside loom never replaces it), makes its request, prints the answer and exits. The daemon owns the workspace and account registries while it runs, so every change goes through it and it serves the result at once: a workspace added is served, one removed is unloaded, one renamed keeps its ID. What a command reads of its own environment (the shell's CLAUDE_CONFIG_DIR, a credential override, the working directory) stays its own, and `account login` runs Claude's interactive login in its own terminal. `workspace migrate` is the exception: it lives in cmd and writes state.json directly, under the lock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AccountCmd = &cobra.Command{
Use: "account",
Short: "Manage the Claude accounts sessions can run on",
}
AccountCmd is the parent command for Claude account management. Its commands are clients of the daemon, which creates, removes, links and probes the accounts; each reads its registry from disk only for the guards on its own environment (guardAgainstAccountEnv) and remove's checks before its prompt.
var Join func() (*rpc.Client, error)
Join connects to the loom daemon, starting one when none runs, as the TUI's startup join does: the newer build wins (an older daemon is replaced, a newer one refuses this loom), and the client uses the daemon's tmux server from then on. main sets it; tests serve a model in process.
var SessionCmd = newSessionCmd()
SessionCmd is `loom session`: create, list and drive the sessions of a registered workspace, as clients of the daemon. main attaches it.
var WorkspaceCmd = &cobra.Command{
Use: "workspace",
Short: "Manage workspaces",
}
WorkspaceCmd is the parent command for workspace management. main attaches `migrate` (cmd.MigrateCmd) to it.
Functions ¶
func Reset ¶
Reset has the daemon reset the workspace registered as name ("" the global one), as `loom reset --force` does while a daemon serves the global dir, waits for the reset to finish (its Reply) and says so on out. The daemon drops the workspace's sessions at once, then deletes their records, kills the tmux sessions started in its roots and removes its worktrees and their branches; it refuses while one of them is busy, and for a workspace whose sessions failed to load.
Types ¶
This section is empty.