Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Groups, documents, claims and keys

Source: pkgs/id/crates/id-cli/src/cli/mod.rs, pkgs/id/crates/id-cli/src/cli/groups.rs, pkgs/id/crates/id-cli/src/cli/doc.rs, pkgs/id/crates/id-cli/src/cli/claim.rs, pkgs/id/crates/id-cli/src/cli/writer_sets.rs under https://github.com/developing-today/code/blob/main/pkgs/id/crates/id-cli/src/cli/mod.rs — provenance only; this chapter is complete without following it.

This chapter covers the event-backed identity surface of id: group with delegate and revoke; doc; claim; writer-sets; and the identity commands id, key, keyset and peers. The concepts behind them are in Identity, the directory and groups and Events and the signed audit chain. The event-backed claims here are a separate store from the file tags of The tag family.

Two global flags place the stores (see The id command line and Configuration and environment):

FlagArgumentDefaultMeaning
--groups-logfile pathgroups.jsonl in the data dirThe group log for group, delegate and revoke. A relative path is relative to the data dir.
--event-storedirectory pathevents in the data dirThe event store for doc, claim and writer-sets. A relative path is relative to the data dir.

group, doc, claim and writer-sets each take a --json flag that is global to that parent command: it may appear before or after the subcommand. With --json, an action prints one JSON object; group list, doc lists, claim list/search and writer-sets discover print one JSON array. delegate and revoke are top-level commands with their own --json flag.

Exit behaviour, all commands in this chapter unless a command states otherwise: success exits 0; a handler error prints Error: <message> to stderr and exits 1; a clap parse error prints the error and usage to stderr and exits 2. Accounts and groups are 64 hex characters throughout. The toy group used in the examples is the invented ID 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef; the toy accounts are fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 and 1111111111111111111111111111111111111111111111111111111111111111.

group

Each group action records one event in the group log and prints one line, or one JSON object with --json. A refused action exits non-zero, and its event stays in the log.

The role vocabulary used by group add, group role and delegate is one ordered enum, least to most: pull (replicates ciphertext without keys), read (reads content), write (edits content), manage (adds and removes members), admin (manages, and changes roles and the policy record).

group create

Creates a group. A normal group makes its creator Admin. A friendship names its other side with --with, has no Admin unless --admins-on-create, and is active once the other side accepts.

id group create [--template <normal|friendship>] [--with <ACCOUNT>] [--max <N>] [--admins-on-create]
FlagArgumentDefaultMeaning
--templatenormal|friendshipnormalThe kind of group to create.
--withaccount (64 hex)— (none)The other side of a friendship. Required for --template friendship.
--maxinteger— (none; no cap)The most members the group may have, counting the creator. Normal groups only.
--admins-on-createswitchoffMake both friends Admin (friendships).
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example — a normal toy group capped at 8 members, and a toy friendship:

$ id group create --max 8
$ id group create --template friendship \
    --with fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210

Failures: a friendship without --with fails the command, exit 1. A friendship with --max fails with a friendship has two members, so it takes no --max, exit 1. An unknown --template value is a clap error, exit 2.

group policy

Shows a group’s policy record.

id group policy <GROUP>
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
--jsonswitchoffParent flag: print one JSON object instead of a line.

This subcommand takes no flags of its own.

Example:

$ id group policy 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef

Failures: an unknown group fails the command, exit 1.

group list

Lists the groups in the log, one line each, or one JSON array with --json.

id group list
FlagArgumentDefaultMeaning
--jsonswitchoffParent flag: print one JSON array instead of one line per group.

This subcommand takes no arguments and no flags of its own.

Example:

$ id group list --json

Failures: none specific to this subcommand beyond the common exit behaviour.

group add

Adds a member with a role. The author must be a manager of the group.

id group add <GROUP> <MEMBER> [--role <ROLE>]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<MEMBER>account (64 hex)required positionalThe account to add.
--rolepull|read|write|manage|adminreadThe member’s role.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example:

$ id group add 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 --role write

Failures: an author who is not a manager is refused, exit 1, and the refused event stays in the log. An unknown --role value is a clap error, exit 2. Granting admin requires an Admin author, exit 1 when refused.

group remove

Removes a member. Removing yourself is leaving. The group’s default mode is used when --mode is omitted.

