cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 87 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 cli wires the cobra subcommands.

Index

Constants

This section is empty.

Variables

View Source
var Commit = ""

Commit is stamped the same way, and falls back to what Go recorded.

Go embeds the revision in the build info when building inside a repository, which covers `go build` and `go install` with no flags at all. The linker value wins because a release build knows things the compiler does not, such as whether the tree was clean.

View Source
var Tree = ""

Tree is `clean` or `modified`, stamped the same way, and wins over what Go recorded.

GO'S OWN FLAG COUNTS UNTRACKED FILES. `vcs.modified` is whether `git status --porcelain` said anything, and a checkout with a notes directory nobody commits says something forever. So every build from the main checkout called itself modified while being exactly its commit, and a deploy refusing a modified build would refuse all of them. The build asks git about tracked files only and says so here.

View Source
var Version = ""

Version is stamped at build time. Empty means nothing stamped it, and versionInfoOf then answers `<base>+<shorthash>`.

SET BY THE LINKER, not by editing this file:

go build -ldflags "-X github.com/dovholuknf/atrium/internal/cli.Version=0.0.3"

The base number is the VERSION file next to this one. scripts/version.sh is the rule every build path stamps with.

Functions

func Execute

func Execute() int

Execute runs the cobra root. Returns the exit code.

func PostRoomLock

func PostRoomLock(ctx context.Context, dir string, lock []byte) error

PostRoomLock sends a room.lock (a JSON object with "version": 1) to the hub this machine joined, over the room's mutual TLS link, as the room the certificate names. dir is the room's key directory, "" for the default. The hub replaces its last lock and never changes the spec. For `atrium room setup` to call when it has applied a spec.

func VersionLine

func VersionLine() string

VersionLine is one line, for a log or a header.

Types

type CloseInput

type CloseInput struct {
	Card    string            `json:"card" jsonschema:"the card to close, by id"`
	Confirm bool              `json:"confirm,omitempty" jsonschema:"false (the default) only answers what a close would do. true closes"`
	Answers map[string]string `json:"answers,omitempty" jsonschema:"keep, stash or delete for each asked worktree, by its seq"`
}

type ExitInput

type ExitInput struct {
	Card  string `` /* 213-byte string literal not displayed */
	Force bool   `` /* 159-byte string literal not displayed */
}

type ExitOutput

type ExitOutput struct {
	Card   string `json:"card"`
	Handle string `json:"handle,omitempty"`
	Asked  bool   `json:"asked"`
	Note   string `json:"note,omitempty"`
}

type GitCloneInput

type GitCloneInput struct {
	URL string `json:"url" jsonschema:"the repository: https://host/owner/repo or git@host:owner/repo.git. Nothing else is taken"`
}

type GitCloneOutput

type GitCloneOutput struct {
	Path  string `json:"path,omitempty"`
	State string `json:"state"`
	Hub   string `json:"hub,omitempty"`
	Note  string `json:"note,omitempty"`
}

type LaunchInput

