Package: papermerge-cli
Papermerge CliCommand line utility which uses REST API to interact with your Papermerge DMS
instance. You can usepapermerge-cli, for example, to recursively import local folder to
your Papermerge DMS instance.RequirementsIn order to usepapermerge-cliyou need to have python installed.
You needpythonversion >= 3.10.Install$ pip install papermerge-clipipis package installer for python - it usually comes with python
interpreter. In order to installpipon Ubuntu use following command:$ sudo apt install python3-pipREST API/CLI Version CompatibilityREST API column - is version of Papermerge REST API server. This value
you can get from:$ papermerge-cli server-versionCLI column - is version of papermege-cli command line utility. This value
you can get from:$ papermerge-cli --versionREST APICLI=3.0=0.7=2.1= 0.3.3UsageGet you REST API authentication token from your instance:$ papermerge-cli --host=https://mydms.some-vps.com authOr you can provide host as environment variable:$ export PAPERMERGE_CLI__HOST=https://mydms.some-vps.com
$ papermerge-cli authPapermerge Cli will prompt you for username and password. On successfull
authentication your REST API token will be displayed - now you can use
this token for all subsequent authentications.Use token for authentication by exporting token asPAPERMERGE_CLI__TOKENenvironment variable:$ export PAPERMERGE_CLI__TOKEN=mytokenlistNow, withPAPERMERGE_CLI__HOSTandPAPERMERGE_CLI__TOKENenvironment
variables set you can use list content of you home folder:$ papermerge-cli listIn order to list content of specific folder (including inbox folder):$ papermerge-cli list --parent-uuid=UUID-of-the-foldermeIn order to see current user details (current user UUID, home folder UUID, inbox
folder UUID, username etc):$ papermerge-cli mepref-listList all preferences:$ papermerge-cli pref-listList specific section of the preferences$ papermerge-cli pref-list --section=ocrShow value of preferencetriggerfrom sectionocr:$ papermerge-cli pref-list --section=ocr --name=triggerpref-updateUpdate value of the preferencetriggerfrom sectionocr:$ papermerge-cli pref-update --section=ocr --name=trigger --value=autoimportRecursively imports folder from local filesystem. For example, in order
to import recursively all documents from local folder:$ papermerge-cli import /path/to/local/folder/You can also import one single document$ papermerge-cli import /path/to/some/document.pdfIf you want the local copy the uploaded documentsto be deletedafter
successful import - add--deleteflag:$ papermerge-cli import --delete /path/to/folder/PLEASE BE CAREFUL WITH--deleteFLAG AS IT WILL IRREVERSIBLE DELETE THE LOCAL
COPY OF THE UPLOADED DOCUMENT!Choose to skip OCR of imported documents with--skip-ocrflag:$ papermerge-cli import --skip-ocr /path/to/folder/Skip OCR flag can be used with folders (will apply to all docs in the folder)
or with individual documents.--skip-ocrflag will work only with Papermerge REST API >= v3.1searchSearch for node (document or folder) by text or by tags:$ papermerge-cli search -q apothekeReturns all documents (or folders with such title) containing OCRed
text 'apotheke'.You can search by tags only:$ papermerge-cli search --tags importantWill search for all documents (and folders) which were tagged with
tag 'important' When multiple tags are provided, by default, will search for
nodes with all mentioned tags:$ papermerge-cli search --tags important,letters  # returns nodes with both tags important AND lettersIn case you want to search for nodes with ANY of the provided tags, usetags-opparameter:$ papermerge-cli search --tags important,letters --tags-op anyFinally,tagsandqmay be combined:$ papermerge-cli search --tags important -q apartmentdownloadDownloads a folder or a document:$ papermerge-cli download --uuid <document or folder uuid>In case uuid is the ID of specific folder - a zip file will be downloaded; zip
file will contain all nodes insides specified folder.You can use--uuidmultiple times:$ papermerge-cli download --uuid <uuid of doc1> --uuid <uuid of doc2> --uuid <uuid of folder 1>If you want to download content to specific file on your file-system, use-foption:$ papermerge-cli download --uuid <doc-uuid> -f /path/to/file-system/document.pdfor in case of uuid is a folder:$ papermerge-cli download --uuid <folder-uuid>  -f /path/to/file-system/folder.zipYou can also specify the format/type of the downloaded archive (e.g. in case node is either a folder):$ papermerge-cli download --uuid <folder-uuid>  -f /path/to/file-system/folder.targz -t targzVersion CompatiblityCLI VersionREST API versionRemarks0.7.03.0.x0.7.13.0.x0.8.03.1.xSkip OCR feature introduced