Skip to main content

Crate choir

Crate choir 

Source
Expand description

choir — the agent-facing command line for a choir node.

Everything the templates teach an agent to do by hand (mint a key, provision a workspace, sign and submit ops, run a review round) as one binary. All HTTP shells out to curl; the daemon base URL is a positional argument (no crate reads environment variables).

choir [--auth-file <path>] [--auth-user <name>] <command> ...
choir key <key-file> [name]
choir git-credential <auth-file> [--auth-user <name>] get|store|erase
choir invite <api> <name> <owner/repo> [read|write]
choir asks <api>
choir grant <api> <request-id> <owner/repo> [read|write]
choir decline <api> <request-id>
choir join <link> | <api> <invite-file> <key-file> [--user <name>] [--channel <name>] [--key-file <path>] [--ssh-key <path>] [--token-file <path>]
choir workspace <api> <owner/repo> <name> [--base <git-oid> --owner <channel> --key-file <path> --change <id> --idempotency-key <key>]
choir checkpoint <api> <key-file> <channel> <change-id> <workspace-id> <git-oid>
choir propose [reviewer]... [--key-file <path>] [--channel <name>] [--api <url>] [--repo <owner/repo>] [--onto <branch>]
choir workspace-archive <api> <key-file> <channel> <owner/repo> <name> <change-id> <idempotency-key>
choir submit <api> <key-file> <channel> '<op-json>'
choir review <api> <key-file> <channel> <id> <git-oid> [--ref <repo:ref>] [reviewer]...
choir verdict <api> <key-file> <reviewer> <id> approve|request-changes [note]
choir slash <api> <node-key-file> <id> <reviewer> '<reason>'
choir bind <api> <node-key-file> <operator> <key-hex> [channel]
choir revoke <api> <node-key-file> <key-hex> '<reason>'
choir appeal <api> <attempt-id>
choir intent <api> <key-file> <channel> <subject> <kind> '<body>'
choir check <api> <key-file> <channel> <git-oid> <name> passed|failed|running|errored [evidence] [--ref <repo:ref>]
choir checks <api> <git-oid>
choir reviews <api> <reviewer>
choir acl render <api> <acl-file>
choir view <api>
choir triage <api>
choir funnel <api>
choir state <api> <channel>
choir skill install [--into <dir>]
choir repair <log-file> --verify | --truncate-tail

Exit codes: 0 = the node accepted, 1 = the node rejected (the JSON error body is printed), 2 = usage error. choir checks adds 3 = the answer is not decided yet and 4 = a check could not be run at all, which is our fault rather than the commit’s and wants a re-run rather than a rewrite; see check_exit.

choir doctor reads the same two codes as everything else — 0 nothing required is missing, 1 something is — so that choir doctor && choir propose … means what it looks like it means. A degraded but working machine exits 0; see choir_cli::doctor.

Structs§

AuthOptions 🔒
NodeOptions 🔒
The node URL configured for this directory, if any.
ProposeOptions 🔒
Flags of choir propose, after parsing.

Enums§

Invite 🔒
Where the credential that redeems an invite came from.

Statics§

DEFAULT_AUTH 🔒
The credential choir init wrote, found once.

Functions§