type LaunchInput struct {
	// Lifetime is not a parameter: atrium_launch_worker sets it to `work`.
	Lifetime string `json:"-"`
	Cwd      string `` /* 216-byte string literal not displayed */
	Repo     string `` /* 351-byte string literal not displayed */
	Branch   string `` /* 143-byte string literal not displayed */
	Base     string `json:"base,omitempty" jsonschema:"where a new branch starts. default the clone's claude/main, else its default branch"`
	Home     bool   `` /* 152-byte string literal not displayed */
	Title    string `json:"title,omitempty" jsonschema:"what to call the card"`
	Why      string `json:"why,omitempty" jsonschema:"what this is for, read back later"`
	// Prompt is the first thing the new session is told.
	Prompt string `json:"prompt,omitempty" jsonschema:"the first instruction it gets"`
	// Brief is everything the new session needs to know before that.
	//
	// WRITTEN TO A FILE, not passed on the command line, and that is the whole
	// difference between this and a long prompt. A prompt is said once: it is
	// at the top of a conversation, it is the first thing to fall out of a
	// compaction, and it cannot be consulted afterwards. A file in the working
	// directory can be re-read at any point, survives compaction, is there when
	// somebody takes the session over, and is still there tomorrow when the
	// card is picked back up.
	//
	// It goes into `BRIEF.md` and the runner is told to read it. Not
	// `CLAUDE.md`, deliberately: that file is loaded into every session in that
	// directory forever, including ones nobody meant to brief, and writing one
	// on somebody's behalf is a decision with no expiry.
	Brief string `` /* 177-byte string literal not displayed */
	// Runner names a configured harness. Empty means the room's default.
	Runner string   `` /* 141-byte string literal not displayed */
	Tags   []string `` /* 184-byte string literal not displayed */
	// Resident marks a long-lived card. See link.ResidentTag.
	Resident bool `` /* 165-byte string literal not displayed */
	// Item names the backlog item the worker works on. See link.WorkTagPrefix.
	Item string `` /* 468-byte string literal not displayed */
	// Isolated starts the worker as an isolated item. See link.ItemTag.
	ItemOwner string `` /* 317-byte string literal not displayed */
	Isolated  bool   `` /* 376-byte string literal not displayed */
	// The launch options, as the hub's atrium_launch takes them. See
	// docs/runtime/launch-options-design.md.
	Model  string            `` /* 167-byte string literal not displayed */
	Effort string            `` /* 134-byte string literal not displayed */
	Args   []string          `` /* 133-byte string literal not displayed */
	Env    map[string]string `json:"env,omitempty" jsonschema:"extra environment for the runner, used as given. the card shows the names only"`
	// LeanAgents, as the hub's atrium_launch takes it. The stdio server has no
	// `lean` field, so this is the only way to a lean launch from here.
	LeanAgents []string `` /* 439-byte string literal not displayed */
	LeanSkills []string `` /* 287-byte string literal not displayed */
	// Superlean, as the hub's atrium_launch takes it. Passed as the kit is.
	Superlean bool `` /* 327-byte string literal not displayed */
	Chat      bool `` /* 339-byte string literal not displayed */
	// Room launches on another room, as the hub's atrium_launch does.
	Room string `` /* 211-byte string literal not displayed */
	// Scratch, Lean, MCP and Theme are the hub's atrium_launch fields of the same name, for a launch on this room.
	Scratch bool     `` /* 232-byte string literal not displayed */
	Lean    *bool    `` /* 246-byte string literal not displayed */
	MCP     []string `` /* 145-byte string literal not displayed */
	Theme   string   `json:"theme,omitempty" jsonschema:"the terminal palette to come up in. empty lets the board colour it from the repo"`
	Needs   []string `` /* 239-byte string literal not displayed */
}

type LaunchOutput

type LaunchOutput struct {
	Card   string `json:"card"`
	Handle string `json:"handle"`
	Title  string `json:"title,omitempty"`
	Status string `json:"status"`
	Watch  string `json:"watch,omitempty"`
	// Brief is where the briefing was written, when there was one. Returned so
	// the caller can add to it later, which is the ordinary case: a peer that
	// turns out to need one more fact should be given it in the file it
	// already reads rather than only in a message it will forget.
	Brief string `json:"brief,omitempty"`
	Note  string `json:"note,omitempty"`
	// What the room ran it with, so a caller sees that the model it asked for took.
	Model  string `json:"model,omitempty"`
	Effort string `json:"effort,omitempty"`
}

type NeedInput

type NeedInput struct {
	Needs []string `` /* 133-byte string literal not displayed */
	Why   string   `json:"why" jsonschema:"one line: why you need it, which the human is shown"`
}

NeedInput is atrium_need's parameters, the hub's own.

type OpenInput

type OpenInput struct {
	URL  string `json:"url" jsonschema:"the link: a pull request, issue or branch URL, or a support ticket or forum topic"`
	Why  string `json:"why,omitempty" jsonschema:"why it is being opened, kept on the review and the card"`
	Repo string `` /* 147-byte string literal not displayed */
}

type OpenOutput

type OpenOutput struct {
	Key      string `json:"key"`
	Kind     string `json:"kind,omitempty"`
	Card     string `json:"card"`
	PR       string `json:"pr,omitempty"`
	Worktree string `json:"worktree,omitempty"`
	Repo     string `json:"repo,omitempty"`
	Created  bool   `json:"created"`
	Room     string `json:"room,omitempty"`
}

