Guides

Push and pull

Send what the CLI read to your company's Spendyard Cloud, bring corrections made there back, and what happens when both sides changed a document.

The CLI keeps what it reads on your machine. Two commands move it to and from your company’s Spendyard Cloud, and only when you run them: reading and scanning never send anything on their own.

spendyard mailbox scan outlook    # into ~/.spendyard, as always
spendyard cloud push              # what's new or changed since the last push, originals included
spendyard cloud pull              # corrections made in the cloud, for the documents this machine has

You need to be signed in with spendyard cloud login, as an owner, admin or member. Accountants can’t push.

Push

spendyard cloud push sends, for each document read since the last push:

  • the document’s facts: its name, sender, when it came, and its SHA-256;
  • its reading, what was read from it, which the cloud turns into its own rows with the same code;
  • its corrections, when you made any with documents edit;
  • its original, the file itself, when the cloud doesn’t have it yet.

A document read again, or corrected, since the last push goes up again. Nothing else does: not payments, not where a mailbox scan got to. The cloud works out payments, vendors and subscriptions from everything the company has, and no credits are used for documents the CLI already read.

Each document once

A document is the same document wherever its bytes are the same, so it’s matched by its SHA-256; an email also by its Message-ID. Pushing twice, or two people pushing the same receipt, or pushing one that was also forwarded, keeps it once. Its number on your machine and in the cloud differ, and that’s fine.

Try it first

spendyard cloud push --dry-run

asks the cloud what it would do with each document (add it, already have it, keep the reading or the correction or not, want the original) and keeps nothing on either side.

Pull

spendyard cloud pull brings back the corrections made in the dashboard (marked personal or ignored, another vendor, a note) to the documents this machine has. It doesn’t download the company’s documents: those are seen with spendyard cloud documents, and the local store stays what this machine read.

spendyard cloud pull --dry-run    # what it would change here, field by field
spendyard cloud pull

Both sides corrected it

The newer correction wins, whichever side it was made on: push keeps yours when it’s newer than the cloud’s, and pull keeps the cloud’s when it’s newer than yours. A correction is taken whole, not field by field.

Deleting isn’t sent either way. A document deleted on your machine stays in the cloud, and one deleted in the cloud stays on your machine.

Another organisation

spendyard cloud switch <slug> makes the CLI act in another of your organisations. What was pushed to one isn’t in the other, so the first push there sends everything.