id group remove <GROUP> <MEMBER> [--mode <MODE>] [--successor-kind <KIND>] [--successor <ACCOUNT>]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<MEMBER>account (64 hex)required positionalThe account to remove.
--modeserver-default|revoke|transfer|keep-prior|reassign-to-groupthe group’s configured remove defaultGrant-disposition mode. server-default is resolved to the group’s configured default before the event is recorded. revoke ends the removed member’s grants. transfer reissues the grants to a successor. keep-prior retains grants under their original grantor (a re-add starts clean: pre-removal grants do not revive and must be re-issued). reassign-to-group re-anchors grants at the group.
--successor-kindmember|admin|designated|actormemberThe successor category for --mode transfer: a named member, a group administrator, a designated account, or the account performing the removal. The successor flags require --mode transfer.
--successoraccount (64 hex)— (none)The account for a member or designated transfer successor. Requires --mode transfer.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example — remove a toy member and transfer the member’s grants to a named successor:

$ id group remove 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --mode transfer --successor-kind member \
    --successor 1111111111111111111111111111111111111111111111111111111111111111

Failures: a mode or successor category the group’s policy does not allow is refused, exit 1, and the refused event stays in the log. Giving --successor or --successor-kind without --mode transfer fails the command, exit 1. An unknown --mode value is a clap error, exit 2.

group role

Sets a member’s role. The subcommand name is role. Only an Admin may use it.

id group role <GROUP> <MEMBER> <ROLE>
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<MEMBER>account (64 hex)required positionalThe member whose role changes.
<ROLE>pull|read|write|manage|adminrequired positionalIts new role.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example:

$ id group role 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 manage

Failures: a non-Admin author is refused, exit 1, and the refused event stays in the log. An unknown role value is a clap error, exit 2.

group join

Parses an invitation ticket, then always fails. Group admission and network joining are not implemented: no group membership is ever recorded by this command. This is the source behaviour, and it contradicts the top-level help, which lists join among the things group can do (disagreement CLI-9). The subcommand’s own help states the truth in its first line: Unavailable: group admission and network joining are not implemented yet.

id group join <INVITE>
FlagArgumentDefaultMeaning
<INVITE>ticket or link stringrequired positionalThe pasted ticket or link. It is parsed, and nothing further happens.
--jsonswitchoffParent flag. It does not change the outcome: the command still fails.

Example — the outcome is the same for every well-formed ticket (<ticket> stands for one):

$ id group join <ticket>
Error: group join is unavailable: invitation parsing works, but admission and network acceptance are not implemented yet; no group membership was recorded

(exit 1.)

Failures: this command has no success path. A malformed ticket fails earlier, with the invitation parse error, exit 1. A well-formed ticket fails with the group join is unavailable: ... message above, exit 1.

delegate

Grants a delegate a scope in a group, with the group’s delegation mode. It prints the grant’s event ID; that ID is the <GRANT> argument of revoke.

id delegate <GROUP> <GRANTEE> [--scope <ROLE>] [--redelegate] [--mode <MODE>] [--json]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<GRANTEE>account (64 hex)required positionalThe account that is granted the scope.
--scopepull|read|write|manage|adminreadThe scope to grant.
--redelegateswitchoffLet the grantee pass the scope on to others. Only a redelegatable grant extends a chain.
--modekeep_prior|cascade|transfer— (none)The group’s delegation mode, set first if it differs. The spellings use underscores. cascade is the delegation default in the group policy layer.
--jsonswitchoffPrint JSON instead of a line.

Example:

$ id delegate 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --scope write --redelegate

Failures: a grant the author is not authorised to make is refused, exit 1. An unknown --scope or --mode value is a clap error, exit 2. Note the mode spellings: --mode keep-prior (with a hyphen) is the spelling of group remove --mode; delegate --mode takes keep_prior (with an underscore). The hyphen form here is a clap error, exit 2.

revoke

Revokes a delegation by its grant’s event ID, as delegate printed it.

id revoke <GROUP> <GRANT> [--json]
FlagArgumentDefaultMeaning
<GROUP>group ID (64 hex)required positionalThe group.
<GRANT>event IDrequired positionalThe grant’s event ID, as id delegate printed it.
--jsonswitchoffPrint JSON instead of a line.

Example:

$ id revoke 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
    toy-grant-event-id

(The grant value above is a toy placeholder; use the event ID a real delegate printed.)

Failures: an unknown grant ID fails the command, exit 1.

doc

