Documentation
¶
Overview ¶
Package cli wires the cobra subcommands.
Index ¶
- Variables
- func Execute() int
- func PostRoomLock(ctx context.Context, dir string, lock []byte) error
- func VersionLine() string
- type CloseInput
- type ExitInput
- type ExitOutput
- type GitCloneInput
- type GitCloneOutput
- type LaunchInput
- type LaunchOutput
- type NeedInput
- type OpenInput
- type OpenOutput
- type OverlayInput
- type OwnInput
- type Peer
- type PeersInput
- type PeersOutput
- type PortInput
- type PortOutput
- type ProcStartInput
- type ReadyInput
- type ReadyOutput
- type ReportInput
- type ReportOutput
- type RestartInput
- type RestartOutput
- type SayInput
- type SayOutput
- type StatusInput
- type StatusOutput
- type SubscribeInput
- type TaskEvent
- type TaskInput
- type TaskOutput
- type TaskSay
Constants ¶
This section is empty.
Variables ¶
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.
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.
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 PostRoomLock ¶
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.
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 ExitOutput ¶
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 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 claude.
Runner string `json:"runner,omitempty" jsonschema:"which configured runner to start. default claude"`
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 `` /* 277-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"`
}
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 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 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 PortInput ¶
type PortInput struct {
Count int `json:"count,omitempty" jsonschema:"how many ports, 1 (the default) to 20"`
}
type PortOutput ¶
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 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 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 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
¶
- adapter_test_cmd.go
- adapter_validate.go
- advertisecheck.go
- advertiseset.go
- ancestry.go
- ancestry_other.go
- archiveworkers.go
- atrium_audit.go
- atrium_backups.go
- atrium_builds.go
- atrium_cihook.go
- atrium_defaults.go
- atrium_growl.go
- atrium_hubrooms.go
- atrium_inventory.go
- atrium_notify.go
- atrium_rooms.go
- atrium_rooms_git.go
- atrium_rooms_git_store.go
- atrium_rooms_spec.go
- atrium_rooms_table.go
- atrium_run.go
- atrium_runroom.go
- atrium_share.go
- backlog.go
- backlog_import.go
- cardverbs.go
- ci.go
- cli.go
- clipboard.go
- close.go
- control.go
- control_backlog.go
- control_ci.go
- control_git.go
- control_gitclone.go
- control_launch_local.go
- control_launch_room.go
- control_need.go
- control_open.go
- control_own.go
- control_park.go
- control_peers.go
- control_report.go
- control_skew.go
- detach_other.go
- dispatch.go
- finish.go
- help.go
- hook.go
- hook_guard.go
- hook_leanagents.go
- hook_nopoll.go
- hook_now.go
- hook_permission.go
- hubdial.go
- join.go
- landcheck.go
- launch.go
- launch_prompt.go
- ledger.go
- mcp_relay.go
- merge.go
- merged.go
- new.go
- open.go
- peer.go
- preview.go
- priority_other.go
- ptyhost.go
- ready.go
- remoteaccess_cmd.go
- remoteaccess_dir.go
- replay.go
- requirements.go
- resources.go
- restartptyhost.go
- roomdb.go
- roomdetach.go
- roomhub_cmd.go
- roomjoinflags.go
- roomlayout.go
- roommove.go
- roomrelay.go
- roomrestart.go
- roomrun.go
- roomsettings.go
- roomsetup.go
- roomssh.go
- service_cmd.go
- service_other.go
- session.go
- shepherd.go
- spawn_other.go
- sshcmd.go
- sshconfig.go
- sshproxy.go
- sshproxy_parent_other.go
- stop.go
- subscribe.go
- tangent.go
- tenant.go
- termattach.go
- termattach_other.go
- transport.go
- transports_cmd.go
- turn.go
- turn_reply.go
- turnquestions.go
- twig.go
- update.go
- upgrade.go
- usage.go
- version.go
- wait.go
- work_item.go
- worktree.go