The lll CLI contract
This is the surface lll 1.0.0 promises under SemVer. Changing one of these parts in a way that breaks a script needs a new major version; anything not listed here can change in a minor release.
lll help contract prints this page, then a command reference generated
from the binary’s command table: every verb, whether it writes, whether it
takes --json, and its other spellings.
Covered:
- exit codes;
- the JSON that
--jsonprints, for the fields this page names; - the list envelope;
- which stream carries what (below);
- command, verb and flag spellings, including the permanent aliases below.
Not covered:
- the wording of any message, error or help page;
collectionId,collectionName,expandand any JSON field this page does not name;- the PocketBase collections that
lll apireaches (see below).
Exit codes
Every failing command exits with exactly one of these codes. Branch on the code, not on the error text.
| Code | Meaning | Examples |
|---|---|---|
| 0 | Success | |
| 1 | Error | server failure (5xx), server unreachable, a rejected value; a server that lacks a capability the command needs (below) |
| 2 | Usage: the command line, or a setting that stands in for a flag (LLL_SORT, LLL_AGENT, LLL_TEAM) |
unknown noun, verb or flag; a missing or malformed argument ('nope' is not an issue ID); no team configured for a command that needs one (fix: --team KEY or lll attach) |
| 3 | Not found | no such issue, doc, team, label, project, member or webhook; an issue outside your teams; issue watch --after naming a comment that is not on the issue |
| 4 | Refused or conflict | the claim is held by someone else; release or renew without the claim; closing or deleting a claimed issue without --force; moving an issue to done or cancelled over an open ask without --force; answering an ask that is already closed; creating a bot that exists; a read-only member writing; an --if-unchanged-since mismatch; a declined delete confirmation |
| 5 | Nothing to do | lll issue next with an empty agenda; lll issue next --wait DURATION when the wait ends with an empty agenda; lll issue ask --wait DURATION when the wait ends with the ask unanswered |
| 6 | Not authenticated | no token, or an expired, revoked or corrupted token |
--help and -h exit 0 and print to stdout.
A usage error (2) never depends on server state the command line cannot see. So
--force on issue delete means “even if claimed”: on an unclaimed issue it
is unneeded, and the delete goes ahead. --force never skips the
confirmation; without --yes, a declined confirmation exits 4.
lll api exits 0 on any HTTP answer, so a script can read the status line on
stderr and the body on stdout. With --fail, an answer of 400 or above exits
with the code its status maps to when the body is the API’s own error (it
names its status): 401 is 6, 403, 409 and 412 are 4, 404 is 3, anything
else is 1. Any other error body, such as a proxy’s or gateway’s, exits 1. The
body still prints.
Errors print on stderr as Error: and a message; exit 5 prints Nothing to do:
instead, because it is an outcome, not an error. The message is for people:
it names the cause and the fix, and it can change in any release.
Structured diagnostics
Put --json-errors immediately after lll to request a final JSON diagnostic
on stderr. It changes neither the seven exit codes nor stdout:
lll --json-errors issue release ENG-12 2>diagnostic.json
{"error":{"reason":"not_claimed","exit_code":4,"http_status":0,"server_code":"","output_failed":false,"recovery":""}}
| Field | Covered meaning |
|---|---|
reason |
Typed classification below; never inferred from human text |
exit_code |
The process exit code |
http_status |
Underlying HTTP status, or 0 for a local decision |
server_code |
A recognized server code, or "" when absent or unknown |
output_failed |
A stdout write failed; committed work may already exist |
recovery |
"one_time_output_lost" when one-time credential/invite output was lost, otherwise "" |
Reasons are usage, not_found, not_authenticated, nothing_to_do,
not_claimed, conflict, claim_held, needs_force, open_descendants,
open_asks, refused, network_error, server_error and error. Future reasons may be
added: handle unknown ones using exit_code. HTTP 409/412 and a changed claim
are conflicts; a stale update caught locally has status 0. An older server
without a recognized code can yield generic refused; no specific cause is
guessed. server_code is empty for local decisions, including an unclaimed
issue caught before a request.
The diagnostic excludes raw messages, server bodies, URLs and input values.
Renderer notices, login-renewal notes and version-skew warnings are suppressed
in this mode. On success it emits no diagnostic. Streaming commands and child
processes may write their own stderr first; the final diagnostic is the last
line on a failing exit. Partial stdout remains intact, including api --fail
response bodies. If writing stdout also fails, the original command failure
keeps its exit code; an otherwise successful command exits 1.
This is a prefix, not a command flag: -b --json-errors still supplies that
literal body. Clients predating this feature reject the prefix with ordinary
usage output; they cannot provide this diagnostic format.
Output streams
Data goes to stdout: a key, a record, a list. Notices go to stderr. Capture
stdout only: key=$(lll issue next --claim), not 2>&1.
lll issue next --wait DURATION waits for an issue to offer instead of exiting
5 at once. DURATION is a positive Go duration with a unit, such as 30s,
10m or 1h; anything else exits 2. The command re-reads the board when an
issue or claim in the team changes, and at least every 30 seconds. It exits 0
with the key on stdout as soon as it can offer an issue, and exits 5 with an
empty stdout when DURATION passes first. With --claim, a claim that another
worker wins during the wait does not end the wait. --label, --project and
--exclude-label select the same issues as they do without --wait. Every
other failure, such as an unknown label or a refused token, exits at once with
its own code. Without --claim, several waiters can print the same key.
With --json, stdout is exactly one JSON value (lll watch --json: one per
line). lll issue next --claim --json and lll issue start --json print no
notice at all: the JSON carries the claim and the branch. lll bot create
--env and lll bot rotate --env print the two export lines and nothing
else, on either stream.
JSON output
The fields and envelopes below are covered by the contract. See Output streams for notices and streaming output.
Timestamps
Every timestamp is RFC3339 in UTC with milliseconds:
2026-10-08T03:02:11.982Z. This covers created, updated, expires and
redeemed and last_activity at any depth, and the claim’s claimed and renewed.
Time flags (issue list --since, issue update --if-unchanged-since) accept
RFC3339 in any offset and the space form PocketBase stores
(2026-10-08 03:02:11.982Z). They compare instants, so
2026-10-08T05:02:11.982+02:00 and 2026-10-08 03:02:11.982Z name the same
updated.
The list envelope
Every list --json prints one envelope, whatever its flags:
{"items": [], "page": 1, "perPage": 200, "totalItems": 0, "totalPages": 0}
itemsis always an array, nevernull.totalItemscounts every match, not only this page.- Lists that are read whole (labels, projects, docs, teams, members, webhooks,
findings, search hits and
issue comment KEYwithout a body) are one page:page1,perPageequal tototalItems,totalPages1, or 0 when empty. issue list --ready,--blockedand--sort priorityread every page before they filter or order, then apply--pageand--limit.
The envelope is printed by issue list, issue comment KEY (without a body),
doc list, finding list, finding near, label list, project list,
team list, member list, webhook list and search. Bulk comment list
and claim list add cursor pagination; see Bulk current reads.
The issue object
Every issue --json prints the same object: issue list per item,
issue create, issue update, issue close, issue start and issue claim
(the issue after the write). issue view and issue next add comments,
docs and findings.
| Field | Type | Notes |
|---|---|---|
id |
string | record id |
key |
string | ENG-12 |
number |
number | the 12 in ENG-12 |
team |
string | team record id |
title |
string | |
description |
string | Markdown |
state |
string | backlog, todo, in-progress, in-review, done or cancelled |
priority |
number | 0 none, 1 urgent, 2 high, 3 medium, 4 low |
assignee |
string | member record id, "" when unassigned |
project |
string | project record id, "" when none |
labels |
array of string | label record ids |
blocked_by |
array of string | issue record ids |
parent |
string | parent issue record id, "" for a root; older servers omit it |
emoji |
string | |
refs |
string | external references |
attachments |
array of string | stored file names |
creator |
string | member record id |
creator_name, assignee_name |
string | the member’s name; "hidden member" when you cannot see the member; "" when the relation is empty |
project_name |
string | "" when none |
label_names |
array of string | the names of the labels in labels |
created, updated |
string | RFC3339 |
last_activity |
string | server-owned activity timestamp; omitted by older servers (see below) |
claim |
object or null | see below |
last_activity advances for committed issue edits and comment/claim creates,
edits and deletes, including claim renewal and expiry. No-op issue/comment
saves do not count. Timestamps are nondecreasing; writes in the same clock
tick may share one timestamp. Comment/claim-only activity does not change
updated, so issue list --since retains its existing issue-edit semantics.
Read last_activity for inactivity checks; use the activity cursor for ordered
change consumption. Existing records are backfilled from retained record and
audit timestamps; deleted activity from before auditing cannot be recovered.
claim is null when nobody holds the issue, and otherwise:
| Field | Type | Notes |
|---|---|---|
id |
string | claim record id |
member |
string | the holder’s member record id |
holder |
string | the holder’s name, "" when you cannot see the member |
agent |
string | the session label, "" when none |
claimed |
string | RFC3339, when the hold was taken |
renewed |
string | RFC3339, when the holder last renewed it |
issue view --json and issue next --json add comments (each a comment
record, below), docs and findings (each a doc record, below).
They also add blocked_by_refs: an array of {id, key, title, state} for
visible blockers, in blocked_by order. Keys use each blocker’s own team.
Hidden or deleted blockers are omitted from refs; their ids remain in
blocked_by, so missing refs do not mean the issue is ready.
They also add evidence: the issue’s evidence entries, [] when there are
none, in the order the server returns them. lll issue evidence KEY --json
prints the same objects in the list envelope, oldest first, and
lll issue evidence KEY --command ... --json prints the one it recorded:
| Field | Type | Notes |
|—|—|—|
| id | string | evidence record id |
| issue | string | issue record id |
| command | string | the command that was run |
| exit_code | number | the exit code it returned, as recorded; an integer |
| artifact | string | stored file name, "" when none; lll issue evidence KEY --download ID reads it |
| member | string | member record id of who recorded it, "" for an administrator |
| member_name | string | that member’s name; "hidden member" when you cannot see the member; the stored name with ` (former member) when the member was deleted; ”” for an administrator |
| agent | string | the session label, ”” when none |
| created` | string | RFC3339 |
Recording an entry advances the issue’s last_activity.
Issue reads (list, view, next) and post-update results add tree context
when the server provides parent:
| Field | Type | Notes |
|---|---|---|
parent_ref |
object or null | visible parent as {id, key, title, state}; the raw parent id remains if no ref is available |
children_refs |
array | visible direct children as {id, key, title, state} |
children_summary |
object | {done, total} for direct children; done includes done and cancelled |
These counts ignore list filters. A closed child counts done even if it has open descendants. Create replies need not include this derived context: a saved create does not depend on a second read. Older-server reads omit it.
Bulk current reads
comment list --project NAME --json and claim list --project NAME --json
read current records across the configured team’s issues. Project filtering
is optional. Both use the normal list envelope plus next_cursor: a string,
empty at the end. Pass a non-empty cursor to --since with the same list,
server, team and project. --limit is 1-500 (default 100).
| Item | Covered fields |
|---|---|
| bulk comment | the comment fields below, plus key (issue key) |
| bulk claim | id, issue, key, member, holder, agent, claimed, renewed (same meanings as an issue’s claim) |
Pages are ordered by immutable record id. page is 1; totalItems and
totalPages count the remaining query after the cursor. Follow next_cursor
for continuation; totals can change between queries. This avoids offset
shifts, not concurrent state changes: edits/deletes affect subsequent reads,
and new or newly matching ids behind the cursor require a fresh scan.
--since takes an opaque continuation here, not a date or an activity cursor.
Use activity for ordered write history; these lists are not a change feed
or an atomic snapshot. Ordinary member visibility rules still apply.
Bot lifecycle and credentials
bot disable --json returns {id, name, disabled: true}.
bot remove --json (alias delete) returns
{id, name, removed: true, had_references: boolean}. These operations require
bots.lifecycle support. They emit no token; terminal confirmation goes to
stderr. A declined confirmation or referenced removal without --force is
exit 4. Disabling preserves attribution and work; forced removal permits
native reference clearing, including assignments and claims.
bot create --json and bot rotate --json print one credential object:
| Field | Type | Notes |
|---|---|---|
name |
string | bot member name |
url |
string | server URL used for this invocation |
token |
string | newly minted one-time credential |
team |
string | create: the first --team, or ""; rotate: explicit --team context, or "" |
On create, --team KEY (repeatable) and --read-only set the bot’s access
in the create request, before its token is minted. A team the creating
credential cannot see exits 1 and creates nothing; a request wider than the
creator’s access is refused by the server and creates nothing. On rotate,
--team names only the prompt’s team and does not change access.
JSON mode needs no configured team. --env and --json together exit 2
before server or credential requests. Create still refuses an existing bot;
only rotate invalidates its prior tokens. A failed credential write exits 1
and names a recovery command without copying the token to stderr.
Other records
| Record | Covered fields |
|---|---|
| comment | id, issue, author, author_name, author_kind, server_record, agent, body, created, updated |
| doc, finding | id, team, slug, title, kind, body, area, paths, issues, confidence, last_editor, author_name, last_editor_name, created, updated |
| team | id, key, name, accent, emoji, archived |
| member | id, name, email, kind, owner, created_by, scope, teams, mode, team_keys |
| label | id, name, color, team |
| project | id, name, description, status, team |
| webhook | id, url, secret_set, team, project |
| search hit | group, kind, title, state, score, snippets (each label, lines) |
A member’s owner, created_by, scope, teams, mode and team_keys are
absent when empty. created_by is the member record id of the bot that
created a bot, set by the server; such a bot’s owner is that bot’s owner. A comment’s author_kind is "system" on a comment the server wrote on
its own (the claim-expiry note has no author), and absent
otherwise. A doc’s last_editor is the member record id of the member who last
changed its content (slug, title, kind, body, area or paths), set
by the server: the author until another member edits it. Linking an issue,
confirming or refuting a finding, and a write that changes no content leave it
unchanged. It is "" on a doc with no author (absent in issue view --json).
author_name and last_editor_name name those members as the issue object
names its members: "hidden member" when you cannot see one, "" when the
field is empty. The docs and findings inside issue view --json do not carry
them.
project view --json lists its issues as records without key or
claim; use issue list --project NAME --json for the issue object.
In issue view --json and issue next --json, comment author_name is
"hidden member" for an inaccessible author and "" for an empty relation.
server_record is always a boolean: true for server-written comments,
including forced-release notes attributed to a member and expiry notes
with author_kind: "system". These fields need no extra member lookup.
lll watch --json prints one event per line. Its timestamps are RFC3339;
the covered envelope has topic, action, record, key, cursor, seq,
created, changes and the author fields. Consumers must ignore unknown
topics/actions and additional fields. Issue record fields follow the issue
contract above; the event fields are described below.
Empty lists
A list with nothing to show prints one line on stderr, such as no issues or
no labels, and nothing on stdout. Its exit code is 0. --json prints the
envelope with an empty items array.
Spellings
Each noun, verb and flag has one canonical spelling, the one help prints. These aliases are permanent:
| Alias | Canonical | Where |
|---|---|---|
new |
create |
issue, doc, finding |
show |
view |
issue, doc |
read |
view |
issue, doc, finding (hidden: no help row, no completion) |
show |
list |
config (hidden: no help row, no completion) |
comments |
comment |
issue (hidden: no help row, no completion) |
--list |
list |
config (the verb before 1.0, after git config --list) |
add |
create |
member |
remove |
delete |
member |
edit, update |
each other | issue, doc, project, label |
A removed spelling fails with exit 2 and names its replacement.
lll api
lll api METHOD PATH is a passthrough to the server’s PocketBase API. The
passthrough is covered: its flags, its exit codes, and stdout for the body and
stderr for the status line. What the API answers is not: collection names,
fields, filters and rules follow the server’s migrations and can change in a
minor release. lll api --schema prints the current reference. For a bulk
read the CLI covers, prefer its --json: lll issue list --json carries
each issue’s claim, so reading claims through
lll api GET /api/collections/claims/records is no longer needed for that.
Watch events
The log-backed stream
lll watch reads the server’s activity log: one event per write to an issue,
comment or claim, in the order the writes were made. Each --json event has:
cursor: the event’s position,v1.<log>.<seq>. Treat it as opaque and pass it to--after.seq: the event’s number in the log. Later events have higher numbers; a reader does not see every number.created: when the write was made.topic(issues,commentsorclaims),action(create,updateordelete) andkey.author,author_name,author_kindandagent: who made the write.changes: each changed field as{"from": ..., "to": ...}.record: the issue, comment or claim. For an update it is the record as it is when the event is read, so on replay it is the current record, not the record at the event. For a record that no longer exists it holds the fields the log kept, withoutexpandor timestamps.
--after CURSOR prints every matching event after the cursor, in order, and
then streams. Without it the stream starts at the newest event; the starting
cursor is printed on stderr as watch: cursor v1.<log>.<seq>. After a lost
connection the stream reads the log from the last event it printed. Delivery
is at least once across restarts: store an event’s cursor after handling it.
A cursor is a position in the whole log and stays valid under different filters. A malformed cursor exits 2. A cursor from another board, ahead of the log, or before rows that retention deleted exits 1. None is read as “start now”. The log is kept until an operator deletes rows.
Filters are judged against the issue as it is when the event is read. Events
on an issue that no longer exists pass a --project filter by the project the
log recorded and are dropped under any other filter. --ready does not read
the log: it is live-only, carries no cursor and refuses --after.
Display fields on issue events
Issue events from watch --json (including --ready) and issue watch --json
carry key, priority_name and creator_name beside topic, action and
record. watch --json omits the two names for an issue that no longer
exists. creator_name is an empty string when there is no creator and
"hidden member" when the creator is inaccessible.
These are additive covered fields; readers should tolerate new envelope fields.
Comment and claim activity
watch --activity --json also emits comments and claims topics for issues matching
its filters (--ready includes only ready parents). These carry record,
key, author (actor member id), author_name, author_kind
(person, bot, system, superuser, or empty when unknown) and agent.
Claim create/update/delete mean acquired/updated (including renewal)/released;
a repeated claim with no write emits nothing. A claim’s holder remains
record.member; the releaser is not assumed to be the holder. Names and kinds
of inaccessible actors remain hidden. Old servers lacking claim attribution
leave the actor unknown. Webhooks use the same activity envelope, with names
limited to the team’s shared roster.
lll watch replays from the activity log with --after. Webhooks and
watch --ready are live notification only: they do not replay gaps, and
issue list --since misses comment/claim-only activity.
Activity delivery is opt-in. Plain watch and webhook registrations without
--activity keep issue-only delivery. Activity webhook creation checks that
the server supports it (see Server capabilities) before sending any POST;
an unsupported server is an error, never a silent issue-only registration.
Waiting for a comment
lll issue watch KEY --until TEXT exits 0 at the first comment whose body
contains TEXT. A comment already on the issue ends the wait at once: text mode
prints already there: #N by AUTHOR: LINE, and --json prints the comment
with action snapshot. Existing comments are checked oldest first. A comment
created or edited during the wait ends it with action create or update.
With --timeout SECONDS, a wait that sees no match exits 1.
--after COMMENT_ID limits the match to comments after the named one, in the
same oldest-first order. The named comment and every earlier one cannot end
the wait, including by a later edit. COMMENT_ID is the record.id of a
comment event from issue watch --json or the id from comment list --json.
A loop passes the id of the match it just handled; a comment written between
two runs is already there for the second. An id that is not a comment on that
issue exits 3. --after without --until is a usage error (exit 2).
This --after takes a comment id. lll watch --after takes an activity
cursor; the two values are not interchangeable.
Server capabilities
A server’s unauthenticated GET /.well-known/lll names its version and
lists its capabilities, for example
{"service":"lll","version":"1.2.0","capabilities":["issues.idempotency","comments.idempotency","webhooks.activity"]}.
A name, once listed, is never removed or renamed.
Selected capabilities are listed below; the server discovery response is the full list for that server. It also advertises bot lifecycle, project cascade and permission-management capabilities described in their respective guides.
| Capability | Commands that need it |
|---|---|
issues.idempotency |
issue create --idempotency-key |
comments.idempotency |
issue comment --idempotency-key |
webhooks.activity |
webhook add --activity |
issues.parents |
issue create/update --parent, issue list --parent/--under, and importing a mirror with parent links |
Before such a command writes anything, the CLI reads the list. A capability
missing from it is refused with exit 1 and a message naming the server’s
version: this server (1.2.0) does not support --idempotency-key; upgrade the
server before retrying this comment. Nothing is sent. The list is absent
when the server predates it (1.1.0 and older), and from a board that lll up
started over an API it did not start, since that API may be older than the
board. Without the list, the CLI asks the feature’s own authenticated support route
(/api/lll/issues/idempotency, /api/lll/comments/idempotency,
/api/lll/activity, /api/lll/issues/parents), and refuses the same
way when that route answers 404. Discovery is read without credentials, gives
up after 2 seconds, and any failure reads as an absent list. Commands that need no capability never read
the list. The version-skew warning is separate and unchanged.
Version skew and auto-update
Once a day per server, a command that talks to the server also reads the
server’s version from GET /.well-known/lll. Any failure is silent. When the
server is newer, the CLI writes exactly one line to stderr after the
command’s own output. Stdout, --json output and the exit code are the same
as without the line.
A Homebrew install starts brew upgrade lll in its own session and does not
wait for it. Its output goes to auto-update.log beside the config file. The
line is:
lll: updating MINE -> THEIRS in the background (log: PATH). Disable: LLL_AUTO_UPDATE=0
Other installs print lll: this lll is MINE; URL runs THEIRS, which may have
commands this build lacks. Upgrade: lll upgrade. A Homebrew install prints
this line too when LLL_AUTO_UPDATE is 0, false, no or off, when the
config sets auto_update = false, when CI is set, or when another update
is still running. It also prints it when this machine runs the server
(board-login-url beside the config, or a running Homebrew lll up).
LLL_AUTO_UPDATE set to any other value overrides the config; CI
overrides both. Each server gets one attempt a day.
Named group invites
Without --for, invite create --json keeps the existing single-invite object.
With repeated --for NAME, it prints one object: invites (objects with
name, url, code, expires), teams (team keys), mode, pending (names
without a returned link), and boolean complete. Partial failure exits nonzero
and preserves that JSON on stdout; stderr carries the error. A failed request
may have committed, so creation retries are not idempotent. See
Inviting people and agents.
Project cascade
project delete NAME --cascade --dry-run --json returns project (id),
name, issues (id, key, title, state), blockers (kind, count)
and an opaque revision. Preview writes nothing. --if-preview REVISION
requires that exact preview on execution; a stale revision exits 4. A successful
cascade JSON receipt has project, deleted: true and the deleted issues.
Claims and external references block execution, including administrator calls.
The server advertises projects.cascade; neither a missing capability nor a
refused cascade falls back to detaching or deleting cards one by one.