Each document action signs one event into the event store (the global --event-store) and prints one line, or one JSON object with --json. The store stands in for sync: nodes that share it see each other’s events. A document is a document.put event over the content’s hash. Lists print one line per row, or one JSON array with --json.

doc publish

Publishes a file as a document, and sets a tag for each --tag.

id doc publish <FILE> --media-type <TYPE> [--tag <NAME[=VALUE]>]...
FlagArgumentDefaultMeaning
<FILE>file pathrequired positionalThe file to publish.
--media-typemedia type string, e.g. text/markdownrequiredThe media type of the file. Omitting it is a clap error, exit 2.
--tagNAME or NAME=VALUE— (none)A tag to set on the document; repeatable. The flag name is --tag.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Behaviour: prints publish document=<ID>, the document’s event ID. The file’s bytes are hashed, and the event names their hash and size. The bytes are not stored in the event: publish stores them in the blob store under their hash, so doc content can fetch them back.

Example:

$ id doc publish ./toy-notes.md --media-type text/markdown --tag topic=toy-plans
publish document=toy-document-event-id

(The document ID above is a toy placeholder for the event ID a real publish prints.)

Failures: a missing file fails the command, exit 1. Omitting --media-type is a clap error, exit 2.

doc events

Lists the tags and removal on a document, in causal order.

id doc events <DOCUMENT>
FlagArgumentDefaultMeaning
<DOCUMENT>event IDrequired positionalThe document’s event ID, as publish printed it.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id doc events toy-document-event-id

Failures: an unknown document ID fails the command, exit 1.

doc frontier

Lists the head of each author’s chain: the latest event each author has recorded. It takes no arguments.

id doc frontier
FlagArgumentDefaultMeaning
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id doc frontier --json

Failures: none specific to this subcommand beyond the common exit behaviour.

doc history

Lists a document’s events in causal order, its document.put first.

id doc history <DOCUMENT>
FlagArgumentDefaultMeaning
<DOCUMENT>event IDrequired positionalThe document’s event ID, as publish printed it.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id doc history toy-document-event-id

Failures: an unknown document ID fails the command, exit 1.

doc content

Prints a document’s blob bytes, by document event ID. It resolves the document.put event to the content hash it names and exports the bytes the publish step stored.

id doc content <DOCUMENT> [OUTPUT]
FlagArgumentDefaultMeaning
<DOCUMENT>event IDrequired positionalThe document’s event ID, as publish printed it.
[OUTPUT]file path, or -- (stdout)Output path, or - for stdout.
--jsonswitchoffParent flag (effect on this subcommand’s byte output: unverified).

Example — write a toy document back out to a file, and to stdout:

$ id doc content toy-document-event-id ./toy-notes-copy.md
$ id doc content toy-document-event-id

Failures: an unknown document ID fails the command, exit 1. An unwritable output path fails the command, exit 1.

claim

A claim is a signed tag.set event that sets a tag on a subject, where a subject is any event ID, such as a document’s. clear removes the live claims it names. Claims live in the event store (the global --event-store).

Scope: a claim is shared (published to peers, the default) or local (kept on this node only, never published or synced).

claim set

Sets a tag on a subject.

id claim set <SUBJECT> <NAME> [VALUE] [--scope <shared|local>]
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
<NAME>tag namerequired positionalThe tag name. A local: prefix is shorthand for --scope local when --scope is absent.
[VALUE]string— (none)The tag value. Without one, the tag is bare.
--scopeshared|localsharedWhether the claim is shared with peers or stays on this node. An explicit --scope wins over a local: name prefix: with --scope shared, a name written local:NAME is a shared claim whose name keeps the prefix.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Example — a shared toy claim, and the same claim kept local by the prefix shorthand:

$ id claim set toy-document-event-id topic toy-plans
$ id claim set toy-document-event-id local:topic toy-plans

Failures: none specific to this subcommand beyond the common exit behaviour.

claim clear

Clears the live claims with this name on a subject, whoever set them.

id claim clear <SUBJECT> <NAME>
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
<NAME>tag namerequired positionalThe tag name.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Behaviour: clearing stops future replication. It cannot unsend copies peers already hold.

Example:

$ id claim clear toy-document-event-id topic

Failures: none specific to this subcommand beyond the common exit behaviour.

Lists the live claims with this name, and value if given, on any subject.

id claim search <NAME> [VALUE]
FlagArgumentDefaultMeaning
<NAME>tag namerequired positionalThe tag name.
[VALUE]string— (none)The tag value to match as a whole. Without one, any value and a bare tag match.
--jsonswitchoffParent flag: print one JSON array instead of lines.