acl_render 🔒
Rewrites an ACL file’s trailing comments from the node’s roster (D46).
actor_id_from_hex 🔒
Derives the actor id from a 64-character ed25519 public key hex.
asks 🔒
choir asks <api> — the queue, oldest first.
batch 🔒
Signs every op in source on one channel and submits them as one batch (D17).
binding_json 🔒
The binding an adapter echoes back so its orchestrator can store it.
check_exit 🔒
Prints the checks on subject and exits with the trichotomy.
checked_level 🔒
Refuses a level that is not one, before the node has to.
configure_git_credential 🔒
Points git at the token for one node, and returns the file it wrote.
configured 🔒
One key out of the nearest .choir/config.
configured_in 🔒
One key out of one .choir/config file.
configured_node 🔒
current_binding 🔒
The binding /api/view currently reports for actor_id, if any.
current_change_revision 🔒
decline 🔒
choir decline <api> <request-id>
derived_view 🔒
Fetches /api/view and applies a pure derivation to it, pretty-printed.
discovered_auth_file 🔒
~/.choir/auth if it exists, or whatever .choir/config names.
ensure_state_dir 🔒
Creates ~/.choir at 0700 if it is not there.
finish 🔒
Prints the response body and exits nonzero unless the status is 2xx.
git_capture 🔒
Runs git in dir and returns its trimmed stdout.
git_credential 🔒
choir git-credential <auth-file> [--auth-user <name>] <operation>
git_run 🔒
Runs git in dir for effect, streaming its output to this process’s own.
grant 🔒
choir grant <api> <request-id> <owner/repo> [read|write]
grant_line 🔒
A repository argument as the ACL spells one.
handover 🔒
choir host stopping to hand one thing back to the person running it.
hash_from_hex 🔒
Parses a <codec>-<digest> content hash as served by the node.
hex_encode 🔒
home_dir 🔒
The home directory the service manager keeps its units under.
home_of 🔒
One account’s home directory, out of the password database.
host 🔒
choir invite <api> <name> <owner/repo> [read|write]
host_failed 🔒
choir host giving up, having said what it got through.
http 🔒
One HTTP round trip through the shared endpoint and auth adapter.
install_unit 🔒
Renders the supervision file and hands the node to the service manager, returning the unit written and the choir it runs.
invite 🔒
invoked_command 🔒
The command word this invocation was reaching for, if any.
is_help 🔒
Both spellings of the request for help.
join 🔒
choir join <link>, or choir join <api> <invite-file> <key-file>
latest_snapshot 🔒
The log identity to sign a scope against: (node, head) from /api/view.
load_key 🔒
Loads the 32-byte secret key file, creating it (0600) if absent.
load_registry 🔒
The trusted keys this client holds, in the operator’s own file format: one key per line, hex, with an optional channel name before it.
log 🔒
log_scope 🔒
main 🔒
may_hold_credential 🔒
Whether a bearer token may be sent to this node without being asked for by name.
node_options 🔒
Parses the options both node-starting commands take.
node_tls 🔒
choir node tls — obtain the certificate and wire up its renewal.
note 🔒
A short human summary on stderr, when a person is looking.
operator_call 🔒
One authenticated call to the node, for the operator-side commands that are a request and a printed answer and nothing else.
parse_auth 🔒
parse_content_hash_hex 🔒
parse_propose 🔒
positional_propose 🔒
Splits off the deprecated <key-file> <channel> prefix, if this invocation carries one.
propose 🔒
choir propose [flags] [reviewer]...
propose_abort 🔒
Aborts a proposal, naming the step that failed.
redeem_next 🔒
The repair for a refused redemption, worked out from the node’s message.
refusal_next 🔒
The next line out of a node’s structured rejection.
repair 🔒
choir repair <log-file> --verify | --truncate-tail.
require_node_key_file 🔒
Refuses to sign an operator-only op with a key file that does not already exist.
rerun_line 🔒
The same choir host invocation, to print as the thing to run next.
revocations 🔒
Reads log entries from a cursor and, with --verify, checks them the way SYNC.md says a client should (D17).
run_step 🔒
Runs one service-manager command, reporting the ones that matter.
runner 🔒
One lifecycle step for an orchestrator adapter.
runner_finish 🔒
Emits a runner result and exits, data on stdout and nothing else.
runner_json 🔒
Reads a JSON document, mapping every failure to a typed refusal.
signed_body 🔒
Signs op on attribution channel channel and builds its submission body.
signed_payload_body 🔒
Signs raw payload bytes on channel. Owner authorizations travel inside a request body rather than the op log, so unlike signed_body this carries no log scope.
state_dir 🔒
~/.choir, the layout choir init writes.
step 🔒
One line of choir host’s progress.
submit 🔒
supervisor 🔒
The service manager, or a refusal naming what this machine is.
tls_line 🔒
The sudo line choir host asks for, spelled out.
usage 🔒
Refuses an invocation, saying the smallest true thing about it.
with_configured_node 🔒
Fills in the node URL for a command that takes one and was not given one.
workspace_body 🔒
write_home_config 🔒
Records the node, channel and key in ~/.choir/config.