IF Commons GitHub

anyfs for the tier reader

POSIX-style access to any AnyFS store: ls, cat, cp, rm, find, grep and diff over a folder, a host reached by SSH or whatever a library brings, and sync, bisync and mirror between them, with every operation saying how it was carried out and every destruction a plan first.

Verbs

VerbWhat it doesEffectDrawn asNot drawn
lsList what is in a directory of a store, or say what a file is.readcli, mcp, rest
catWrite the bytes of files to standard output, byte for byte.readcli, mcp, rest
statSay what a name is in a store: its type, size, mode, time and revision.readcli, mcp, rest
headWrite the first lines (or bytes) of a file.readcli, mcp, rest
tailWrite the last lines (or bytes) of a file.readcli, mcp, rest
findFind names below a directory of a store by name, type and size.readcli, mcp, rest
duSay how many bytes are below a directory of a store.readcli, mcp, rest
treeDraw the directories and files below a directory of a store.readcli, mcp, rest
grepFind lines that hold a text in files of a store, within a limit of files and bytes.readcli, mcp, rest
diffShow how two files differ, as a unified diff; the exit says whether they do.readcli, mcp, rest
sha256sumSay the SHA-256 of the bytes of files in a store.readcli, mcp, rest
putWrite standard input or a local file as a file of a store.mutatenonecli: put is for the tier writer; this caller holds reader; mcp: put is for the tier writer; this caller holds reader; rest: put is for the tier writer; this caller holds reader
mkdirMake a directory of a store, where a store keeps directories that persist; else say what it did instead.mutatenonecli: mkdir is for the tier writer; this caller holds reader; mcp: mkdir is for the tier writer; this caller holds reader; rest: mkdir is for the tier writer; this caller holds reader
touchMake an empty file where there is none.mutatenonecli: touch is for the tier writer; this caller holds reader; mcp: touch is for the tier writer; this caller holds reader; rest: touch is for the tier writer; this caller holds reader
cpCopy files, and directories with -r, within a store or from one store to another.mutatenonecli: cp is for the tier writer; this caller holds reader; mcp: cp is for the tier writer; this caller holds reader; rest: cp is for the tier writer; this caller holds reader
mvMove files or directories, within a store or from one store to another: a copy that is checked, then the removal of the source.destructivenonecli: mv is for the tier writer; this caller holds reader; mcp: mv is for the tier writer; this caller holds reader; rest: mv is for the tier writer; this caller holds reader
rmRemove files, or directories and everything below them with -r.destructivenonecli: rm is for the tier writer; this caller holds reader; mcp: rm is for the tier writer; this caller holds reader; rest: rm is for the tier writer; this caller holds reader
syncMake a destination equal to a source: a plan first with its hash, then the apply that the hash approves.destructivenonecli: sync is for the tier writer; this caller holds reader; mcp: sync is for the tier writer; this caller holds reader; rest: sync is for the tier writer; this caller holds reader
checkCompare two directories by content and say what differs; changes nothing.readcli, mcp, rest
bisyncMake two directories equal both ways against a recorded base, with a rule for what both changed.destructivenonecli: bisync is for the tier writer; this caller holds reader; mcp: bisync is for the tier writer; this caller holds reader; rest: bisync is for the tier writer; this caller holds reader
mirror statusSay whether a replica is in sync with its primary, behind it, or has diverged.readcli, mcp, rest
mirror syncBring a replica to its primary, never touching what the replica changed itself.destructivenonecli: mirror sync is for the tier writer; this caller holds reader; mcp: mirror sync is for the tier writer; this caller holds reader; rest: mirror sync is for the tier writer; this caller holds reader
mirror promoteMake a replica the primary, saying what that loses.destructivenonecli: mirror promote is for the tier writer; this caller holds reader; mcp: mirror promote is for the tier writer; this caller holds reader; rest: mirror promote is for the tier writer; this caller holds reader
mergeBring two stores that merge together: a plan first with its hash (what each takes from the other), then the apply that the hash approves; there is no conflict to settle.destructivenonecli: merge is for the tier writer; this caller holds reader; mcp: merge is for the tier writer; this caller holds reader; rest: merge is for the tier writer; this caller holds reader
sync-mediumExchange a store that merges with a shared place: publish its new rows as delta files and take the files of the others.mutatenonecli: sync-medium is for the tier writer; this caller holds reader; mcp: sync-medium is for the tier writer; this caller holds reader; rest: sync-medium is for the tier writer; this caller holds reader
serveServe a place of a store as WebDAV on this computer, so that an operating system mounts it: it listens on the loopback with a token it prints to standard error, until it is stopped.mutatenonecli: serve is for the tier writer; this caller holds reader; mcp: serve is for the tier writer; this caller holds reader; rest: serve is for the tier writer; this caller holds reader
keygenMake the signing key of a replica: the key goes to a file for its owner only and is never printed, and the entry for the roster is printed.mutatenonecli: keygen is for the tier writer; this caller holds reader; mcp: keygen is for the tier writer; this caller holds reader; rest: keygen is for the tier writer; this caller holds reader
roster showSay each key of a roster file, the replica it speaks for and whether it speaks now.readcli, mcp, rest
roster addAdd the public keys of files (rosters, entries, signing keys) to a roster file.mutatenonecli: roster add is for the tier writer; this caller holds reader; mcp: roster add is for the tier writer; this caller holds reader; rest: roster add is for the tier writer; this caller holds reader
roster publishWrite a roster, public keys only, to a file of a store so that the others can fetch it.mutatenonecli: roster publish is for the tier writer; this caller holds reader; mcp: roster publish is for the tier writer; this caller holds reader; rest: roster publish is for the tier writer; this caller holds reader
roster fetchRead a roster from a store and take in only the new keys whose ids were accepted by name; show the others.mutatenonecli: roster fetch is for the tier writer; this caller holds reader; mcp: roster fetch is for the tier writer; this caller holds reader; rest: roster fetch is for the tier writer; this caller holds reader
roster rotateReplace a key: make a new key for the same replica, end the old one at an instant and start the new one after it.mutatenonecli: roster rotate is for the tier writer; this caller holds reader; mcp: roster rotate is for the tier writer; this caller holds reader; rest: roster rotate is for the tier writer; this caller holds reader
placesList the mounts of the configuration with their places, and what each kind of place is today.readcli, mcp, rest
doctorSay what is wrong with this computer's setup for the program, and the command for each.readcli, mcp, rest
trust-hostShow the host key a target presents, and record it once you have checked its fingerprint.mutatenonecli: trust-host cannot be shown: the tier public is not on the ladder of this program; mcp: trust-host cannot be shown: the tier public is not on the ladder of this program; rest: trust-host cannot be shown: the tier public is not on the ladder of this program
mcpServe the verbs the held tier sees as tools of a tool server on standard input and output.readcli, mcp, rest