Example:

$ id claim search topic toy-plans --json

Failures: none specific to this subcommand beyond the common exit behaviour.

claim scope

Changes the scope of this node’s claims with this name on a subject.

id claim scope <SUBJECT> <NAME> <shared|local> [--yes]
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
<NAME>tag namerequired positionalThe tag name.
<SCOPE>shared|localrequired positionalThe target scope. It is explicit, so it wins over any local: prefix shorthand used when a claim was set.
--yesswitchoffConfirm publishing local claims as shared. Required when the move would publish a local claim: publishing cannot be undone.
--jsonswitchoffParent flag: print one JSON object instead of a line.

Behaviour: moving to local stops future replication but cannot unsend copies peers already hold. Moving to shared publishes this node’s local claims and cannot be undone.

Example:

$ id claim scope toy-document-event-id topic shared --yes

Failures: moving to shared when a local claim would be published, without --yes, is refused, exit 1. An unknown scope value is a clap error, exit 2.

claim review

Reviews every live claim visible to this node, with its scope. It takes no arguments.

id claim review
FlagArgumentDefaultMeaning
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id claim review

Failures: none specific to this subcommand beyond the common exit behaviour.

claim list

Lists the live claims on a subject.

id claim list <SUBJECT>
FlagArgumentDefaultMeaning
<SUBJECT>event IDrequired positionalThe subject’s event ID.
--jsonswitchoffParent flag: print one JSON array instead of lines.

Example:

$ id claim list toy-document-event-id

Failures: none specific to this subcommand beyond the common exit behaviour.

writer-sets

Writer sets stored in the event store (the global --event-store). A writer set is a signed idset.writer event whose body the store retains at ingest. show prints the stored object, expand runs the view projection over the store’s resolved group state at the set’s own publishing frontier, and discover lists every stored set for a scope with the writers each expands to. --resolution names the resolution snapshot the projection is pinned under; without one, the zero hash names the store’s current resolved state.

writer-sets show

Shows one stored writer set: its ID, version, owner, scope, and the counts of its admission entries and exclusions.

id writer-sets show <EVENT>
FlagArgumentDefaultMeaning
<EVENT>event IDrequired positionalThe publishing event’s ID.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id writer-sets show toy-writer-set-event-id

Failures: an unknown event ID fails the command, exit 1.

writer-sets expand

Expands one stored writer set at its publishing frontier: whether the expansion is public, and the explicit authors it admits after exclusions.

id writer-sets expand <EVENT> [--resolution <HEX>] [--retro]
FlagArgumentDefaultMeaning
<EVENT>event IDrequired positionalThe publishing event’s ID.
--resolutionhex string— (none; the zero hash)The resolution snapshot to pin the projection under, as hex. Without one, the zero hash names the store’s current resolved state.
--retroswitchoffExpand retroactively: only entries marked include-history contribute. Exclusions always apply.
--jsonswitchoffParent flag: print one JSON object instead of lines.

Example:

$ id writer-sets expand toy-writer-set-event-id --retro

Failures: an unknown event ID fails the command, exit 1.

writer-sets discover

Discovers stored writer sets by scope: one row per set, with the writers it expands to.

id writer-sets discover [--scope <SCOPE>] [--resolution <HEX>]
FlagArgumentDefaultMeaning
--scopestring— (none; all sets)The scope (subject) to match, exactly. Without --scope, every stored set matches.
--resolutionhex string— (none; the zero hash)The resolution snapshot to pin each expansion under, as hex. Without one, the zero hash names the store’s current resolved state.
--jsonswitchoffParent flag: print one JSON array instead of lines.

Example:

$ id writer-sets discover --scope toy-metrics

Failures: none specific to this subcommand beyond the common exit behaviour.

id

Prints the local node’s public ID. The command name collides with the binary name by design: the invocation is id id. The node ID is derived from the keypair and is what remote nodes connect to.

id id [--client]
FlagArgumentDefaultMeaning
--clientswitchoffPrint the client identity instead of the server identity. The client identity is the one this machine uses when connecting to other nodes; a server owner adds it with id serve --allow-node <ID> so this machine may write to that server.

Example:

$ id id
$ id id --client

Each prints one node ID (64 hex characters) on stdout.

Failures: none specific to this command beyond the common exit behaviour.

key

