Command line interface
The cumments binary doubles as a local administration CLI. It operates
directly on the same SQLite database the server uses, so whoever can read
and write the database is an operator — there is no separate operator
token on the CLI path. Use the Operator HTTP API when managing a remote
instance.
The CLI mirrors the Operator API: anything the Operator API can do, the CLI can do locally.
Global flags
-
--config <path>(also-c): configuration file. The flag is global, so it can appear before or after a subcommand: -
--help,--version.
Command tree
Output conventions
- Machine-readable data (site lists, quarantined rooms, secrets, tokens) goes to
stdout as JSON, matching the Operator API response shape.
--tableon list commands switches to a human-readable table. - Human notes and warnings go to stderr, so stdout stays script-friendly.
- Secrets and claim tokens are printed exactly once; the CLI refuses to show them again.
export-configprints the{"site_id","toml"}wrapper returned by the Operator API;--rawprints only the TOML block for shell redirection.rooms reinstateprints{"room_id","status":"active"}. This is a CLI-side enhancement of the Operator API, which returns an empty204: the CLI has no body-free "no content" convention, so it reports the affected resource.rooms upgradeprints{"room_id","new_version","replacement_room"}, matching the Operator API response.- Retirement and repair transitions print the affected resource plus its
accepted state (for example
"retiring"or"pending");--waitreplaces that state with the completed state when it succeeds within five minutes.
Paginated reads use the stable { "data": [...], "meta": { "total", "page", "per_page", "total_pages" } } envelope.
Exit codes
Examples
List managed sites (database rows merged with the [sites] overlay):
List quarantined rooms and reinstate one:
Inspect durable projection repairs. Rows in manual need operator attention;
successful repairs move to resolved:
Upgrade a comment room (the target version must be newer than the room's current version, e.g. upgrading a v11 room to 12):
List the chat command audit log (newest first), optionally filtered by actor:
Rotate a site's HMAC secret (printed once) or revoke it (destructive, needs
--yes):
Export a TOML block to move a database-tracked site into declarative configuration:
cumments sites packs stickers add my-blog default cat 'mxc://server/cat'
--body 'A cat' --info '{"w":10}'
cumments sites packs stickers remove my-blog default cat
Register or revoke a role. Role add-* commands store a pending claim and
print the one-time verify_token; the target Matrix account must DM
cumments-claim:<token> to the AS bot before the role is applied. Removal
uses the same local management use case as the API:
remove-* cancels a pending claim; a role that has already been applied is
removed from Matrix power levels directly. In matrix.mode = "logging" there
is no real homeserver, so the local claim row is updated but Matrix state is
not actually changed.
Retire a site (severe; requires both flags). The command marks the site
retiring — writes stop immediately — and the running server's
background reconciler retires its Matrix Space and rooms, then clears
the local data. Without --wait the command returns once the site is marked;
with --wait it polls until the retirement finishes (or times out after
five minutes). Config-declared sites cannot be retired; remove them from the
config file instead.
Shell completions
Generate a completion script and source it from your shell profile:
For example, with bash:
Safety
- Credential rotation is explicit but does not require a confirmation flag;
secret revocation requires
--yes. Whole-site retirement also requires the site id to be repeated with--confirm-site-id. - Page and room retirement require
--yes. database backups create --outputrefuses to overwrite an existing file.- Origins and secrets declared in
[sites]cannot be changed through the CLI (or the Operator API): edit the configuration file instead.