Problem codes

CodeMeaning
E-APPLY-FAILEDSome of the plan did not apply: At least one action failed or was skipped; the report says which and why.
E-CONFIG-INVALIDThe configuration is not valid: The file exports a configuration that does not fit its type: a mount name that is not a word, a place that does not parse, or a limit out of range.
E-CONFIG-LOADThe configuration could not be loaded: The file anyfs.config.ts exists but importing it failed.
E-CONFLICTSThe plan has conflicts: Some names changed on both sides or collide, so the plan will not apply them unasked.
E-DIFFERENTThe two differ: diff or check found that the two sides are not the same.
E-ENVIRONMENTThe program cannot do it here: The setup of this computer does not allow the verb to run: a store could not be reached or a tool it needs is missing.
E-FILES-ASIDESome deltas were set aside: The exchange finished, but some delta files were refused or are waiting for rows that are not here yet.
E-FILESYSTEMThe operation failed: The store refused an operation, in the words of a file system: ENOENT, EEXIST, EISDIR, ENOTDIR, ENOTEMPTY, EROFS, EXDEV, ENOTSUP, ESTALE or another errno.
E-LOCATIONThat is not a place the program can read: A word given as a place is neither a path, a mount (name:/path) nor an address of a store (ssh://host/path, memory:name).
E-MERGE-REFUSEDThe merge was refused: The merge was not made: a store cannot merge, a rail was crossed, or the plan changed since it was approved.
E-MOUNT-UNKNOWNNo mount has that name: A word of the form name:/path names a mount the configuration does not hold.
E-OPENThe store could not be opened: The place is of a kind the program has, but opening its store failed.
E-PLACE-UNAVAILABLENo store for that kind of place yet: The place parses, but no opener of a store for its kind is installed in this program.
E-PLAN-REFUSEDNo plan was made: The plan was refused before it was made: a rail was crossed, the deletes were over their allowance, something would be lost, or a store lacks what the mode needs.
E-PLAN-STALEThe plan changed: The hash that was approved is not the hash of the plan made now: a store changed since the plan was looked at.
E-REPLICA-DIVERGEDA replica changed on its own: The replica holds changes the primary does not, so a sync would lose them.
E-STRICTThe operation would be emulated or refused: --strict stops where the store carries an operation out by a means that can lose or change what you meant, or refuses it.
E-SYNC-FAILEDThe exchange did not finish: Publishing or taking deltas through the shared place stopped on a problem.
E-TRUSTThe host key is not trusted yet: The host presents a key this computer has not recorded, and the program never accepts one on its own.
E-USAGEThe command line does not fit: A verb was given words, options or operands it does not take.
E000-FAILEDThe code a problem of the level fail carries when its raiser gave none.
E000-WARNINGThe code a problem of the level warn carries when its raiser gave none.
E000-YOURSThe code a problem of the level action carries when its raiser gave none.
P000-WAITINGThe code a problem of the level pending carries when its raiser gave none.

Exit statuses

OutcomeMeaning
okStatus 0: it did what it was asked, and nothing needs attention.
findingsStatus 1: it ran, and found something wrong (a failed check, a drift, a failure).
usageStatus 2: the command line was wrong, or the action was refused (a missing confirmation, a human-only option).
environmentStatus 3: something the run needs is missing or unreachable (a tool, a file, a network).
pendingStatus 4: nothing failed, but something is not set up yet and waits on time or on someone else.
startup-usageStatus 64: the program could not start: it was started wrongly (EX_USAGE).
startup-unavailableStatus 69: the program could not start: a service it needs is not available (EX_UNAVAILABLE).
startup-softwareStatus 70: the program could not start: an internal error (EX_SOFTWARE).
startup-osfileStatus 72: the program could not start: a file it needs is missing or unreadable (EX_OSFILE).
startup-configStatus 78: the program could not start: its configuration is wrong (EX_CONFIG).
interruptedStatus 130: it was stopped by the person (SIGINT).
terminatedStatus 143: it was stopped by the system (SIGTERM).

Titles, headings, exports, tables, columns and requirements. Esc closes.