Exports or imports a local identity key. Passphrases are always hidden prompts, never flags: no key subcommand accepts a passphrase on the command line. A passphrase must be at least 8 bytes; the exact refusal is passphrase must be at least 8 bytes. A mismatched confirmation is refused with passphrases do not match. A key file that is not 32 bytes is refused with <path> is not a 32-byte key file.

key export

Exports the server identity (or, with --client, the client identity) to an encrypted file. The passphrase is entered at a hidden prompt.

id key export <OUTPUT> [--client]
FlagArgumentDefaultMeaning
<OUTPUT>file pathrequired positionalDestination for the encrypted key envelope.
--clientswitchoffExport the client identity instead of the server identity.

Example:

$ id key export ./toy-server-key-envelope
Passphrase: (hidden prompt)

Failures: a passphrase under 8 bytes, or a confirmation that does not match, fails the command, exit 1, and no envelope is written by that attempt.

key import

Imports an encrypted key envelope as the server or client identity. The passphrase is entered at a hidden prompt.

id key import <INPUT> [--client] [--replace]
FlagArgumentDefaultMeaning
<INPUT>file pathrequired positionalThe encrypted key envelope to import.
--clientswitchoffImport as the client identity instead of the server identity.
--replaceswitchoffReplace an existing identity key file atomically.

Example:

$ id key import ./toy-server-key-envelope --replace
Passphrase: (hidden prompt)

Failures: a wrong passphrase fails the command, exit 1. An existing identity key file without --replace fails the command, exit 1.

key export-seed

Prints the server identity (or, with --client, the client identity) as a 24-word seed phrase. The phrase is the key: anyone holding it holds the identity. It is printed once, never written to a file by this command, and never taken on the command line.

id key export-seed [--client]
FlagArgumentDefaultMeaning
--clientswitchoffExport the client identity instead of the server identity.

Example:

$ id key export-seed --client

The output is the 24-word phrase on stdout, once. This chapter does not print an example phrase: a seed phrase is a secret value, and only its shape (24 words, printed once, no file written) is documented here.

Failures: none specific to this subcommand beyond the common exit behaviour.

key import-seed

Restores the server or client identity from a 24-word seed phrase entered at a hidden prompt, never on the command line.

id key import-seed [--client] [--replace]
FlagArgumentDefaultMeaning
--clientswitchoffImport as the client identity instead of the server identity.
--replaceswitchoffReplace an existing identity key file atomically.

Example:

$ id key import-seed --replace
Seed phrase: (hidden prompt)

Failures: a phrase that does not decode to a key fails the command, exit 1. An existing identity key file without --replace fails the command, exit 1.

keyset

Shows or changes this identity’s keyset: its admin key and the device keys allowed to act for it. Each subcommand acts on the server identity, or the client identity with --client, and signs with that identity’s key, which must be an active admin key of the keyset to change it.

First use: the first keyset use migrates a single-key account by writing a genesis record signed by the existing key. The identity ID does not change.

Every keyset subcommand takes --client except keyset recovery status, which has no --client flag at all.

keyset show

Prints the identity ID, admin keys and device keys.

id keyset show [--client]
FlagArgumentDefaultMeaning
--clientswitchoffShow the client identity’s keyset instead of the server’s.

Example:

$ id keyset show

Failures: none specific to this subcommand beyond the common exit behaviour, apart from the first-use migration described above, which is not a failure.

keyset enrol

Enrols another device key. The device’s 32-byte key file is read to countersign the enrolment, proving the device holds the key.

id keyset enrol <DEVICE_KEY_FILE> --label <NAME> [--client]
FlagArgumentDefaultMeaning
<DEVICE_KEY_FILE>file pathrequired positionalThe new device’s key file (the .iroh-key it was created with).
--labelstringrequiredA name for the device, shown by id keyset show. Omitting it is a clap error, exit 2.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Example:

$ id keyset enrol ./toy-device.iroh-key --label toy-laptop

Failures: a device key file that is not 32 bytes is refused with <path> is not a 32-byte key file, exit 1. A signing key that is not an active admin key of the keyset is refused, exit 1.

keyset revoke

Revokes a device key, given as its hex public key. Records it signed before the revocation stay valid history.

id keyset revoke <DEVICE_KEY> [--reason <TEXT>] [--client]
FlagArgumentDefaultMeaning
<DEVICE_KEY>hex public keyrequired positionalThe device’s hex public key, as id keyset show prints it.
--reasontextrevokedWhy it was revoked, kept in the record.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Example:

