The Lore CLI

@uselore/cli is a small command-line tool for taking your knowledge base out of Lore. It signs in through your browser and downloads everything — every entry of every status, with its sections, tags, your entry types, statuses and settings, and by default your margin comments — as one JSON file. A person can run it, and so can a coding agent working in a terminal on your behalf.

npx @uselore/cli login
npx @uselore/cli export

That is the whole of it. To install it once instead, run npm install -g @uselore/cli and then use lore directly. It needs Node 22 or later. The same file is also available from Settings → Export in the Lore web app.

Commands

lore login

Opens Lore's sign-in page in your browser. Sign in with your password or Google as usual; the page tells you the CLI is asking to download and import your entire knowledge base. The CLI then keeps a sign-in for this machine. --no-browser prints the link instead of opening it, for when the CLI can't launch a browser itself. Either way, sign in with a browser on the same machine as the CLI: Lore hands the sign-in back to it at 127.0.0.1, so a browser elsewhere — at the other end of an SSH session, or outside a container — can't complete it.

lore export

Downloads the whole knowledge base to lore-export-YYYY-MM-DD.json, or to the file named with -o. --no-comments leaves out margin comments; --no-vectors leaves out the stored search vectors, which make the file larger and are only useful to Lore itself. From version 0.1.1 it never replaces a file that already exists unless you add --force.

lore whoami · lore schema · lore logout

whoami shows which account you are signed in to. schema prints the JSON Schema of the export file (--example prints a small sample file). logout revokes this machine's sign-in on Lore's servers and deletes it locally.

login, whoami and export take --json for machine-readable output, which is what an agent driving the CLI should use.

What the File Is

One JSON document in a versioned format (lore-export, version 1) with a published schema. It holds your taxonomy, your settings, and every entry with its sections in reading order. It ends with a count of what it contains. Before saving, the CLI checks that the count arrived and, for files up to 256 MiB, that it matches what the file holds, so a download cut off part-way is never kept as if it were complete.

The file is not encrypted. Your knowledge base is encrypted at rest on Lore's servers; the export is plain text so that you can open it anywhere. It contains everything, so keep it somewhere safe.

What the CLI Can and Cannot Do

Importing — restoring an export, or bringing in notes from elsewhere — is planned for the CLI but not available yet.