Skip to Content
Pangur docs

Command-line reference

This page lists every pangur command with its arguments and options, says which project each one works in, and marks the commands that edit, delete or use Pangur's model.

This page lists every command of the pangur command-line tool (version 0.3.3), grouped by what it works on. Installing the tool and signing in are covered in The command line. The tool's old name, zcp, still runs it, and some of its own messages still print zcp …, so either name works.

Run pangur --help, or pangur <command> --help, for the tool's own summary of a command. Running pangur with no command prints the help.

Conventions on this page

  • KEY is an item's eight-character key, as pangur search prints it. ATTACHMENT is the key of a file attached to an item, as pangur get lists it.
  • --json prints the server's JSON response, indented, in place of the usual table or text.
  • --connection ID works in the named project, by its id or its address (see Project selection). A command without this option always works in your default project.
  • --yes (or -y) answers yes to the command's confirmation question.
  • Errors print to standard error as the HTTP status and the server's message, and the command exits with status 1.

Account

CommandWhat it doesOptions
pangur loginSigns in with a device code: prints an address and a code to confirm on any device.--browser signs in through a browser on this machine instead.
pangur logoutEnds the session on Pangur's sign-in service and deletes the saved sign-in file.—
pangur whoamiPrints the signed-in account and its projects, with the default project marked and each project's scope (whole library or one collection).—
pangur projectsLists the projects you can open, your own and your organisations', with each one's address, organisation and your role.--json

Reading your library

CommandWhat it doesOptions
pangur overviewPrints counts, item types and recent additions for the library.--json
pangur search QUERYSearches the library's titles and other details (not the text inside files). Every word must match.--limit/-n (25), --type (an item type), --tag, --collection/-c KEY, --sort (title, creator, itemType, date, dateAdded, dateModified), --direction (asc or desc), --json
pangur get KEYPrints an item's full details, where its text comes from, its attachments and its notes.--json
pangur read KEYPrints the readable text of an attachment. KEY can be an attachment key or an item key; for an item, its first readable attachment is used.--offset (0), --max-chars, --all (page through the whole text), --json
pangur cite KEY…Prints a formatted bibliography for one or more items.--style/-s (apa; any CSL style, such as chicago-author-date, mla, vancouver or ieee), --json (prints CSL-JSON)
pangur collectionsPrints the collection tree with item counts and keys.--json
pangur tags [QUERY]Lists the library's tags, optionally only those containing QUERY.--limit/-n (50), --json
pangur marks ATTACHMENTPrints your highlights on a file and the passages assistants marked on it.--page-height (842, in points), --connection, --json

Changing your library

These commands change the library. edit and delete are available here and in the web app, but not to assistants.

