Command Reference¶
Every operation on the library is a lit subcommand. This page documents each
one: its purpose, the shapes you call it in, and every flag it accepts. The
commands are grouped as lit --help groups them.
lit <cmd> --help is the always-current authority for any single command. This
page mirrors it but adds the cross-command context the inline help cannot.
Conventions¶
Each entry gives a one-line purpose, a synopsis of the common call shapes,
and a table of that command's own flags. Flags shared by most commands
(--library, --vault, -h) are documented once below and omitted from the
per-command tables.
Global flags. Commands that operate inside a vault accept:
| Flag | What it does |
|---|---|
--library <path> |
Use the vault at this filesystem path. |
--vault <name> |
Use the vault registered under this name. Mutually exclusive with --library. |
-h, --help |
Show that command's help and exit. |
The root command also takes lit --version, and lit help <cmd> prints the
same help as lit <cmd> --help.
A few commands do not take --library / --vault, because they create a
vault, target the registry, or touch no vault at all: init, setup,
install-completion, install-skill, uninstall, self-update, gui-log,
pdf-text, help, and every lit vault subcommand.
Output of the read commands. lit list, lit show, lit gui-log and every
list subcommand (vault, project, code, taxonomy, trash) print a table
when you type them at a terminal and JSON anywhere else — an agent's shell, a pipe,
a file. --format table or --format json picks one explicitly. lit search
and lit related print JSON unless given --format table.
Vault discovery chain. When a command needs a vault and you give no explicit
override, lit resolves one in this order (first hit wins):
--vault <name>flag--library <path>flag$LIT_LIBRARYenvironment variable- the active vault in the registry (set by
lit init/lit vault use) - cwd-walk: walk up from the current directory looking for a
lit-config.yaml
lit init registers and activates your vault, so step 4 normally covers you and
you set nothing. Steps 1–3 are explicit overrides for scripts, CI, or juggling
several vaults.
Registry location. The registry lives at $LITMAN_REGISTRY_DIR/vaults.yaml
when that variable is set (use it to put the registry in a cloud-synced
directory), otherwise the platform config dir: ~/.config/litman/ on
Linux / WSL, ~/Library/Application Support/litman/ on macOS,
%LOCALAPPDATA%\litman\litman\ on Windows.
When a folder has moved. Before any command runs, lit checks that every
registered vault directory and every project directory is still where it was
recorded. If one is not, you are asked about it — one folder at a time, each
with its own answer:
| Answer | What happens |
|---|---|
| the new path | The registration is re-pointed there, the same as lit vault set-path / lit project set-path. A vault path must hold a lit-config.yaml; a project path must be the full path of an existing folder. A wrong path is refused, nothing changes, and the same question comes back. |
rm |
Hands you to lit vault remove / lit project rm, which show their own warning and ask y/N before anything goes. |
| Enter | Skip. Nothing changes and you are asked again next time. |
Enter never removes anything, so holding Enter through the questions is always safe. Ctrl+C at a question ends the command you typed. Off a terminal — a script, a CI job, an agent — nothing is asked: a warning names the folder and the command that fixes it, and the command you typed carries on.
1. Setup & vaults¶
lit setup¶
Interactive first-run wizard. Chains five optional steps behind simple prompts: (1) shell tab-completion, (2) pick your agent + install its skill, (3) create your first vault, (4) cloud sync, (5) desktop shortcut. The agent you pick becomes the machine-level default. Each step just runs the matching standalone command, so anything the wizard does you can also do or redo directly. TTY-only; for scripted onboarding call the individual commands.
No flags beyond -h.
lit init¶
Create a new vault under <parent_dir>/<name>/ with the standard skeleton
(papers/, codes/, the four views/by-* hubs, a seeded TAXONOMY.md, an
empty INDEX.json, and lit-config.yaml), then register it. The first vault you
create becomes active automatically. PARENT_DIR defaults to the current
directory.
| Flag | What it does |
|---|---|
--name <subdir> |
Vault subdirectory name to create. Default literature_vault. |
--register-as <name> |
Registry name for the new vault. Default: the --name value. |
--no-register |
Create the vault but skip registration (CI / scripts / throwaway). Point lit at it later via --library / $LIT_LIBRARY / lit vault add. |
lit vault¶
Manage the registry of vaults known to litman. Exactly one vault is active at a
time. Subcommands operate on the registry, not on a vault's contents, so they
take no --library / --vault.
lit vault add <name> <path> [--import-from "..."] [--use]
lit vault use <name>
lit vault list [--format json]
lit vault info <name>
lit vault set-path <name> <new-path>
lit vault remove <name> [-y]
| Subcommand | What it does |
|---|---|
add <name> <path> |
Register an existing vault directory (must already contain lit-config.yaml, and must not already be registered under another name). Does not create a vault — use lit init for that. |
use <name> |
Switch the active vault. |
list |
Show every registered vault; the active one is marked ✓, with path, paper count, and provenance. --format json emits one object per vault. |
info <name> |
Show one vault's path, paper count, on-disk size, provenance, and active flag. |
set-path <name> <new-path> |
Re-point <name> at a vault you have moved. The new path must already hold a lit-config.yaml and must not be another registered vault's folder. The name, the active flag, and the provenance note are kept. |
remove <name> |
Unregister <name>. The directory itself is not deleted. |
lit vault add flags: --import-from <text> (free-form provenance note for a
vault received from elsewhere; auto-fills today's date), --import-at <date>
(override that date), --use (activate the new entry immediately).
lit vault remove takes -y / --yes to skip the confirmation.
lit install-completion¶
Install shell tab-completion for the current user. SHELL is optional and
auto-detected from $SHELL; supported shells are bash / zsh / fish. For
bash/zsh an eval line is appended to ~/.bashrc / ~/.zshrc; for fish a
self-sourcing snippet lands under ~/.config/fish/completions/. Idempotent via a
sentinel comment. Restart the shell (or source) to activate.
No flags beyond -h.
lit install-skill¶
Install the bundled agent skills (lit-library for the write side,
lit-reading for the read side). Both are optional — the CLI is fully usable
without them. Copies files only; does not install an agent or configure any
keys.
Skills go where the agent auto-discovers them: ~/.claude/skills for Claude
Code, the open-standard ~/.agents/skills for ZCode, DeepSeek Harness, Cursor,
Codex, and OpenCode, and ~/.gemini/antigravity-cli/skills for Antigravity
CLI. With no flags the command targets your default agent's directory;
--agent targets another agent's.
Safe to re-run after upgrading litman: skills that already match the bundled
content report "up to date", out-of-date ones are offered a refresh ([Y/n],
default yes; non-interactive runs need --force instead). A run without
--agent/--parent-dir also offers to refresh out-of-date litman skills it
finds in the other agents' directories, with the same per-copy [Y/n] /
--force rules. A skill directory that is a symlink is always left
untouched.
| Flag | What it does |
|---|---|
--skill <name> |
Install only this skill. Default: install all bundled skills. |
--agent <name> |
Install into this agent's skills directory (claude, zcode, agy, codex, dsh, cursor, opencode). Default: your default agent. Mutually exclusive with --parent-dir. |
--parent-dir <path> |
Install into this exact directory instead. Mutually exclusive with --agent. |
--force |
Overwrite files inside an existing target without asking. Files not part of the bundled skill are left in place. |
lit uninstall¶
Reverse of lit setup: remove the bundled skills (from every agent skills
directory litman knows), the desktop shortcut, the shell-completion block, the
vault registry (the list of vault names/paths), the machine-level agent
preferences, the other files litman keeps beside the registry (Web UI pins, the
update-check cache, the self-update log, the GUI log, and the records a stopped
lit gui leaves), and the browser profile the lit gui --window app window runs against
(a sandboxed browser keeps that profile somewhere its sandbox allows, so both
locations are swept). A file of your own there is left, and so is its folder.
It does not remove the lit CLI
itself — a
running command can't delete its own environment — so it prints the final
CLI-removal step (uv tool uninstall litman or pipx uninstall litman,
depending on how you installed it) for you to run. Your vault directories
(papers, PDFs, notes, annotations) are never touched; only the registry pointers
to them are dropped. Skill directories are removed file by file, so any file you
added next to SKILL.md is left in place.
| Flag | What it does |
|---|---|
--dry-run |
Show what would be removed; change nothing. |
-y / --yes |
Skip the confirmation prompt. |
2. Papers¶
lit add¶
Import a paper PDF into the vault. The metadata source is either --doi
(CrossRef fetch) or --from-llm-json (an LLM-prepared JSON file); exactly one is
required, and the CLI refuses both at once. Derives a canonical id
(<year>_<Family>_<Keyword>), refuses on duplicate DOI, and creates
papers/<id>/ with paper.pdf, metadata.yaml, an empty notes.md, and an
empty discussion.md. With --si, it adds supplementary (SI) files to a paper
already in the vault instead — see Adding SI below.
The source PDF is moved, not copied: once the import succeeds, the file you
passed in is gone from where it was. lit add --si moves its files the same
way. Hand lit add a copy if you want to keep the original in place. (Files
dragged into the Web UI — a paper's PDF, or SI files dropped into its SI window
— are copied instead: the browser hands over the bytes and never the path, so
there is nothing there to move.)
Two identity fields are guarded at import, because both reach the paper id and an
id outlives the mistake that made it. A first author or title given as a filler —
Unknown, N/A, untitled — is refused, with the value litman read and what to
write instead: for a work with no personal author, name the issuing body; for a
genuinely unattributed one, Anonymous. A title in a script that cannot produce
an ASCII keyword is refused the same way, and --id is how you get past it —
pass the handle yourself rather than let 关于化合物A的合成方法 reduce to
whichever Latin characters happened to sit inside it. None of this touches what
is stored: titles, authors and journals keep whatever script they were written
in, and only the id is ASCII.
lit add <pdf> --doi <doi>
lit add <pdf> --from-llm-json <path>
lit add <pdf> --doi <doi> --id <id>
lit add <pdf> --doi <doi> --auto-suffix
lit add --si <paper> <file>... [--force]
lit add --si <paper> [--force]
| Flag | What it does |
|---|---|
--doi <doi> |
Fetch metadata from CrossRef. Mutually exclusive with --from-llm-json. |
--from-llm-json <path> |
Read metadata from a JSON file, or - for stdin. Used by the lit-library skill. Mutually exclusive with --doi. |
--id <id> |
Override the auto-derived id, and the way past a title litman cannot turn into one. |
--auto-suffix |
On id collision, auto-append _b / _c without prompting. Required for non-interactive (non-TTY) batch use. |
--si <paper> |
Add SI files to <paper> (a full id or a unique id substring) instead of importing a paper. Not with --doi, --from-llm-json, --id or --auto-suffix. |
--force |
Only with --si. With files: add a file that cannot be confirmed as the paper's SI, or is over 100 MiB, without asking — never a refused one. Without files: ask the Web UI even when the paper has SI already. |
lit add writes a complete metadata skeleton (all fields, defaults filled); see
3-concepts.md §1.1 for the schema.
Adding SI. lit add --si <paper> <file>... adds the files you name to the
paper's supplementary/ folder as si-01.pdf, si-02.xlsx, … and records them
in its supplementary field (see 3-concepts.md §1.1). Each file
is checked against the paper first, one line per file on stderr: ✓ when its
name carries the paper's DOI or its first pages carry the paper's title, ? when
litman can't confirm it belongs to this paper, and ✕ when it is refused —
empty, already in the library, the article itself, or what looks like another
paper's SI.
The add is all or nothing: one refused file and nothing is added, even with
--force. A ? file, or one over 100 MiB, needs a yes — asked file by file at a
terminal (default N); off a terminal, pass --force. On success, stdout carries
SI ready: N file(s), then one line per file: its absolute path, a tab, and its
original name.
Asking the Web UI for SI. lit add --si <paper> with no files asks the Web
UI instead: its open page shows the SI window, you download the files from the
article's page and drop them in (see lit gui below), and the command waits up
to 90 seconds for Done, printing
Waiting for the SI to be added in the litman GUI… on stderr meanwhile. Run
it on the same machine as the lit gui that serves this library. When the
paper has SI already, it prints those files without asking; --force asks the
Web UI anyway. The first line on stdout says how it ended:
| Exit | First line on stdout | What it means |
|---|---|---|
| 0 | SI ready: N file(s) |
The files are in. One line per file follows: its absolute path, a tab, its original name. A first line ending in (already in the library) means the paper had SI already and the Web UI was not asked. |
| 10 | SI request cancelled in the GUI |
Cancel (or Esc) was pressed in the SI window. |
| 11 | Still waiting in the GUI — run the same command again to keep waiting |
90 seconds passed, or the wait was interrupted. The window stays open, and the same command run again picks up the same request. |
| 12 | No litman GUI page is open for this library |
No lit gui on this machine has a page open on this library (or it stopped answering, or shows another library). A line saying why follows when there is one, then the article's link and the lit add --si <paper> <file>... form. |
| 1 | error: … |
No such paper, a broken SI record, and the like. |
lit list¶
List papers, optionally filtered. Filters are AND-combined across flags; within
one flag, comma-separated values are OR-combined. Multi-valued fields
(topics / methods / projects / data) match by list intersection;
--author / --title use case-insensitive substring; --year / --type /
--status match exact values. --priority is per project: on its own it
matches a paper graded so by any of its projects; with a single --project
it matches only that project's grade.
lit list
lit list --year 2024 --status deep-read
lit list --status deep-read,skim --limit 5
lit list --unread --sort recent
lit list --topic transformer --format json
| Flag | What it does |
|---|---|
--year <v> |
Publication year. |
--type <v> |
Paper type (research / review / position / ...). |
--status <v> |
Status (deep-read / skim / inbox / dropped). |
--priority <v> |
Priority (A / B / C), per project — see above. Adding a single --project also adds a Priority(<project>) column to the table. |
--topic <v> |
Match papers whose topics list contains the value. |
--method <v> |
Match against the methods list. |
--project <v> |
Match against the projects list. |
--data <v> |
Match against the data list. |
--author <v> |
Case-insensitive substring against any author. |
--title <v> |
Case-insensitive substring against the title. |
--read-since <YYYY-MM-DD> |
Papers with read-date on or after the date. |
--added-since <YYYY-MM-DD> |
Papers with created-at on or after the date. |
--unread |
Only papers with an empty read-date. |
--sort [id\|recent] |
Order. id (default) ascending, matches INDEX.json. recent = most-recently-engaged first. |
--limit <N> |
Keep only the first N after filtering + sorting. |
--format [table\|json] |
Output format. json emits the same per-paper projection as INDEX.json. Default: table at a terminal, json elsewhere. |
With --sort recent the table view shows the top 10 by default; raise it with
--limit, or use --format json for the full ranked list. The default sort
caps an interactive table too — a terminal shows the first 30 as
Papers (showing 30 of N) — while a table that is piped (--format table) and
JSON are never capped.
A --topic / --method / --project / --data value that no paper carries
and TAXONOMY.md does not register can only match nothing. A note on stderr
says so and names the registered values spelled like it — or, when none is, the
whole dict — each with its paper count. stdout carries the result alone, so
--format json still prints [].
lit show¶
Print one paper's full metadata plus the paths of its PDF, notes, SI files, and
code clones. Accepts a full id, a unique case-insensitive id substring, or
--paper-doi. With no argument, shows the paper you engaged with most recently
— the one lit list --sort recent puts at the top — and names it on stderr, so
--format json still emits only JSON.
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. Mutually exclusive with the positional id. |
--format [table\|json] |
table (the default at a terminal) renders metadata + file paths; json emits the full metadata dict (every field, not the INDEX.json projection) plus _paths: the absolute paths of the paper folder, PDF, notes, discussion, SI files and code clones, with missing listing those not on disk. |
Each SI file gets an SI: line with its path, original name and size, marked
(missing!) when the file is gone:
SI: /home/you/research/literature_vault/papers/2025_Geylan_PepINVENT/supplementary/si-01.pdf (d4sc07642g1.pdf, 1.8 MiB)
lit search¶
Case-insensitive substring search over your notes.md / discussion.md only —
not the PDF full text or SI files, not trashed papers, not the views/ links,
and not what litman writes into those two files: the <!-- --> comments, the
heading on the first line (it follows the paper's title or id), and the notes
placeholder line. Each hit is one matched line. Defaults to JSON output
({id, file, line, snippet}).
| Flag | What it does |
|---|---|
--in <notes,discussion> |
Which files to search (comma-separated). Default: both. |
--format [json\|table] |
json (default, agent-facing) or a human-readable table. |
--limit <N> |
Keep only the first N hits. Default: 20; a note on stderr gives the total when more matched. |
lit related¶
Find papers related to <id>: author-asserted relation edges (related /
extends / extended-by / contradicts / contradicted-by) first, then papers
sharing topics / methods keys, ranked by shared-key count. Each neighbour
carries a via annotation. Defaults to JSON output.
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. |
--by [edges\|taxonomy] |
Narrow to one neighbour kind. Default: both, edges first. |
--min-shared <N> |
Minimum shared topics / methods keys for a taxonomy neighbour. Default 1. Does not affect edge neighbours. |
--limit <K> |
Top-K cap on the merged list. Default 20. |
--format [json\|table] |
json (default) or human-readable table. |
lit open¶
Open a paper's PDF in the configured viewer (or the platform default). Accepts a
full id, a unique substring, or --paper-doi. Multiple substring matches print
the candidate list and exit. With no argument, opens the paper you engaged with
most recently — the one lit list --sort recent puts at the top. With --si, it
opens one of the paper's SI files instead.
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. |
--si <name> |
Open this SI file (si-02, or si-02.xlsx) instead of the PDF, in this machine's default app. |
The viewer comes from default_pdf_viewer in lit-config.yaml; null falls
back to the platform opener. See 3-concepts.md §1.4. When
nothing can open the PDF — no display, no viewer installed, or a viewer that
fails as it starts — lit open says why, prints the file's path on a
PDF path: line, and exits 2. It gives the viewer up to 1.5 seconds to report
such a failure before printing Opened.
With --si, the file opens in this machine's default app for its type; a PDF
uses default_pdf_viewer when one is set, and the paper's own PDF need not
exist. A file the default app would run rather than open — a program, a script,
an installer, or a file with no extension — is refused with exit 1 and its path
printed. In an ssh session it exits 2 and prints the file's path on an
SI path: line instead, unless the file is a PDF and default_pdf_viewer is
set; it does the same when no app can open the file. A name the paper does not
have exits 1 with a list of the SI files it does have.
lit pdf-text¶
Print a PDF's embedded text layer to stdout (pages joined by form feed). Deterministic pypdf extraction — no model, no network, no system tool. A scanned / image-only PDF yields empty output and exit code 3. Operates on a file path, so it takes no vault flags.
| Flag | What it does |
|---|---|
--pages <spec> |
1-based pages to extract, e.g. 1-3, 1, 1-3,5. Omit for the whole document. |
lit cite¶
Print a compact, presentation-ready citation for one paper to stdout as a single
clean line, so lit cite <id> | pbcopy (or | xclip) copies a paste-ready
string. The form is <journal abbrev.> <year>, <volume>, <pages>. — ACS-style,
with no author list or title, the version you drop on a slide. Accepts a full id,
a unique substring, or --paper-doi.
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. Mutually exclusive with the positional id. |
The journal abbreviation comes from a shipped ISO4 table; an unknown journal is printed verbatim with a warning on stderr (never mixed into the piped citation). Other caveats (missing volume/pages, preprint venue) go to stderr too.
lit modify¶
Edit fields on a paper's metadata.yaml. Writes metadata.yaml (refreshing
updated-at) and INDEX.json atomically; views/by-* are rebuilt afterwards.
A new title also becomes the first line of the paper's notes.md (# <title>)
in the same write; if notes.md cannot be read, nothing is changed.
Accepts a full id, a unique substring, or --paper-doi.
lit modify <id> --set FIELD=VALUE
lit modify <id> --set field= # unset (writes null)
lit modify <id> --add-tag topics=transformer
lit modify <id> --rm-tag topics=transformer
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. |
--set KEY=VALUE |
Set a scalar field. Repeatable. Empty value unsets (writes null). |
--add-tag FIELD=VALUE |
Append to a list field (deduped). Repeatable. |
--rm-tag FIELD=VALUE |
Remove from a list field (silent if absent). Repeatable. |
--set-author "Family, Given" |
Rewrite the whole author list. Repeat once per author; the order the flags appear in is the order stored. |
Tag operations refuse values not registered in the corresponding TAXONOMY dict (register-first). See 3-concepts.md §1.3 for the two-step register-then-tag model and which fields are controlled.
--set accepts any field name (metadata is schemaless), so a singular slip on
a tag field — --set topic=X where you meant --add-tag topics=X — writes a
plain scalar that the taxonomy never validates and no view indexes. The write
still goes through; litman prints a warning pointing at the --add-tag form.
Authors are the one list with an order that means something, which is why they
have their own flag. --add-tag authors=… appends, so using it to correct a
misread name leaves the correction at the end of the list — and if the name you
were fixing was the first author, that is also the name the paper id came from.
--set-author states the whole list at once and is the only way to reorder it.
priority-<project> is the one field --set will not clear: an ungraded link
is simply the absent key, so --set priority-<P>= is refused, and lit unlink
is what drops a grade. Grading a project the paper is not linked to is refused
too — lit link <id> --project <P> --priority A links and grades in one step.
supplementary cannot be set at all: SI files are added with lit add --si and
removed with lit rm --si.
lit rename¶
Change a paper id, rippling the change everywhere: the renamed paper's metadata
and directory, every other paper's metadata that references it, every notes.md
and discussion.md with a [[<old>]] wikilink, the first line of the paper's
own discussion.md (# Discussion log for <new>), INDEX.json, and views/.
<old> accepts a unique substring; <new> must be the exact target id.
Where a note still has <old> as plain text, outside [[ ]], the command
prints the file and the line numbers and leaves the text as it is.
No flags beyond the global ones. This is the only safe way to change a paper id —
a plain mv papers/<old> papers/<new> leaves dangling references in other
papers' relation fields and in notes wikilinks. If the paper's folder cannot be
renamed (on Windows, a file in it open in another program), nothing is changed;
close the file and run the command again.
lit rm¶
Remove a paper. By default moves papers/<id>/, SI files included, to
<vault>/.trash/ (recoverable via lit trash restore); --purge deletes
permanently. All external links to the paper (other papers' relation fields,
repo bindings, project links) are torn down atomically; the paper's own fields
ride into trash so a later restore can rebuild them. A repo no other paper
uses is deleted with the paper, its repo-meta.yaml and notes.md kept in the
trash for a restore; one with nothing to clone it again from (a folder added
with lit code add --move, or no upstream) is kept and only unbound. So is one
holding your own changes, which a clone would not bring back: changed or new
files in repo/ (ignored ones do not count), commits not pushed, a stash, or
files you put next to repo/; and one it cannot check for them (no git, say).
lit code rm deletes a kept repo. A y/N
prompt guards the delete (default N). With --si, it deletes one or more of the paper's SI files
instead — see below.
lit rm <id>
lit rm <id> --dry-run
lit rm <id> -y
lit rm <id> --purge
lit rm <id> --si si-02 [--si si-03]
lit rm <id> --si si-02 --dry-run
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. |
--purge |
Permanently delete instead of moving to .trash/. |
-y, --yes |
Non-interactive force-delete: skip the prompt and tear down in one step (with --si, delete those SI files). |
--dry-run |
Preview the full impact set (the paper plus every link that would be cleared / unbound / orphaned; with --si, the SI files and where your notes cite them), then exit without deleting. |
--si <name> |
Delete this SI file (si-02, or si-02.xlsx) instead of the paper — for good. Repeatable. Not with --purge. |
Deleting an SI file. lit rm <id> --si si-02 deletes that file and its
record and leaves the paper as it is. There is no trash for SI files: the
deletion is permanent, and the way back is adding the file again with
lit add --si <id>, where it takes the lowest free number — often its old
one. Before anything goes, the confirmation lists each
file with its original name and how often your notes.md and discussion.md
cite it (si-02.xlsx is cited 2× in discussion.md), then asks y/N (default
N); off a terminal it needs --yes, and --dry-run prints the same list
without deleting. The result repeats any citation left behind
(still cited 2× in discussion.md — lit health-check lists the lines). --si
cannot be combined with --purge (exit 2).
3. Reading status¶
Five one-keystroke shorthands for the equivalent lit modify --set on the
reading-workflow fields. Each accepts a full id, a unique case-insensitive id
substring, or --paper-doi <DOI>.
lit read <id> [--date YYYY-MM-DD]
lit revisit <id> [--date YYYY-MM-DD]
lit skim <id>
lit promote <id>
lit drop <id>
| Command | Effect | Equivalent |
|---|---|---|
lit read |
Stamp read-date (the first read). |
--set read-date=<date> |
lit revisit |
Stamp last-revisited (a re-read). |
--set last-revisited=<date> |
lit skim |
Set status=skim. |
--set status=skim |
lit promote |
Set status=deep-read. |
--set status=deep-read |
lit drop |
Set status=dropped. |
--set status=dropped |
read and revisit default to today (local timezone) and accept --date to
backdate. read-date and last-revisited are kept semantically separate;
promote does not touch read-date. To reverse a status, use
lit modify <id> --set status=<value>. See 3-concepts.md §1.1
for what each field means.
4. Linking & organization¶
lit link¶
Link a paper to a project: add the projects tag, write a folder link under
<project>/litman_reflib/<id>/, and regenerate
<project>/litman_reflib/REFERENCES.md. The project must be registered
(lit project add), and a folder registered for it on this machine must exist.
A project listed in TAXONOMY.md with no folder on this machine, as one added
on another computer arrives through lit sync, links too: only the paper's tag
changes here, a note says so, and a computer that has the folder adds the link
at its next lit sync.
If a real folder already sits where a link belongs — a project directory copied
from another machine turns every link into one — it is settled on the way: a
copy that matches the vault, or is empty, is replaced with the link; one that
does not match is kept under <vault>/.trash/replaced-folders/ and named in the
output. --rebuild-all, lit refresh-views, lit trash restore,
lit health-check --fix and the prompt that asks where a project directory or
the library moved to all do the same, and all say so.
lit link <id> --project <name>
lit link <id> --project <name> --relevance "Direct baseline"
lit link <id> --project <name> --priority A
lit link --rebuild-all
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI. Mutually exclusive with the positional id and --rebuild-all. |
--project <name> |
Project name (one lit project list shows). |
--relevance <text> |
Set the relevance-<project> field in one shot. Otherwise left untouched. |
--priority <A\|B\|C> |
Grade the paper for this project (priority-<project>) in one shot. Otherwise the link is left ungraded. |
--rebuild-all |
Cross-machine recovery: rebuild every project's links + REFERENCES.md from each paper's projects field. Skips <id> / --project. |
lit unlink¶
Reverse a link: drop the projects tag, the folder link, the REFERENCES.md entry,
the priority-<project> grade, and (by default) the relevance-<project> field. Code links under the project
are removed only if no other linked paper there still references the same repo.
For a project with no folder on this machine only the tag and the two fields go.
| Flag | What it does |
|---|---|
--paper-doi <doi> |
Look the paper up by DOI instead of id. |
--project <name> |
Project to unlink from. Required. |
--keep-relevance |
Preserve the relevance-<project> field. Default drops it (the value is echoed in the summary). There is no equivalent for the grade: it always goes with the link. |
lit project¶
Manage the project registry. A project is a controlled projects value bound to
an on-disk path. Both truth sources — TAXONOMY.md's ## projects section and
lit-config.yaml's projects: map — are kept in sync by every subcommand. Do
not hand-edit either side.
lit project add <name> --path <abs-path>
lit project list [--format json]
lit project rename <old> <new>
lit project set-path <name> <new-path>
lit project rm <name> [-y]
| Subcommand | What it does |
|---|---|
add <name> --path <dir> |
Register a project (dual-write TAXONOMY + config) in one atomic write. --path is required and must already exist (no placeholder registration). |
list |
List every project, each row tagged with a drift marker (✓ / ⚠ path-missing / ⚠ config-only / ⚠ taxonomy-only). --format json emits {name, path, status} per project, with the marker as a bare token. |
rename <old> <new> |
Rename the project across TAXONOMY, the config key, every paper, and INDEX.json. The path carries over. No prompt (semantics-preserving). |
set-path <name> <path> |
Change the on-disk path (config only — papers store names). Offers to rebuild the project's links at the new location (one Enter); a non-interactive run, or declining, gets the lit link --rebuild-all hint instead. |
rm <name> |
Cascade-untag papers and drop from both truth sources. Always prompts y/N — even with no paper referencing it, removing a project drops its path binding and deletes litman_reflib/ + REFERENCES.md from your project folder, which the trash does not cover. -y skips the prompt. |
lit project is the project counterpart to lit taxonomy; projects is not
managed through lit taxonomy (only lit taxonomy list projects works
read-only). See 3-concepts.md §1.3.
lit code¶
Manage code repositories bound to papers. Repos live under
<vault>/codes/<repo-name>/ with repo/ (the git checkout), repo-meta.yaml,
and notes.md. The binding is bidirectional: a paper's code-clones field
lists the repo, and the repo's papers field lists every bound paper (one repo
can bind multiple papers).
lit code add <url> [--name <n>] [--paper <id>] [--depth N]
lit code add <local-dir> --move
lit code list [--paper <id> | --orphan] [--format json]
lit code link <repo-name> --paper <id>
lit code unlink <repo-name> --paper <id>
lit code update <repo-name> [--unshallow]
lit code rm <repo-name> [--cascade] [-y]
lit code restore-all [--dry-run]
| Subcommand | What it does |
|---|---|
add <source> |
Clone (URL source) or copy/move (local-path source) into codes/<name>/repo/, seeding repo-meta.yaml (with the checkout's commit and branch) and notes.md. An empty codes/<name>/ folder is taken as free. |
link <repo-name> --paper <id> |
Bind an already-present repo to a paper (idempotent if already bound). |
unlink <repo-name> --paper <id> |
Unbind a repo from a paper without deleting the clone. Drops only the named paper's edge; tolerant of an already-deleted clone. |
list |
List repos and their paper bindings. --format json emits each repo's repo-meta.yaml, so the bindings come out as ids rather than a summary cell. |
update <repo-name> |
git pull --ff-only inside the repo, then record its commit and branch in repo-meta.yaml. A shallow clone that lit sync moved to an older commit, and that holds no changes of yours, is moved to its branch's tip instead. |
rm <repo-name> |
Permanently delete codes/<repo-name>/. Hard delete (re-clonable from the recorded upstream). |
restore-all |
Re-clone every repo whose repo/ checkout is missing (cross-machine recovery, or a restored paper's repo), at the commit its repo-meta.yaml records, and link it into its papers' projects. A local:<path> repo is copied from that folder again. |
Per-subcommand flags:
add:--name <override>,--paper <id>/--paper-doi <doi>(bind on add),--depth N(URL only;0= full history; default fromlit-config.yaml'sdefault_clone_depth),--move(local-import only: move instead of copy).link/unlink:--paper <id>/--paper-doi <doi>(one of the two required;--papertakes a full id or a unique substring).list:--paper <id>/--paper-doi <doi>/--orphan(repos with no bindings) — mutually exclusive.update:--unshallow(promote a shallow clone to full history).rm:--cascade(strip the repo from every paper'scode-clonesfirst; without it,rmrefuses when any paper still references the repo),-y/--yes.restore-all:--depth N,--dry-run. Exit code 1 if any clone failed or any orphan reference was found (CI / cron-gateable).
At a terminal, add, update and restore-all show git's progress. git never
asks for a user name or password (it fails instead), and a download that stays
under 1 KB/s for a minute is given up.
lit taxonomy¶
Manage TAXONOMY.md, the controlled vocabulary. Governs three user dictionaries:
topics, methods, data. Tagging a paper with a value requires the value to be
registered here first (register-first; no escape hatch on lit modify). All
changes are atomic (TAXONOMY + every referencing metadata.yaml + INDEX.json
in one staged write).
lit taxonomy list [<dict>] [--format json]
lit taxonomy add <dict> <value>... [--force]
lit taxonomy rename <dict> <old> <new>
lit taxonomy merge <dict> <src>... --into <dest> [-y]
lit taxonomy rm <dict> <value> [-y]
| Subcommand | What it does |
|---|---|
list [<dict>] |
Show one dict, or all dicts when no name is given, with how many papers use each value (peptide-design·3 in the table of all dicts, one value and its count per line for a single dict). --format json emits {dict, kind, count, values, used_by} per dict; used_by maps each value to its paper count, 0 included. |
add <dict> <value>... |
Register one or more values in a user dict. Already-present values are silent no-ops; the dict is kept sorted. A value that looks like one already registered, or like another value in the same command, is refused and nothing is registered; --force registers it anyway. |
rename <dict> <old> <new> |
Rename a value and ripple to every referencing paper. No prompt (semantics-preserving). |
merge <dict> <src>... --into <dest> |
Fold sources into a destination value (existing or new), cascading. --into required; -y skips the prompt. |
rm <dict> <value> |
Remove a value, cascading the removal to every referencing paper. Lists them and prompts y/N; -y skips. With zero referencing papers it removes straight away — nothing cascades, and re-adding the value undoes it. |
Two values look alike when they are the same once case, -, _, spaces,
punctuation and a plural s are set aside (Peptide_Design / peptide-design),
when one starts with the other and the shorter has at least 6 characters
(peptidedrug / peptide), or when they are one or two letters apart and the
shorter has at least 8 (tokenisation / tokenization). The refusal names the
match:
error: 'peptidedrug' looks like 'peptide' (prefix).
Use the matching value, or add --force to register it anyway.
projects is not managed here — use lit project (it carries an on-disk path).
The two fixed-enum dicts (type, status) are read-only through
lit taxonomy and require a code release to extend. Never hand-edit
TAXONOMY.md to rename or remove a value. See 3-concepts.md §1.3.
5. Maintenance¶
lit health-check¶
Scan the whole vault for inconsistencies: dangling references, schema gaps, stale
staging dirs, missing PDFs, missing discussion logs, dangling wikilinks, dangling
vault-registry entries, missing project directories, real folders sitting where
a project's links belong (a project directory copied from another machine), a
paper still carrying the retired paper-level priority, SI files that do not
match their records, SI citations in your notes that no longer match, and
installed agent skills that are out of date with the running litman. Exits 0 on
a clean vault, 1 if any error or warning is found (so it can gate cron / CI). info findings —
notes such as a drive that cannot hold folder links — are
reported but do not gate: a structurally clean library exits 0.
Three info findings watch the topics, methods and data vocabularies:
two values that look alike, with the lit taxonomy merge that folds the
less-used one into the other; a value no paper uses; and a dictionary where
at least 10 values are each used by one paper and make up 30% or more of it.
--fix leaves them alone.
Four of the checks look for papers that entered the library before litman
guarded the door, so they matter most on one you have been keeping a while. One
reports a title or author still holding a filler value; one reports a paper id
that carries such a filler, which survives correcting the fields because only
lit rename touches an id; one reports an id whose keyword says nothing about
the paper, the 2018_Zhang_A left behind by a title the derivation could not
read; and one reports a title, journal or author name still carrying line
breaks, stray spaces or markup such as <i> from the publisher's record. Each
finding comes with the command that fixes it, complete and ready to paste.
Seven categories cover a paper's SI files and the notes that cite them, printed under these headings:
| Heading | Severity | --fix |
|---|---|---|
SI records (the supplementary field in metadata.yaml) |
error | — |
SI files recorded but missing |
error | Drops the record. |
SI files whose content changed |
error | — |
Files in supplementary/ with no record |
warning | Records the file once it checks out as the paper's SI. |
SI folder layout litman will not change (links, files, folders) |
error or warning | — |
SI litman cannot check (unreadable, or no checksum on record) |
warning | — |
SI citations in notes / discussion that no longer match |
warning | — |
The last reads notes.md and discussion.md for SI citations such as
si-01.pdf (d4sc07642g1.pdf) and reports, with the file and line, one that
names a file the paper no longer has, one whose name in brackets is not the
file that number holds now, and — in a dated section of discussion.md — one without a
name, written before the file now holding that number was added. Each finding
says what to change. These are warnings: lit health-check exits 1 until the
line is changed, but they do not hold up lit sync push, while the SI errors
above do, like any other error. Two-way lit sync checks neither.
| Flag | What it does |
|---|---|
--fix |
Auto-regenerate all derived artifacts from metadata, clean stale staging dirs / orphan trash sidecars, create any missing discussion.md (existing ones keep every section they hold), refresh out-of-date installed agent skills (files you added next to them are kept), and rename a paper folder to the id in its metadata.yaml when a rename stopped halfway. Five repairs touch more than derived files: a retired paper-level priority is copied onto each project the paper is linked to — a paper in no project loses its grade, so run --all first and lit link the ones you want to keep; a relation link to a paper no longer in the library (deleted, lost in a sync, or in the trash) is removed, so bring back any paper you still want first; where a copied project folder left real folders in place of links, a copy that matches the vault (or is empty) is replaced with the link while one that does not is kept under <vault>/.trash/replaced-folders/ and named in the output; a title, journal or author name carrying line breaks, stray spaces or markup is rewritten as one plain line, and the first line of notes.md becomes # and the clean title, even if you changed it (the paper id is never changed; if it was made from the old title, the output prints the lit rename that matches the new one); and a paper's SI records are brought in line with its supplementary/ folder — the record of a file that is gone is dropped (asking first at a terminal, default yes), a file found there that checks out as the paper's SI is recorded, one it cannot confirm is recorded only on a yes at a terminal (default no), and one that belongs elsewhere is left where it is. Off a terminal it drops no record, records only the files that check out, and prints the command for the rest. It never deletes an SI file. Registry / project / taxonomy / code-clone drift stays report-only (it needs a per-case decision), and so do changed SI content, SI folder layout and SI citations. With --fix, the exit code reflects post-fix state. |
--all |
Print every finding instead of the first few per category. |
A library imported before a guard existed can hold hundreds of one kind of
finding, and printing all of them buries everything else, so each category shows
its first five and folds the remainder into a count. The counts are exact either
way and the exit code does not change — --all only decides how much is printed,
and it is what you want when working through one category paper by paper.
lit refresh-views¶
Rebuild every derived artifact from papers/*/metadata.yaml, in order: (1)
INDEX.json (paper summary + by-doi reverse map), (2) views/by-* link hubs
(wiped and rebuilt, so stale tag buckets disappear), (3) each project's
litman_reflib/ links and REFERENCES.md — a real folder sitting where a link
belongs is settled as under lit link. Per-project failures (missing
project dir on this machine) are skipped, not aborted.
No flags beyond the global ones. Everything it produces is derived and safe to regenerate wholesale.
lit trash¶
Manage the recoverable-delete bin under <vault>/.trash/, capped at 100 entries
(lit rm evicts the oldest when full). The bin also holds, under
.trash/replaced-folders/, the project-hub folders a link rebuild moved aside
because they did not match the vault. Those are not trash entries: list and
restore never show them, lit health-check reports how many there are, and
you copy anything you still want out of them by hand before empty removes
them.
lit trash list [--format json]
lit trash restore <id-or-entry> [-y]
lit trash empty [--dry-run] [-y]
| Subcommand | What it does |
|---|---|
list |
Show trash entries, newest first. --format json adds each entry's path and the repos a restore would re-clone. Kept project folders are not listed. |
restore <id-or-entry> |
Restore a trashed paper to papers/<id>/ and rebuild its relations (opposite papers' reverse edges, surviving repo bindings, project links + REFERENCES.md). A 1:1 repo hard-deleted at rm time comes back as its repo-meta.yaml and notes.md and is re-cloned (-y to auto-attempt without prompting); with no terminal and no -y, after a "no", or when the clone fails, it stays without a checkout and lit code restore-all clones it later. A repo/ already in its place is bound as it is, not cloned again; a different notes.md already there is kept, the saved one going beside it as notes.from-trash.md, which lit health-check lists until you merge it in and delete it. A restore from the web UI never clones. |
empty |
Permanently delete every trash entry and every kept project folder. --dry-run lists the entries and counts the folders; -y skips the prompt. |
lit sync¶
Sync the library with a cloud folder through rclone. With
no subcommand, lit sync syncs both ways, for one library used on several
machines. The subcommands are one-way: push mirrors the vault to your remote
as a backup, and pull restores it from there. The vault's per-machine
sync-state file and the transient .litman-staging/ directory are always
excluded.
lit sync [--first-from cloud|local] [--force]
lit sync setup [--remote NAME] [--path PATH]
lit sync push [--dry-run] [-y] [-f] [--exclude-repos]
lit sync pull [--dry-run] [--exclude-repos]
lit sync status [--local]
lit sync disconnect
Two-way sync runs rclone bisync and needs rclone 1.74.2 or newer. What
changed on this machine goes up, and what changed on your other machines comes
down. It syncs with a folder inside the remote (the --path of
lit sync setup), never with the remote's top level.
- Conflicts. When both sides changed the same file since the last sync, the
newer copy is kept and the older one is moved out of the library into the
backup. The summary names each file, whose copy was kept and both copies'
times. When the file is
TAXONOMY.md, the values only the older copy had are added back to the kept one, so no tag on a paper is left unregistered. - Deleted on one machine, changed on the other. A paper or code folder
deleted (or renamed) on one machine while the other changed some of its files
is deleted everywhere: the changed files go to the backup, and the summary
names the folder and the files. A paper still in the trash comes back with
lit trash restore. A code folder'srepo/checkout is never touched. - Backups. Every file a sync replaces or deletes is kept, one folder per
sync, named by its time. On this machine they are under
sync-backup/in litman's data folder:~/.local/share/litman/on Linux ($XDG_DATA_HOME/litman/when that is set),~/Library/Application Support/litman/on macOS,%LOCALAPPDATA%\litman\litman\on Windows. In the cloud they are in the folder next to the synced one,<path>-litman-backup/. The older copy of a conflict, and the changed files of a folder deleted on another machine, go to aconflicts/<time>/folder beside them:<file>.sync-conflict1was this machine's copy,<file>.sync-conflict2the cloud's. When a note or PDF saved in the GUI replaces a file that changed after it was opened, the replaced copy goes to aconflicts/<time>-save/folder. - First sync on a machine. If the cloud folder is empty, this library is
copied up. If this library is new (no papers, nothing under
codes/), the cloud's library is copied down, and the local files it replaces go to the backup. If both hold a library, nothing changes and the command exits20. If this library's path and the cloud path together are too long for rclone's records, nothing is synced and the command exits1, saying which one to shorten. - Never synced:
INDEX.jsonandviews/(rebuilt after every sync),lit-config.yamlandcodes/*/repo/checkouts. Each machine keeps its own project folders: a project added on another machine arrives without a folder here, and the summary prints thelit project set-paththat gives it one. - Code repos follow by version. Before each sync, the commit and branch of a
checkout you moved on this machine (
lit code update, or a pull, commit or checkout of your own) are written to itsrepo-meta.yaml. After it, a missing checkout is fetched from the repo's upstream at the commitrepo-meta.yamlrecords, and one at another commit is moved there. Arepo-meta.yamlthat records no commit yet gets the commit of the first machine that syncs it, and the other machines follow that one. A checkout with changes of yours (a changed tracked file, or a commit no remote has) is left where it is; untracked files alone do not stop the move. The summary lists what moved, what did not and why, and the checkouts whose uncommitted changes stay on this machine. A repo imported from a folder (local:) is not fetched: copy that folder over. A repo that cannot be fetched (offline, say) never stops the sync; the nextlit synctries again. - A code repo removed on another machine leaves its checkout here
untouched, and every sync reminds you to move that folder out of the library
or delete it. Until then the other machines get an empty
codes/<name>/folder, whichlit health-checkdoes not report. - After every sync the read-only lock on
metadata.yaml,paper.pdf, SI files andTAXONOMY.mdis put back, andINDEX.json,views/and the project links are rebuilt. - Safety stop. rclone stops a sync that would delete more than half of the
files on one side, before anything is deleted. If the deletions are intended,
run
lit sync --force. - One sync at a time. When another sync of this library is running (the
GUI's auto sync, or
lit syncin another terminal),lit syncwaits up to 90 seconds for it to end, then exits23without syncing.pushandpullwait the same way. - Records outside the library. Besides the backups, each machine keeps its
sync records and locks in litman's data folder. When that folder refuses
writing (a sandbox that lets an agent write only in its workspace, say),
lit sync,push,pullanddisconnectstop with one line that names it: allow writing to that folder, then run the command again. - What it shows. In a terminal, one line of how much rclone has copied,
gone once it is done; nothing of it in a pipe or for an agent. rclone's own
log lines are not shown:
lit sync statuslists them under the last run.pushandpullshow the same line. - Auto sync. While
lit guiruns, it syncs a library that has had its firstlit syncon this machine by itself (seelit guibelow). A two-way sync keeps a small.litman-sync-stamp.jsonin the cloud folder, which tells the other machines that one has synced; it is not part of the library. - When a sync stops. Every two-way run, from a terminal or the GUI, is
recorded on this machine, and
lit sync statusshows the last one in full. While that run failed or waits for--first-from, every otherlitcommand ends with one line, such as "Cloud sync stopped at 15:01 (sign-in refused). Runlit sync statusfor why and what to do." The line goes away once a sync goes through, from a terminal or the GUI.
| Flag | What it does |
|---|---|
--first-from cloud\|local |
Compare both sides afresh, with that side winning every difference. The other side's differing files go to the backup; files found on one side only are kept and copied across. Needed when a first sync finds a library on both sides, or after the set of never-synced files changed. |
--force |
Go on past rclone's safety stop (more than half of the files deleted on one side, or every file changed). Replaced and deleted files still go to the backup. |
| Exit code | Meaning |
|---|---|
0 |
Synced. |
1 |
Failed. A failure litman knows (an expired sign-in, rclone's safety stop) is said in litman's words, and lit sync status has rclone's lines; any other ends with rclone's last lines. What was not synced is picked up by the next lit sync. |
20 |
Nothing was synced: pick the side that wins with --first-from cloud or --first-from local. |
21 |
Synced, with conflicts: the newer copy of each file was kept and the older one is in the backup, or a folder deleted on one machine won over changes made to it on the other. |
22 |
Synced, but a code repo here does not match the library: its checkout is missing, at another commit, or left behind by a repo removed on another machine. The summary says why and what to do. |
23 |
Nothing was synced: another sync of this library was still running after 90 seconds. Run lit sync again once it is done. Also from push and pull. |
A sync with conflicts that also left a code repo behind exits 21, and its
summary lists both. A checkout at the recorded commit with uncommitted changes
is only listed; it does not change the exit code.
| Subcommand | What it does |
|---|---|
setup |
Hand the TTY to rclone config, then record the chosen remote + path in lit-config.yaml. --remote <name> skips the interactive step (point litman at an existing remote); --path <path> sets the mirror path. Off a terminal, both are required. |
push |
Upload the vault (rclone sync — deletes orphans on the remote). Refused once the library syncs two-way, on this machine or another: run lit sync instead. |
pull |
Download the remote into the vault. One-way with deletion — local files absent on the remote are removed. Refused once the library syncs two-way (run lit sync; on a new machine, lit sync --first-from cloud), and when the remote holds no lit-config.yaml. |
status |
Show last-push / last-pull timestamps and local vs. remote file counts. No network mutation. For a library that syncs two-way, it counts what two-way sync carries and shows the last sync. Below that, this machine's last two-way run, from a terminal or the GUI: how it ended, each conflict with its backup, the code repos left behind, or the full error with what to do, and the lines rclone logged. After it, the code repos that run found with changes only on this machine (uncommitted changes, or commits no remote has), each with what to do. Then the folders of conflict backups made on this machine in the last 7 days, besides the last run's: each one's time, whether a sync or a save in the GUI made it, its path and its first files. Both parts show even when the cloud cannot be reached. --local reads only this machine's records, with no rclone call: the mode (two-way, one-way push / pull, or not synced from this machine yet), the last run and the conflict backups. |
disconnect |
Stop syncing this library on this computer: remove the sync: block from lit-config.yaml and this machine's sync records, so a later lit sync setup starts with a first sync. The library, the backups on this machine, the cloud folders, the rclone remote and the cloud account's access stay; it lists each with the command that removes it. Waits for a sync in progress like lit sync, and needs no rclone or network. When something cannot be removed, it stops and names it; this computer stays set up to sync until lit sync disconnect goes through. |
push runs a full health-check first as an integrity gate: any error-severity
finding aborts the push, so a corrupted local state never overwrites the cloud
backup. -f / --force bypasses the gate; -y / --yes only skips the
first-push size confirmation and does not bypass the gate. Two-way
lit sync has no such gate: it carries every file as it is. Both push and
pull accept --dry-run and the paired --exclude-repos / --include-repos
(apply codes_ignore_patterns so codes/*/repo/ checkouts are skipped; re-clone
them later with lit code restore-all).
lit export¶
Project the vault out to a .bib file for LaTeX, or with --format ris to a
.ris file for EndNote, Zotero or Mendeley. Cite keys equal paper ids, so
\cite{<paper-id>} works across machines. Re-running on the same file is the
supported update path. One of --project / --all is required.
lit export --project <name>
lit export --all
lit export --project <name> -o path/to/refs.bib
lit export --all --topic transformer --author smith
lit export --project <name> --format ris
| Flag | What it does |
|---|---|
--project <name> |
Export every paper linked to the project. Mutually exclusive with --all. |
--all |
Export every paper in the vault. |
-o, --output <file> |
Output path. Default ./refs.bib, or ./refs.ris with --format ris. |
--priority / --status / --year / --type / --topic / --method / --data / --author |
A subset of lit list's filters (within a flag OR, across flags AND). --priority is per project, exactly as in lit list. |
--force |
Overwrite a target file even without the litman sentinel (typically a hand-edited .bib). |
--format [bibtex\|ris] |
Output format. Default bibtex. |
Every generated file's first line is a litman sentinel line; lit export
refuses to overwrite a target whose first line is not that sentinel, so a
hand-curated .bib at the same path is safe. The exporter uses the bib-oriented
fields filled in by lit add; fill them on older papers with
lit modify <id> --set venue-type=journal-article etc.
venue-type chooses the entry type, so a paper carrying patent is exported as
@patent rather than a bare @misc, and a patent-number on the paper becomes
that entry's number. Both are ordinary metadata fields — set them with
lit modify on a patent that came in without them.
EndNote reads BibTeX poorly; give it the .ris. In EndNote: File → Import →
File, Import Option Reference Manager (RIS). Each record's Label is the
paper id, the same key as \cite{<paper-id>}. An arXiv preprint comes in as an
unpublished work, with its arXiv id in the notes and a link to its abstract
page.
lit config¶
Inspect the active vault's lit-config.yaml.
| Subcommand | What it does |
|---|---|
show |
Print the parsed, validated config, reflecting the effective values after schema defaults fill in any omitted fields. --format [table\|yaml] chooses a Rich table (default) or the canonical YAML form. |
See 3-concepts.md §1.4 for what each config field controls.
lit gui¶
Launch the litman Web UI — a localhost browser app for browsing, reading PDFs,
annotating, and everyday curation. It serves the active vault and binds
127.0.0.1 only and answers only its own page: requests sent by other
websites are refused, and on Linux, wherever the kernel can tell users apart,
so are requests from other users of the same machine. When your session has a display, the UI also opens in
your browser automatically; on a headless box (HPC) it never tries — it prints a
ready-to-paste ssh -L tunnel line so you can open the printed URL in your
local browser. If the default port is busy it walks upward to the next free
one (Jupyter-style) and prints the port it landed on. Each running lit gui
records itself next to the vault registry, so lit add --si <paper> run on the
same machine can reach its open page.
lit gui
lit gui --port 9000
lit gui --window # standalone app window (no address bar)
lit gui --make-shortcut # create a desktop shortcut, then exit
| Flag | What it does |
|---|---|
--port <n> |
Port to bind. Default 8765; auto-increments if busy. |
--no-browser |
Don't open a browser automatically. |
--window |
Open a standalone app window (no address bar) instead of a browser tab. On macOS the window is litman's own; elsewhere it borrows a Chrome-family browser, falling back to a normal tab if none is installed. |
--make-shortcut |
Create a desktop shortcut — Desktop (Windows), applications menu (Linux), /Applications (macOS; falls back to ~/Applications when that is not writable) — that runs lit gui --window, then exit without starting the server. Re-running refreshes it. The install script runs this for you, so a fresh install already has the shortcut. |
In --window mode the app window is the application: closing it stops the
server (on Windows and Linux, Ctrl-C stops the server and closes the window
too). When a browser holds the window it runs against a browser profile of its
own, not your everyday one (lit uninstall removes that profile); links to
other sites open in your default browser, not in that window. A plain
lit gui in a terminal keeps the ordinary contract — the tab is just a tab,
and Ctrl-C in the terminal is what stops the server. On Windows the desktop
shortcut targets litw, the console-less twin of lit, so double-clicking it
opens no console box.
On macOS the window is litman's own — WebKit ships with the system, so nothing
needs installing. Elsewhere only a Chrome-family browser can hold such a
window: --app is their flag and Firefox has no equivalent. On a machine with
none installed, --window opens an ordinary tab and carries on. That is the
usual state of a fresh Linux desktop, and sudo snap install chromium — or
Chrome, or Edge — settles it; litman borrows the browser only to hold its
window, so it need not be the one you browse with.
On a fresh install with no vault yet, lit gui still starts and shows a welcome
page that creates your first library right in the browser — no terminal step. It
also appears if the active vault's folder has moved, letting you create a new
library or open a registered one.
Beyond browsing and reading, the window carries a few things worth knowing about
here. Dragging a PDF onto it imports the paper, running lit add's own code with
one difference: the browser can only hand over a copy of the bytes, so your
original file stays where it is. The pencil in the METADATA header edits the
bibliographic fields and the author list. Clicking a paper's status dot pins it to
the top of the browse list — a per-library convenience kept outside the vault,
which is why it has no lit command. And the first time the app opens on a new
version it shows a short "What's new" card; the litman mark in the top-left corner
reopens it whenever you want it again.
A paper's supplementary files sit in the context panel's Supplementary row,
one chip per file (si-01.pdf · 1.8 MB, the original name on hover). When the
server runs on a machine with a desktop, a click opens the file there in its
default app and the toast names that machine; if no app takes it, the toast
says why and the browser takes the file instead. In an ssh session, or on
a machine with no display, the chip is a plain link: a PDF opens in the browser
and anything else downloads under its original name. Ctrl-click (Cmd-click on
macOS) or a middle click always leaves it to the browser. The × that appears on
hover deletes the file — for good, after a confirmation that says how often your
notes cite it. + Add SI at the end of the row opens the SI window, the same
one that opens by itself when your agent runs lit add --si <paper> (while you
are typing, or another dialog is open, it waits). In it, Open website ↗
opens the article's page in a new tab (from the desktop app, in your default
browser); download the SI there and drop the files
onto the window. Each file is checked as it lands: ✓ goes in, ? goes in only
with add anyway ticked, and ✕ never does; a file over 100 MB waits for a
click on Upload. Done adds them all at once, and Cancel (or Esc)
adds nothing.
Cloud sync. Once a library has had its first lit sync on this machine, the
window keeps it synced while it runs: when it starts, about a minute after a
change, when another machine has synced (it looks every two minutes or so), and
once more as it closes. It is the same sync as lit sync, with the same
backups. The cloud button right of the library selector shows how it stands;
click it for a one-line status and Sync now, and, after conflicts or a code
repo that did not sync, View activity log, which names each file and its
backup. A sync that needs you (an expired sign-in, rclone's safety stop, a side
to pick) stops the auto sync until a sync goes through, from Sync now or a
terminal; lit sync status says why and what to do. Saving a note or a PDF
that a sync (or an agent) changed after you opened it keeps your version and
backs up the one it replaced (see lit sync).
When something fails. The window says what failed in one short line, in
your language. The whole message, with what to do about it, goes to the GUI log:
lit gui-log prints it.
| Dot | The popover says, for example | Note |
|---|---|---|
| none | Cloud sync is not set up. | The library has no sync:; lit sync setup adds one. |
| green | Last synced 3 min ago. | Followed by "1 code repo not synced." when one did not follow. |
| blue, pulsing | Syncing… | "Another sync is in progress (started 10:07)." while another sync of this library, lit sync in a terminal say, holds it. |
| amber | Last synced just now, with 1 conflict. | The newer copy was kept; the activity log names the backup. |
| red | Too many changes on one side. Confirmation required. | Auto sync stopped. Also "gdrive credentials expired. Sign in again.", "Choose which side wins: this machine or the cloud." and "Sync failed. Auto sync stopped." |
| hollow | Sync unavailable. Retrying at 11:35. | The cloud could not be reached; it tries again by itself. "This machine has not completed its first sync." before the first lit sync here. |
| grey | Not synced since launch. | Before the first sync since the window opened. |
The Web UI drives a growing subset of the commands on this page through the same
code paths — this page (the CLI) stays the complete surface. The web server
(fastapi + uvicorn) ships as a core dependency; a corrupted install missing it
prints a reinstall hint (uv tool install --force litman or pipx install
--force litman).
lit gui-log¶
Print what the litman window could not do, newest first. The window shows a
failure as one short line; each entry here holds the rest: when, in which
library, the request, the code behind the window's line, and the full message
with what to do. It also holds what the window flagged without failing: an SI
file it could not confirm or refused, project folders a delete could not clean
up, an automatic update that failed. An unexpected server error carries its
traceback (in --format json).
| Flag | What it does |
|---|---|
--days <n> |
How many days back to look. Default 7. When the log has entries but none that recent, it says when the newest is from. |
--limit <n> |
Show at most this many entries. Default 20. |
--format table\|json |
json prints the log's own entries. Default: table at a terminal, json anywhere else. |
The log is gui-log.jsonl beside the registry, one per machine. Past 1 MB it
moves to gui-log.1.jsonl and a new one starts, so the two hold about 2 MB at
most. lit uninstall removes both.
lit agent¶
Start your AI agent inside the vault — one command instead of opening a
terminal, cd-ing to the vault, and running the agent by hand. It launches
the agent's command with the active vault as working directory and hands the
session fully over to the agent (Ctrl-C and exit belong to the agent, not to
lit).
lit agent # launch the default agent
lit agent cursor # launch a named agent from the catalog
lit agent --set-default claude # record the machine-level default agent
| Argument / Flag | What it does |
|---|---|
NAME (optional) |
Which agent to launch. Omitted, it launches the default agent. |
--set-default NAME |
Record NAME as the machine-level default agent (used by a bare lit agent and the GUI agent button), then exit. Only a supported agent is accepted. |
The default agent is machine-level, not per-vault: it is recorded in
preferences.yaml next to the vault registry, set by lit setup, the GUI
agent panel, or lit agent --set-default. Claude Code, ZCode, Antigravity CLI
(agy), Codex, DeepSeek Harness (dsh), Cursor, and OpenCode are the
supported agents.
Claude Code and Codex start as their CLI or as their desktop app; Codex's desktop
app can be used on Windows only, and on macOS and Linux Codex is CLI only.
lit agent claude and lit agent codex run the CLI in this terminal when the CLI
is on PATH. When only the app is installed, they open the app at the vault and
return at once. Claude Code's app then asks you to confirm the folder, every time
it is opened this way. Codex's app asks the first time it opens a folder.
ZCode is a desktop app, not a terminal agent: lit agent zcode opens ZCode at
the vault and returns at once. If ZCode is already open, it switches to the
vault. Open ZCode once after installing it, so litman can find it.
DeepSeek Harness is a desktop app too: lit agent dsh opens it and returns at
once. It comes back to the session you used last, so the first time, add the
vault as a workspace in DeepSeek Harness. Open DeepSeek Harness once after
installing it, so litman can find it. If every command in DeepSeek Harness on
Windows fails with exit code 3221225794, that is a known DeepSeek Harness
sandbox bug: update DeepSeek Harness, and if it persists, approve with
"Allow once".
Two things fail with a one-line error: a NAME that is not in the catalog, and an
agent whose command is missing from PATH (for ZCode and DeepSeek Harness: not
installed, or never opened). The Web UI's agent button launches the same default
agent: on a machine with a display it opens the agent in a new terminal window,
or opens the desktop app; when the server runs on a remote box (HPC) it shows
the lit agent line to copy into your own terminal.
When an agent has both a CLI and a desktop app, its entry in the agent panel has
a Launch with switch, App or CLI. The button uses the one you pick and
remembers it for this machine, in preferences.yaml. Until you pick, Claude Code
uses the CLI and Codex uses the app. If the one the button would use is not installed, it uses the other.
Picking one that is not installed offers its download and is not remembered.
lit agent does not read this choice. An SSH session, or Linux without a display,
has no switch: the desktop app is not an option there. Nor does Codex on macOS or
Linux.
lit self-update¶
Upgrade litman to the latest release on PyPI, through whichever tool installed
it. It prints current → latest, asks once, then runs uv tool upgrade litman
or pipx upgrade litman.
Four installs it will not upgrade: an editable (development) checkout, a plain
pip install, a conda environment, and a copy installed from litman's git
repository (or a local file) rather than from a release. Each one prints the
command to run by hand instead — for the last, the pair that reinstalls it from
PyPI: uv tool uninstall litman && uv tool install litman, or the pipx
equivalent. It never runs pip install --upgrade into the interpreter it is
running in.
On Windows the upgrade starts the moment the command exits, so the prompt comes
back before it has finished — give it a few seconds and check lit --version.
The command prints the path of the log it writes.
The Web UI does the same job without a terminal: when a new release is out, a chip with its version number appears next to the logo, and Update & restart closes litman, upgrades it, and reopens it. The same four installs are refused there, with the reason shown in the chip.
| Flag | What it does |
|---|---|
-y / --yes |
Skip the confirmation prompt. |
The daily check. Once a day, any lit command may ask for the newest
version number and print a line when yours is older. It asks the package index
litman was installed from — the Tsinghua mirror for the China installers — or
PyPI when uv recorded none. The answer is cached for 24 hours at
<registry dir>/update-check.json, the request times out after two seconds,
and a failure — offline, slow, malformed — is swallowed silently. The web UI
asks in the background, waits longer, retries a failure after an hour, and asks
again every hour while it is open.
That line appears once a day, so it cannot trail every command in a working
session. lit hello is the exception: it reports a newer release every time
you run it, and it is the one command that reports it to a coding agent as
well — so an agent working on your library can pass a new release on to you.
Set LITMAN_NO_UPDATE_CHECK=1 to switch it off, cache and all. litman sends no
telemetry: the request asks the index for litman's list of releases and says
nothing about you.