$ id keyset revoke fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --reason "toy device retired"

Failures: an unknown device key fails the command, exit 1. A signing key that is not an active admin key of the keyset is refused, exit 1.

keyset rotate

Hands admin power to another key. The new key’s 32-byte key file is read to countersign the rotation; afterwards this key can no longer change the keyset.

id keyset rotate <NEW_ADMIN_KEY_FILE> [--client]
FlagArgumentDefaultMeaning
<NEW_ADMIN_KEY_FILE>file pathrequired positionalThe new admin key’s key file.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Example:

$ id keyset rotate ./toy-new-admin.iroh-key

Failures: a new admin key file that is not 32 bytes is refused with <path> is not a 32-byte key file, exit 1. A signing key that is not an active admin key of the keyset is refused, exit 1.

keyset guardians

Names the guardians who can approve a recovery of this identity, and how many must approve.

id keyset guardians <GUARDIANS>... --threshold <N> [--client]
FlagArgumentDefaultMeaning
<GUARDIANS>...identity IDs (hex public keys)required positional, at least oneEach guardian’s identity ID.
--thresholdintegerrequiredHow many of the guardians must approve a recovery. Omitting it is a clap error, exit 2.
--clientswitchoffChange the client identity’s keyset instead of the server’s.

Behaviour: adding guardians or raising the threshold takes effect at once. Removing a guardian or lowering the threshold waits out the recovery delay, so a stolen admin key cannot swap in guardians of its own.

Example:

$ id keyset guardians \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    1111111111111111111111111111111111111111111111111111111111111111 \
    --threshold 2

Failures: a signing key that is not an active admin key of the keyset is refused, exit 1.

keyset checkpoint

Checkpoints the current keyset head with this identity’s key, which must be an active device key. The head becomes final here: a fork that later arrives can no longer displace it.

id keyset checkpoint [--client]
FlagArgumentDefaultMeaning
--clientswitchoffCheckpoint the client identity’s keyset instead of the server’s.

Example:

$ id keyset checkpoint

Failures: a signing key that is not an active device key is refused, exit 1.

keyset recovery

Guardian recovery of an identity whose keys are all lost. Records go through a recovery relay file, which attests when it first saw each one; share that file among the devices and guardians taking part. --relay is required on all six recovery subcommands; omitting it is a clap error, exit 2. Each recovery subcommand signs with this device’s identity key, or the client key with --client — except status, which takes no --client.

keyset recovery publish

Copies this identity’s keyset records into the relay, so a successor can pin its head and its approvals can be checked. Owners and guardians both publish.

id keyset recovery publish --relay <FILE> [--client]
FlagArgumentDefaultMeaning
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffPublish the client identity’s keyset instead of the server’s.

Example:

$ id keyset recovery publish --relay ./toy-relay.json

Failures: an unwritable relay file fails the command, exit 1.

keyset recovery request

From a new device, asks the guardians of an identity to recover it. This device’s key becomes the identity’s admin and device key once enough guardians approve and the recovery delay has passed.

id keyset recovery request <IDENTITY> --relay <FILE> [--reason <TEXT>] [--client]
FlagArgumentDefaultMeaning
<IDENTITY>hex identity IDrequired positionalThe identity to recover (its hex identity ID).
--relayfile pathrequiredThe recovery relay file.
--reasontextlost every keyWhy, shown to every device and guardian told of the request.
--clientswitchoffSign with the client key instead of the server key.

The command prints the request ID; that ID is the <REQUEST> argument of approve, cancel, status and complete.

Example:

$ id keyset recovery request \
    fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210 \
    --relay ./toy-relay.json

Failures: an identity with no keyset records in the relay fails the command, exit 1.

keyset recovery approve

As a guardian, approves a recovery request. Also publishes this guardian identity’s keyset, so the approval can be checked.

id keyset recovery approve <REQUEST> --relay <FILE> [--client]
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID, as request printed it.
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffApprove as the client identity instead of the server’s.

Example:

$ id keyset recovery approve toy-request-id --relay ./toy-relay.json

Failures: a signer who is not a named guardian of the identity is refused, exit 1. An unknown request ID fails the command, exit 1.

keyset recovery cancel

Cancels a recovery request with any surviving admin or device key of the identity being recovered.

id keyset recovery cancel <REQUEST> --relay <FILE> [--client]
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID.
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffSign with the client key instead of the server key.