CommandWhat it doesOptions
pangur edit KEYChanges an item's fields.--field/-f field=value (required; repeat for several fields)
pangur delete KEYMoves an item, with its notes and attachments, to the project's trash, after asking you to confirm.--yes
pangur trash listLists what is in the trash, newest first, with the date each thing was deleted.
pangur trash restore KEYTakes something out of the trash.
pangur trash forget KEYDeletes one thing in the trash for good, after asking you to confirm.--yes
pangur trash emptyDeletes everything in the trash for good, after asking you to confirm.--yes
pangur note KEY TEXTAdds a note to an item. Line breaks become paragraphs.—
pangur upload FILE --item KEYAttaches a file to an item, for example a PDF you downloaded through your library.--item/-i KEY (required)
pangur annotate ATTACHMENT --quote TEXTHighlights a passage in a PDF by quoting it; Pangur finds the words on the page.--quote/-q (required, the exact words), --comment/-c, --page (if the words recur), --colour (#ffd400), --connection
pangur institutionShows or sets your institutional access for the PDF finder. With no options it shows the current values.--ezproxy URL, --openurl URL, --name TEXT

Institutional access belongs to your account and applies in every project; see Where PDFs come from.

Adding works

pangur import

CommandWhat it doesOptions
pangur import search QUERYSearches OpenAlex and the book catalogues for works to add, and says which are already in your library. Each row ends with the add command for it.--limit/-n (10), --provider NAME (one source alone; estc searches the English Short Title Catalogue, which the default search leaves out), --json
pangur import lookup IDENTIFIERResolves a DOI or ISBN (also a PMID, arXiv id or ESTC number) to its catalogue record.--json
pangur import add IDENTIFIERAdds a work by DOI, ISBN or a candidate token from import search, and tries to attach its PDF. Asks before saving a duplicate.--collection/-c KEY (only in a project that is not scoped to a collection), --no-pdf, --connection
pangur import refs FILEImports a reference file (BibTeX, BibLaTeX, RIS, CSL-JSON, PubMed, EndNote or Zotero RDF). Entries already in the library are skipped; notes come along; a BibTeX key is kept as Citation Key: in the Extra field.--collection/-c KEY or --new-collection (named after the file), --pdfs/--no-pdfs (on by default for 100 references or fewer), --attach-files (upload files the entries name, found beside the reference file), --dry-run, --yes, --connection
pangur import file PATHCreates a reference from one file (PDF, Markdown or text) and attaches the file. Shows what it found and asks first.--collection/-c, --yes, --connection, --json

pangur add IDENTIFIER is a shorter name for pangur import add, with the same options. pangur import lookup can also be run as pangur lookup.

The web app imports the same reading lists and reference files.

pangur ingest

pangur ingest brings in files you already have. Pangur reads the first pages of each file for a DOI, ISBN or arXiv id, checks the library, and either creates a reference with the file attached, attaches the file to the existing item, or stores the file on its own until you say what it is.

CommandWhat it doesOptions
pangur ingest files PATH…Ingests files and folders. Folders are searched for .pdf, .md, .markdown, .txt, .html and .htm files. A file ingested before is recognised by its contents and not sent again.--collection/-c, --connection, --json
pangur ingest status [GROUP]Shows the outcome of each file in one run, or in the most recent run.--connection, --json
pangur ingest resolve INGEST_IDGives a stored file its reference and moves the file under it.exactly one of --doi, --isbn, --item KEY or --candidate TOKEN; --allow-duplicate, --connection, --json

The table that ingest files prints gives each file's outcome: matched, duplicate, needs_reference or failed. The command exits with status 1 if any file failed.

pangur refs

pangur refs finds the works a document cites and imports them. Each reference it finds has one of four statuses: in_library, importable, primary_source (an archival manuscript, which cannot be imported) or unresolved.

CommandWhat it doesOptions
pangur refs KEYLists the works a stored document cites. KEY is an item key or an attachment key. pangur refs show KEY is the same command.--rescan (ignore the saved scan), --json
pangur refs scan SOURCEScans a document that is not in your library: a file, a URL, or - for standard input. Nothing is added.--rescan, --json
pangur refs import KEYImports a stored document's references as one background batch.--all or --pick 1,4,7-9 (one is required), --collection/-c, --no-pdfs, --dry-run, --yes, --wait (wait until the batch finishes), --connection
pangur refs status [BATCH]Shows recent bulk imports, or one batch with its entries.--json
pangur refs resume BATCHQueues again the entries of a bulk import that failed or were deferred.—
pangur refs find-pdfs BATCHLooks for PDFs for the references a finished bulk import saved without looking.—

Background work

CommandWhat it doesOptions
pangur tasksLists background work you started that is waiting, running or needs you: PDF searches, imports, exports and write-ups.--all/-a (finished tasks too), --json
pangur jobsLists recent imports and their PDF status, across all your projects.--limit/-n (20; at most 100), --json

The same work appears on the Activity page in the web app.

Ask and conversations

CommandWhat it doesOptions
pangur ask QUESTIONAsks your library a question, as Ask on the web does, and streams the answer with its numbered sources and a conversation ID. Uses Pangur's model and your plan's Ask allowance.--thread/-t ID (continue a conversation), --materials (passages only: no answer is written, no model runs and no allowance is used), --connection, --json
pangur threads listLists your conversations, newest first.--connection, --json
pangur threads show IDPrints every question and answer in a conversation. Each answer says which model wrote it, or which assistant recorded it.--connection, --json
pangur threads delete IDDeletes a conversation after asking. Nothing in your library depends on it.--yes, --connection

Documents

CommandWhat it doesOptions
pangur docs listLists your documents, newest first.--q TEXT (words that must all be in the title), --item KEY (documents that draw on an item), --kind, --limit (25), --connection, --json
pangur docs show IDPrints a document's Markdown.--version N, --connection, --json
pangur docs new TITLECreates a document from a Markdown file or standard input.--from FILE (or - for standard input; without it the body is just the title as a heading), --kind (note by default; also summary, literature_review, outline or answer), --source-item KEY (repeat for several), --connection, --json
pangur docs append IDSaves a new version of a document with the full text you give. The text replaces the current version; earlier versions are kept.--from FILE or - (standard input, the default), --connection, --json
pangur docs export IDWrites a document to a Word or Markdown file.--out/-o PATH, --format (docx or md), --connection

Despite its name, docs append does not add to the end of a document: pass the whole new text.

Exporting

CommandWhat it doesOptions
pangur export refs [KEY…]Writes references as BibTeX, BibLaTeX, RIS or CSL-JSON: the items named, one collection, or with neither the whole library.--format/-f (bibtex, biblatex, ris or csljson), --collection/-c KEY, --output/-o FILE (otherwise standard output), --connection
pangur export projectBuilds a ZIP of everything in the project and downloads it.--output/-o, --wait/--no-wait (with --no-wait you get an email when the ZIP is ready), --connection
pangur export linkPrints the project's private reference link, making one if there is none. Anyone with the link can read the references.--collection/-c (a collection's link), --format/-f (which format's address to print), --new (replace the link; the old address stops working), --off (turn the link off), --connection

For what the project ZIP contains, see Export your work or delete your account.

Books

CommandWhat it doesOptions
pangur book from-section KEYCreates a book item from a book section's book title, editors and publisher.--json
pangur book chapters KEYShows the chapters OpenAlex lists for a book. Creates nothing.--json
pangur book split KEYCreates a book section for each chapter, and by default cuts the book's PDF to each section's pages. With OpenAlex chapters and no --yes, it lists them and stops.--attachment/-a KEY, --no-pdf, --manual/-m 'Title:12-30' (repeat; Title:12 is one page), --from-json FILE, --yes, --json

Manuscripts

CommandWhat it doesOptions
pangur manuscript create SHELFMARKCreates a manuscript record, optionally with its facsimile.--repository/-r, --title/-t (the shelfmark by default), --url, --file/-f PATH (a PDF or image to attach), --collection/-c, --connection, --json
pangur manuscript facsimiles KEYLists the facsimiles available for a manuscript: repository images, your photographs and uploaded files.--connection, --json
pangur manuscript link KEY URLLinks a repository viewer or IIIF manifest to a manuscript.--connection, --json
pangur manuscript leaves KEYLists a facsimile's leaves; --query finds a folio by its label.--source/-s, --query/-q, --offset (0), --limit/-n (50), --connection, --json
pangur manuscript leaf KEY INDEX -o FILESaves one leaf, or a region of it at full resolution, as an image. INDEX counts from 0.--output/-o (required), --source/-s, --region (full, or x,y,w,h), --enhance, --connection
pangur manuscript transcribe KEY INDEXReads one leaf twice with Pangur's vision model and saves a line-by-line transcription, which is then added to what Ask can search. Counts against the daily limit on manuscript transcriptions.--source/-s, --connection, --json
pangur manuscript transcription KEYPrints the saved transcription for a facsimile.--source/-s, --connection, --json
pangur manuscript export KEYExports a transcription as TEI P5, PAGE XML, ALTO v4 or plain text. TEI, PAGE and ALTO come as a ZIP with one file per page.--format/-f (tei, page, alto or txt), --reading/-r (diplomatic or expanded), --images (include page images; not with txt), --pages ("1-40" or "3,5,9-12"), --source/-s, --version (a named version), --output/-o, --connection

In the web app the same work is done on the transcription desk, and the export formats are described in TEI texts and transcription exports.

Reading in order, copies and groups

CommandWhat it doesOptions
pangur reading [KEY…]Prints the text of several items in order: the items named, a corpus or an arrangement. Each item's text is its TEI edition, transcription, analysed record or file text.the KEYs, or --corpus ID, or --arrangement ID with --node ID; for a corpus --view, --at, --grain, --entity, --role, --start, --end, --order; --style (diplomatic or expanded), --list (the order only), --connection, --json
pangur copies KEYLists an item's copies with the reading copy starred, or with --reading makes another copy the reading copy. KEY can be ms: followed by a catalogued manuscript's id.--reading SET_ID, --connection, --json
pangur groupsReads, creates or revises source groups, and prints JSON.--save FILE.json (create; with --group, update), --group ID, --connection
pangur arrange-texts KEY --arrangement IDDivides an item's text into separate texts and places them in an arrangement under a node for the item.--spans FILE.json or --from-analysis (one is required), --parent NODE, --connection, --json

A copy is a set of files that together show a resource, such as a scan or an afternoon's photographs, and the tools call it a surrogate set. Copies are managed in the web app as described in Manage copies and parts, and arrangements and source groups in Arrangements, source groups and vocabularies.

Corpora

These commands work on analysis corpora. Several of them print JSON only.

CommandWhat it doesOptions
pangur corpus listLists the project's corpora and how many of their sources have been analysed.--connection, --json
pangur corpus events CORPUSLists the events a corpus's sources describe, in date order.--start, --end, --entity, --connection, --json
pangur corpus records CORPUSLists the corpus's records with their evidence (JSON).--filters JSON, --offset (0), --limit (100), --connection
pangur corpus series CORPUSCounts records over time or by group, with the evidence behind the counts (JSON).--filters, --interval (year), --grouping (source), --measure (records), --connection
pangur corpus evidence CORPUS RECORDPrints one record's full evidence (JSON).--reading, --manifest, --connection
pangur corpus dating CORPUSPrints the corpus's dating assertions and their current revision (JSON).--connection
pangur corpus revise-dating CORPUS FILE.jsonAdds a dating revision.--connection
pangur corpus source-inventories CORPUSReads source inventories and import receipts (JSON).--import-key, --with-payload, --connection
pangur corpus stage-sources CORPUS FILE.jsonStages a source inventory without changing the live corpus.--connection
pangur corpus activate-sources CORPUS MANIFEST_ID VERSIONMakes a staged inventory live; refused if the corpus changed in between.--connection
pangur corpus rollback-sources CORPUS VERSIONRestores the previous inventory and keeps both.--connection

The staging, activation and rollback of source inventories are explained in Source inventories and assistant-submitted analysis.

Exhibitions

CommandWhat it doesOptions
pangur exhibitions listLists your exhibitions with their status and address.--connection, --json
pangur exhibitions show IDPrints an exhibition's sections and blocks.--json
pangur exhibitions publish IDPublishes an exhibition at its public address, if your plan allows another live exhibition.--visibility (public or password; left out, the exhibition keeps its own), --password (needed the first time an exhibition is protected; left out, it keeps its password)
pangur exhibitions unpublish IDTakes an exhibition down and keeps the draft.—

Publishing is not offered on every account or deployment. What publishing does, and how many exhibitions each plan keeps live, are set out in Publish, protect and take down an exhibition.

Project selection

A command with --connection works in the project you name by its id or address, both of which pangur projects lists. Without --connection, the server uses your default project, which is the one you opened last on any device. If a personal project and an organisation project share an address, the personal one is used.

These commands have no --connection option and always work in the default project:

  • overview, search, get, read, cite, collections and tags;
  • edit, delete, note and upload;
  • import search and import lookup (import add, import refs and import file do take --connection);
  • the book commands;
  • the refs commands, except refs import;
  • exhibitions show, exhibitions publish and exhibitions unpublish, which find the exhibition by its id.

institution, tasks and jobs belong to your account and cover every project. To run one of the default-project commands in another project, open that project in Pangur first.

If the project is scoped to one collection, every command sees only that collection and files new items into it. A viewer in an organisation project can read, ask and export, and every command that changes the project is refused.

Commands that use Pangur's model

Only two commands run Pangur's model and count against your allowances:

  • pangur ask without --materials counts as an Ask question on your plan and uses your daily model allowance.
  • pangur manuscript transcribe reads the leaf twice with the vision model and counts against the daily limit on manuscript transcriptions.

The citation scans behind pangur refs and pangur import refs may also use the model while they refine a scan in the background, within your daily model allowance. Every other command runs no model. The allowances themselves are set out in Plans, limits and usage.

Environment variables

All of these are optional, and the defaults point at pangur.io.

VariableDefaultEffect
ZCP_API_BASEhttps://pangur.ioThe Pangur server the command talks to.
ZCP_ISSUERhttps://auth.pangur.io/realms/zcpThe sign-in service.
ZCP_CLIENT_IDzcp-cliThe client used for device-code sign-in.
ZCP_BROWSER_CLIENT_IDzcp-cliThe client used for pangur login --browser.
ZCP_CREDENTIALS~/.config/zcp/credentials.jsonThe file the sign-in is saved in. Point it at a different file to keep a second account.
PANGUR_CLI_FEEDhttps://updates.pangur.io/pangur-cli/latest.jsonRead by the install script only: the release feed it installs from.

The command has no configuration file other than the credentials file, and no variable for a default project or output format.

On this page