type OverlayInput

type OverlayInput struct {
	Action   string   `json:"action" jsonschema:"up, identity, tunnel or down"`
	Name     string   `json:"name,omitempty" jsonschema:"up: the overlay's name (default o1, o2...). identity: the identity's name"`
	Overlay  string   `json:"overlay,omitempty" jsonschema:"which overlay, when the card has more than one"`
	Identity string   `json:"identity,omitempty" jsonschema:"tunnel: the identity that runs it"`
	Roles    []string `json:"roles,omitempty" jsonschema:"identity: role attributes for policies"`
	Mode     string   `json:"mode,omitempty" jsonschema:"tunnel: host (default), proxy or tun"`
	Services []string `json:"services,omitempty" jsonschema:"tunnel proxy: the services to listen for, one port each"`
}

type OwnInput

type OwnInput struct {
	Kind string `json:"kind" jsonschema:"proc, dir or port"`
	Ref  string `json:"ref" jsonschema:"the pid, the absolute folder path, or the port number"`
}

type Peer

type Peer struct {
	Handle string `json:"handle"`
	// Room is set on a peer from another room, whose handle is `name@room`.
	Room string `json:"room,omitempty"`
	// Alias is the short name the operator gave it, accepted in place of the
	// handle.
	Alias  string `json:"alias,omitempty"`
	Card   string `json:"card"`
	Title  string `json:"title,omitempty"`
	Status string `json:"status"`
	Doing  string `json:"doing,omitempty"`
	Where  string `json:"where,omitempty"`
	// Waiting is how long it has wanted somebody, in seconds. The one number
	// worth acting on: a peer that has been waiting an hour is a peer nobody
	// answered.
	Waiting int `json:"waiting_seconds,omitempty"`
	// Owned is whether atrium holds this session's terminal, which decides
	// whether a message is typed or queued.
	Owned bool `json:"atrium_owns_terminal"`
	// Everywhere marks a card that is listed because it carries atrium:everywhere.
	Everywhere bool `json:"everywhere,omitempty"`
}

type PeersInput

type PeersInput struct {
	// All includes cards with no session on them. Off by default: the question
	// this tool answers is who can be spoken to.
	All bool `json:"all,omitempty" jsonschema:"include cards that have no running session"`
	// Rooms adds the sessions on other rooms, through this room's hub.
	Rooms bool `json:"rooms,omitempty" jsonschema:"also list sessions on other rooms. their handles are name@room, which atrium_say takes"`
}

type PeersOutput

type PeersOutput struct {
	// Me is this session's own handle, when it has one. It is what a peer has
	// to be told in order to answer, and an agent has no other way to learn it.
	Me    string `json:"me,omitempty"`
	Peers []Peer `json:"peers"`
	Note  string `json:"note,omitempty"`
}

type PortInput

type PortInput struct {
	Count int `json:"count,omitempty" jsonschema:"how many ports, 1 (the default) to 20"`
}

type PortOutput

type PortOutput struct {
	Ports []int  `json:"ports"`
	Range string `json:"range"`
}

type ProcStartInput

type ProcStartInput struct {
	Argv []string `json:"argv" jsonschema:"the program and its arguments, one per element. no shell"`
	Cwd  string   `json:"cwd,omitempty" jsonschema:"absolute folder to run in, inside your worktree. default your worktree"`
	Name string   `json:"name,omitempty" jsonschema:"a short name, used in the log file's name"`
}

type ReadyInput

type ReadyInput struct {
	Handoff string `` /* 199-byte string literal not displayed */
}

type ReadyOutput

type ReadyOutput struct {
	Ok      bool   `json:"ok"`
	Path    string `json:"path,omitempty"`
	Message string `json:"message"`
}

type RemindInput added in v0.0.4