Example:

$ id keyset recovery cancel toy-request-id --relay ./toy-relay.json

Failures: a signer holding no surviving admin or device key of the identity is refused, exit 1. An unknown request ID fails the command, exit 1.

keyset recovery status

Shows where a recovery request stands. This is the one keyset subcommand with no --client flag; passing --client is a clap error, exit 2.

id keyset recovery status <REQUEST> --relay <FILE>
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID.
--relayfile pathrequiredThe recovery relay file.

Example:

$ id keyset recovery status toy-request-id --relay ./toy-relay.json

Failures: an unknown request ID fails the command, exit 1.

keyset recovery complete

On the requesting device, completes a recovery that is ready by relaying the rotation to the successor keys.

id keyset recovery complete <REQUEST> --relay <FILE> [--client]
FlagArgumentDefaultMeaning
<REQUEST>request IDrequired positionalThe request ID.
--relayfile pathrequiredThe recovery relay file.
--clientswitchoffSign with the client key instead of the server key.

Example:

$ id keyset recovery complete toy-request-id --relay ./toy-relay.json

Failures: a request that is not ready — too few guardian approvals, or the recovery delay has not passed — fails the command, exit 1. An unknown request ID fails the command, exit 1.

peers

Discovers and lists known peers. It discovers other id servers via gossip-based networking, RPC queries to a running serve instance, or both, and supports depth-based recursive crawling to find peers-of-peers.

id peers [NODE] [OPTIONS]
FlagArgumentDefaultMeaning
[NODE]64 hex characters— (none; the local serve)Remote node ID to query. When set, queries this specific node instead of the local serve instance.
--gossipswitchoffGossip-only discovery: join the topic and collect announcements, bypassing RPC entirely. Useful when no local serve is running.
--rpcswitchoffRPC-only discovery: query the server’s ListPeers RPC. Fails if no local serve is running, unless a node ID is given.
--depthinteger, 0..1Recursive depth for peer-of-peer crawling. 0 = no crawl, 1 = query direct peers, N = recursively query up to N levels deep. A negative value fails: clap’s value parser rejects it (the handler also refuses a negative depth).
--max-peersinteger1000Maximum total peers to discover. A hard cap to prevent unbounded crawling.
--timeoutinteger (seconds)30Per-crawl timeout in seconds.
--bootstrapcomma-separated node IDs— (none)Node IDs for gossip bootstrapping, supplementary to DHT auto-discovery. These nodes are contacted first when joining the gossip topic.
--topicstringfrom defaults.json, else the constant id-peer-discovery-v1Gossip topic name for peer discovery. Use a custom topic for private networks.
--topic-secretstringfrom defaults.json, else the constant id-public-discovery-v1Shared secret for topic access control, used to encrypt DHT bootstrap records. The value is never echoed.
--no-default-bootstrapswitchoffSkip default bootstrap node IDs from defaults.json; only CLI-provided --bootstrap nodes are used.
--no-default-topicswitchoffSkip the topic and secret from defaults.json; fall back to the hardcoded constant values.
--no-relayswitchoffDisable relay servers and use direct connections only.
--no-mdnsswitchoffDisable mDNS local peer discovery, which is on by default.
--abuseswitchoffShow the local serve instance’s per-peer abuse counters instead of listing peers: frames and bytes admitted by the abuse evaluator, split by direction, with the policy rates shown alongside. Read-only. Local serve only; cannot be combined with --gossip or a remote [NODE]. The counters cover world-protocol traffic only: a serve running without --world records none and the report is empty.

Behaviour: the default mode is RPC-then-gossip: try RPC (query the local serve), then gossip as fallback. --rpc and --gossip each pin one mode. The topic and topic-secret defaults follow the same resolution as serve: file defaults from defaults.json are consulted first and the named constants are the fallback, which is why --no-default-topic exists (the same pattern as disagreement CLI-6 for serve).

Examples — list peers from the local serve, crawl three levels deep, and discover directly by gossip on a toy private topic:

$ id peers
$ id peers --depth 3
$ id peers --gossip --topic toy-net
$ id peers --abuse

Failures: an invalid [NODE] fails with invalid node ID: must be 64 hex characters, exit 1. --rpc with no local serve running and no node ID fails the command, exit 1. --abuse combined with --gossip or a remote [NODE] fails the command, exit 1. A negative --depth is a clap error, exit 2.