@uselore/cli
v0.1.2
Published
Download your Lore knowledge base from the command line.
Maintainers
Readme
@uselore/cli
Download your Lore knowledge base from the command line — every entry, every section, your taxonomy and settings, and (by default) your margin comments and search vectors, as one JSON file. Built to be driven by a person or by a coding agent.
npx @uselore/cli login # opens your browser to sign in
npx @uselore/cli export # writes lore-export-YYYY-MM-DD.jsonOr install it once: npm install -g @uselore/cli, then run lore …. Needs Node 22 or later.
Commands
| Command | What it does |
|---|---|
| lore login | Opens Lore's sign-in page in your browser and keeps a token for this machine. --no-browser prints the URL instead of opening it; --timeout <seconds> (default 300). The browser must be on the same machine as the CLI: sign-in is handed back to it at 127.0.0.1, so it can't be completed from the other end of an SSH session or outside a container. |
| lore whoami | Shows the account and server you're signed in to. |
| lore export | Downloads the whole knowledge base. -o <file> names the file; --no-comments and --no-vectors leave those out. From 0.1.1 it won't replace an existing file unless you pass --force. |
| lore schema | Prints the JSON Schema of the export file; --example prints a small sample file. |
| lore logout | Revokes this machine's sign-in on the server and deletes it locally. |
Every command takes --server <url> (default https://lore.uselore.app, or $LORE_URL); from 0.1.2
it must be https, or plain http on localhost only, and so must the sign-in URLs the server
advertises, because your token travels to them. login,
whoami and export take --json for machine-readable output on stdout (schema already prints
JSON). Exit codes: 0 success, 1 failure, 2 bad usage.
What to know
- The export file is plaintext. Your knowledge base is encrypted at rest on Lore's servers; the file you download is not. It contains everything — keep it somewhere safe.
- The CLI never sees your password. You sign in on Lore's own page in your browser; the CLI
receives a token for your account via a one-off listener on
127.0.0.1. That token moves your knowledge base in and out and nothing else — today that means export (the sign-in page also names import, which is coming, because a sign-in stays valid as long as it is used at least every 90 days). It can't change your account, edit individual entries, or be used by an AI client. - Where the token lives:
credentials.jsonin$LORE_CONFIG_DIR, else$XDG_CONFIG_HOME/lore, else~/.config/lore(%APPDATA%\loreon Windows), readable only by you.lore logoutrevokes it; you can also disconnect it from Settings → Connected apps in Lore. - A download is checked before it's saved. The file is written as
<name>.partialand only renamed once it ends with the server's closingcounts— and, for files up to 256 MiB, once those counts match what arrived — so a cut-off download never looks complete. - Limits: 10 exports per hour per account.