type RemindInput struct {
	Action string `json:"action,omitempty" jsonschema:"set, list or cancel. default set when text is given, else list"`
	In     string `json:"in,omitempty" jsonschema:"set: how long from now, such as 3d, 4h or 90m"`
	At     string `json:"at,omitempty" jsonschema:"set: an RFC3339 time, instead of in"`
	Text   string `json:"text,omitempty" jsonschema:"set: what to remind about"`
	Card   string `json:"card,omitempty" jsonschema:"a card id on this room. default your own card"`
	Wake   bool   `json:"wake,omitempty" jsonschema:"set: type the text into the card when due, resuming it if parked"`
	ID     string `json:"id,omitempty" jsonschema:"cancel: the id of one reminder, from list"`
}

RemindInput is the atrium_remind tool's input.

type ReportInput

type ReportInput struct {
	Status   string `json:"status" jsonschema:"done, blocked, question or progress"`
	Summary  string `json:"summary" jsonschema:"what happened, in your words. your launcher reads it verbatim"`
	SHA      string `json:"sha,omitempty" jsonschema:"for done: the commit the work landed as"`
	NoCommit string `json:"no_commit,omitempty" jsonschema:"for done with no commit: why there is none"`
	Ask      string `json:"ask,omitempty" jsonschema:"for blocked or question: what you need, and from whom"`
	Kind     string `` /* 188-byte string literal not displayed */
}

type ReportOutput

type ReportOutput struct {
	Recorded     bool   `json:"recorded"`
	Status       string `json:"status"`
	Unverified   bool   `json:"unverified,omitempty"`
	LauncherTold any    `json:"launcher_told"`
	Note         string `json:"note,omitempty"`
}

type RestartInput

type RestartInput struct {
	// Why is recorded in the log the restarter writes, so a board that came
	// back has an account of who asked and what for. It is also what the other
	// agents are told, so it is worth writing as a sentence.
	Why string `json:"why,omitempty" jsonschema:"what this restart is for"`
	// Force skips waiting for other agents to reach a stopping point.
	//
	// Off by default and it should stay off. The whole reason this exists is
	// that a restart closes every terminal atrium owns, and closing one kills
	// the process in it. Forcing is for a board that is already broken.
	Force bool `json:"force,omitempty" jsonschema:"restart even if other agents are still working"`
	// WaitSeconds bounds how long to wait for them. Zero uses the default.
	WaitSeconds int `json:"wait_seconds,omitempty" jsonschema:"how long to wait for other agents, in seconds"`
}

type RestartOutput

type RestartOutput struct {
	Scheduled bool   `json:"scheduled"`
	InSeconds int    `json:"in_seconds"`
	DB        string `json:"db,omitempty"`
	Note      string `json:"note"`
	// Parked is who was asked to stop and did. Named rather than counted,
	// because the next question is always which ones.
	Parked []string `json:"parked,omitempty"`
	// Busy is who was still working when the wait ran out. Non-empty means
	// nothing was scheduled, unless force was set.
	Busy []busyCard `json:"busy,omitempty"`
}

type SayInput

type SayInput struct {
	// To is a handle from atrium_peers, or a card id. Both are accepted
	// because both are things the caller has in hand, and refusing the one it
	// happens to be holding is a puzzle rather than a rule.
	To string `json:"to" jsonschema:"the handle, alias or card id to say it to"`
	// Text is what to say, as one agent to another.
	Text string `` /* 139-byte string literal not displayed */
	// When is `immediate` (the default) or `done`. See internal/daemon/saywhen.go.
	When string `` /* 201-byte string literal not displayed */
	// Reply marks the say as needing an answer, so it shows as owed on the receiving card.
	Reply bool `` /* 148-byte string literal not displayed */
	// Wake resumes a parked card so this reaches it. Without it a say to a parked card is refused.
	Wake bool `` /* 499-byte string literal not displayed */
	// Kind is `fyi` or `needs`. See internal/daemon/fyi.go.
	Kind string `` /* 217-byte string literal not displayed */
	// Force types now when the typing gate cannot read the line. See internal/daemon/forcesay.go.
	Force bool `` /* 457-byte string literal not displayed */
}

type SayOutput

type SayOutput struct {
	// Say is this say's id, for looking it up afterwards through atrium_task with says.
	Say string `json:"say,omitempty"`
	// Via is how the name resolved: handle, alias or card.
	Via string `json:"via,omitempty"`
	// Delivered is `terminal`, `queued` or `typed-queued`. Different promises, and the
	// caller has to know which one was made: typed into an idle runner has landed, queued
	// has not and will not until that session next reaches a hook, and typed-queued is in
	// the runner's own queued box and not read yet.
	Delivered string `json:"delivered"`
	To        string `json:"to"`
	// ToCard is the RECIPIENT's card id, never yours. It was `card`. See the
	// hub's sayOutput.
	ToCard string `json:"to_card"`
	When   string `json:"when,omitempty"`
	Note   string `json:"note,omitempty"`
}

type StatusInput

type StatusInput struct{}

type StatusOutput

type StatusOutput struct {
	Running bool   `json:"running"`
	Board   string `json:"board,omitempty"`
	DB      string `json:"db,omitempty"`
	PID     int    `json:"pid,omitempty"`
	// Halted is the store having failed. The daemon is up and the agent
	// listener is closed, which is a state worth reporting as its own thing
	// rather than as "running".
	Halted bool   `json:"halted,omitempty"`
	Cause  string `json:"cause,omitempty"`
	Cards  int    `json:"cards,omitempty"`
	// Waiting is how many want you right now, which is the only number worth
	// reading without opening the board.
	Waiting int    `json:"waiting,omitempty"`
	Note    string `json:"note,omitempty"`
}

type SubscribeInput

type SubscribeInput struct {
	Action string `json:"action" jsonschema:"subscribe, unsubscribe or list"`
	Kind   string `json:"kind,omitempty" jsonschema:"the kind of event. today: land"`
	Repo   string `json:"repo,omitempty" jsonschema:"owner/name to hear only that repository. empty for any"`
	Branch string `json:"branch,omitempty" jsonschema:"the branch landed on, to hear only that one. empty for any"`
	Wake   bool   `json:"wake,omitempty" jsonschema:"true to resume your card when it is parked and an event arrives"`
	ID     string `json:"id,omitempty" jsonschema:"unsubscribe: the id of one subscription, from list"`
}

SubscribeInput is the atrium_subscribe tool's input.

type TaskEvent

type TaskEvent struct {
	At   string `json:"at"`
	Kind string `json:"kind"`
}

type TaskInput

type TaskInput struct {
	Card string `` /* 130-byte string literal not displayed */
	// Dismiss closes the owed item a worker left on YOUR card. See internal/daemon/owed.go.
	Dismiss string `` /* 169-byte string literal not displayed */
	// Events includes the recent history, which is what a card DID rather than
	// where it is now.
	Events bool `json:"events,omitempty" jsonschema:"include recent events"`
	// Says includes the says this card sent and received, and what became of each.
	Says bool `` /* 134-byte string literal not displayed */
}

type TaskOutput

type TaskOutput struct {
	Card    string      `json:"card"`
	Handle  string      `json:"handle,omitempty"`
	Title   string      `json:"title,omitempty"`
	Status  string      `json:"status"`
	Doing   string      `json:"doing,omitempty"`
	Where   string      `json:"where,omitempty"`
	Why     string      `json:"why,omitempty"`
	Idle    int         `json:"idle_seconds,omitempty"`
	Waiting int         `json:"waiting_seconds,omitempty"`
	Owned   bool        `json:"atrium_owns_terminal"`
	Events  []TaskEvent `json:"events,omitempty"`
	Says    []TaskSay   `json:"says,omitempty"`
	Note    string      `json:"note,omitempty"`
}

type TaskSay

type TaskSay struct {
	ID          string `json:"id"`
	Direction   string `json:"direction"`
	Other       string `json:"other"`
	Via         string `json:"via,omitempty"`
	State       string `json:"state"`
	Channel     string `json:"channel,omitempty"`
	SentAt      string `json:"sent_at"`
	DeliveredAt string `json:"delivered_at,omitempty"`
	Preview     string `json:"preview,omitempty"`
	ReplyWanted bool   `json:"reply_wanted,omitempty"`
	RepliedAt   string `json:"replied_at,omitempty"`
	ResetKind   string `json:"reset_kind,omitempty"`
}

TaskSay is one say on a card, from its own side.

Source Files

Jump to

Keyboard shortcuts

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