Package: paperwork-shell
Paperwork-shellIntroductionPaperwork-shell provides 2 commands:paperwork-cli: Human-friendly command line interface. For instance, it
can be useful if you want to use Paperwork through SSH.paperwork-json: Designed to be used in scripts. Results can be parsed in
shell scripts usingjq.Both commands takes the same arguments as input. Only their outputs differ.From there,paperwork-xxxmeans eitherpaperwork-cliorpaperwork-json.OS/distribution specificsOn WindowsOnly paperwork-json is available.Installer doesn't modify your PATH. If you want to invoke paperwork-json,
you either have to modify your PATH yourself, or use the command
full path (ex:"c:\program files (x86)\Paperwork\paperwork-json.exe").In a Flatpak containerYou have to run the commands from inside the Flatpak container.flatpakrun--command="paperwork-cli"work.openpaper.Paperwork<arguments>For examples:flatpakrun--command="paperwork-cli"work.openpaper.Paperwork"--help"flatpakrun--command="paperwork-cli"work.openpaper.PaperworkchkdepsSub-commandsPaperwork-shell's commands expect sub-commands (similar togit). You can
obtain all the sub-commands and their expected arguments using--help(long help) or-h(short help).Not all sub-commands are described in this README. Available sub-commands may
vary based on what plugins are enabled or not. This README is just here
to give you a preview of the most common sub-commands usually available.chkdeps$paperwork-clichkdeps
Detectedsystem:debian10buster
Nothingtodo.Check for dependencies required bypaperwork-shell's plugins. It does NOT
check for dependencies required bypaperwork-gtk's plugins (for that, trypaperwork-gtk chkdepsinstead).If dependencies are missing, it will try to provide the command to install
them.config$paperwork-cliconfigshowsend_statistics=Trueuuid=1234567890statistics_last_run=1970-01-01statistics_protocol=httpsstatistics_server=openpaper.workstatistics_url=/beacon/post_statisticsworkdir=file:///home/jflesch/papersscanner_dev_id=libinsane:sane:epson2:net:192.168.42.18scanner_source_id=flatbedscanner_resolution=300ocr_lang=fracheck_for_update=Truelast_update_found=1.3.0-253-g032699cfupdate_last_run=1970-01-01update_protocol=httpsupdate_server=openpaper.workupdate_url=/beacon/latest

$paperwork-cliconfiggetworkdirworkdir=file:///home/jflesch/papers

$paperwork-cliconfigputworkdirstrfile:///home/jflesch/tmp/papersworkdir=file:///home/jflesch/tmp/paperspaperwork-xxx configprovides various sub-sub-commands to read and modify
Paperwork config and enable/disablepaperwork-shell's plugins.The one most important settings is the work directory path:workdir. It
indicates where documents managed by Paperwork must be stored. Itmustbe
an URL (file://xxx).plugins$paperwork-clipluginslist
openpaperwork_core.logs.print
openpaperwork_gtk.mainloop.glib
openpaperwork_core.config
paperwork_backend.beacon.stats
paperwork_backend.beacon.sysinfo(...)paperwork_shell.display.print
paperwork_shell.display.progress
paperwork_shell.display.scanpaperwork_shell.display.print
paperwork_shell.display.progress
paperwork_shell.display.scanWhile most settings are shared between Paperwork UIs (paperwork-shell and
paperwork-gtk), plugins lists arenot. If you want to modifypaperwork-gtk's plugin list, you have to usepaperwork-gtk pluginsinstead.If you want to enable or disable features, you can simply add or remove
the corresponding plugin. For instance, to disable the automatic OCR run
on imported documents or scanned pages:$paperwork-clipluginsremovepaperwork_backend.guesswork.ocr.pyocr
Pluginpaperwork_backend.guesswork.ocr.pyocrremovedpaperwork-cli plugins removeandpaperwork-cli plugins addtake
dependencies into account:removewill also remove all the plugins
that depends on the one you're removing.addwill also add all the
plugins required for the one you're adding.Some plugins are mandatory and cannot be disabled (mainly all the plugins
required to read the configuration file).If something go wrong, you can reset the plugin list to its default
withpaperwork-cli plugins reset.syncUpdate the content of search engine index, label guesser training, etc,
according to the current content of the work directory.If you modify the content of your work directory manually (without using
Paperwork commands), this is the command to run.This operation is also executed every timepaperwork-gtkis started.searchReturns documents that contains keywords identical or close to the one
specified. If no keyword is specified, all the documents are returned.Results are always ordered by decreasing dates.showShow a document page images and texts.scanner%paperwork-cliscannerlist

BROTHERDS-620(sheetfedscanner;sane:dsseries:usb:0x04F9:0x60E0)|--ID:libinsane:sane:dsseries:usb:0x04F9:0x60E0|--Source:feeder||--Resolutions:[75,100,125,150,175,200,225,250,275,300,325,350,375,400,425,450,475,500,525,550,575,600]CanonCanoScanN1240U/LiDE30(flatbedscanner;sane:plustek:libusb:001:024)|--ID:libinsane:sane:plustek:libusb:001:024|--Source:flatbed(Normal)||--Resolutions:[150,175,200,225,250,275,300,325,350,375,400,||425,450,475,500,525,550,575,600,625,650,675,||700,725,750,775,800,825,850,875,900,925,950,||975,1000,1025,1050,1075,1100,1125,1150,1175,||1200,1225,1250,1275,1300,1325,1350,1375,1400,||1425,1450,1475,1500,1525,1550,1575,1600,1625,||1650,1675,1700,1725,1750,1775,1800,1825,1850,||1875,1900,1925,1950,1975,2000,2025,2050,2075,||2100,2125,2150,2175,2200,2225,2250,2275,2300,||2325,2350,2375,2400]|--Source:flatbed(Transparency)||--Resolutions:[150,175,200,225,250,275,300,325,350,375,400,||425,450,475,500,525,550,575,600,625,650,675,||700,725,750,775,800,825,850,875,900,925,950,||975,1000,1025,1050,1075,1100,1125,1150,1175,||1200,1225,1250,1275,1300,1325,1350,1375,1400,||1425,1450,1475,1500,1525,1550,1575,1600,1625,||1650,1675,1700,1725,1750,1775,1800,1825,1850,||1875,1900,1925,1950,1975,2000,2025,2050,2075,||2100,2125,2150,2175,2200,2225,2250,2275,2300,||2325,2350,2375,2400]|--Source:flatbed(Negative)||--Resolutions:[150,175,200,225,250,275,300,325,350,375,400,||425,450,475,500,525,550,575,600,625,650,675,||700,725,750,775,800,825,850,875,900,925,950,||975,1000,1025,1050,1075,1100,1125,1150,1175,||1200,1225,1250,1275,1300,1325,1350,1375,1400,||1425,1450,1475,1500,1525,1550,1575,1600,1625,||1650,1675,1700,1725,1750,1775,1800,1825,1850,||1875,1900,1925,1950,1975,2000,2025,2050,2075,||2100,2125,2150,2175,2200,2225,2250,2275,2300,||2325,2350,2375,2400]EpsonPID08C1(flatbedscanner;sane:epson2:net:192.168.42.18)|--ID:libinsane:sane:epson2:net:192.168.42.18|--Source:flatbed||--Resolutions:[75,100,150,300,600]%paperwork-cliscannerset"libinsane:sane:epson2:net:192.168.42.18"Defaultsource:flatbed
ID:libinsane:sane:epson2:net:192.168.42.18
Source:flatbed
Resolution:300Provides subcommands to list the available scanners and get and set the scanner
to use and its settings. When configuring the scanner, it checks that the
provided settings are actually consistent with what the scanner provides. You
can bypass those checks by usingpaperwork-cli configinstead.If you get warnings and errors from the Libinsane, you can safely ignore them
unless you didn't get the scanner you were looking for in the list.scanScan all the page(s) available in the scanner. Append all the pages to the
specified document (-d). If no document is specified, a new one will be
created.If you get warnings and errors from the Libinsane, you can safely ignore them
unless the scan didn't work.import$paperwork-cliimport100227398115.pdf
Importing['100227398115.pdf']...[index_update]Indexingnewdocument20191113_1255_32
Committingchangesinlabelguesserdatabase...Done
Committingchangesintheindex...Done
Done
Importresult:
-Importedfiles:{'file:///home/jflesch/tmp/pdf/100227398115.pdf'}-Non-importedfiles:set()-Newdocuments:{'20191113_1255_32'}-Updateddocuments:set()-PDF:1-Documents:1Import images of PDF files.Images are appended to the specified document (-d). If no document is
specified, a new one is created.PDF are always imported as a new document, even if a document ID is specified.labelAdd and remove labels on documents.When adding a label, if the label already exists on other documents,
the existing color will be reused. If it does not exist yet, either
the user has specified a color (-c #abcdef), or a random one will be
generated.editBasic editing of page images.Modifiers must be specified. Many can provided in one shot so the OCR is only
run once.resetReturns a page image to its initial state. It will also cancel any changes made
by post-processing plugins after importing or scanning.delete$paperwork-clidelete20191113_1255_32
Deletedocument20191113_1255_32?[y/N]y
Deletingdocument20191113_1255_32...

$paperwork-clidelete20191112_2117_09-p1Deletepage(s)[1]ofdocument20191112_2117_09?[y/N]y
Deletingpage1ofdocument20191112_2117_09...[WARNING][paperwork_backend.model.workdir]Allpagesofdocumentfile:///home/jflesch/tmp/papers/20191112_2117_09havebeenremoved.RemovingdocumentDelete page(s) or a whole document.export$paperwork-cliexport20191107_2343_44
Currentfilters:[]Nextpossiblefilters:
-img_boxes

$paperwork-cliexport20191107_2343_44-fimg_boxes
Currentfilters:['img_boxes']Nextpossiblefilters:
-unpaper
-swt_soft
-swt_hard
-generated_pdf
-bw
-grayscale
-bmp
-gif
-jpeg
-png
-tiff

$paperwork-cliexport20191107_2343_44-fimg_boxes-fgenerated_pdf
Currentfilters:['img_boxes','generated_pdf']'generated_pdf'isanoutputfilter.Nototherfiltercanbeaddedafter'generated_pdf'.

$paperwork-cliexport20191107_2343_44-fimg_boxes-fgenerated_pdf-o~/tmp/out.pdf
Exportingtofile:///home/jflesch/tmp/out.pdf...DoneExport a document or page(s).An export is seen as processing pipeline (in other words, filter list).
Selecting a document or a page (-p) represent the input or the pipe.
Various processing components (pipes) can be chained. Some of them can be
used at the end of the pipe. There are restrictions on which components
can follow each other.For instances:Somewhere beforegenerated_pdf, you must have a componentimg_boxesto turn the input document or page(s) into a bunch of images and text boxes.Only a PDF document can be used as input for the componentunmodified_pdfand no other components can precede it.Shell scriptsYou can have a look atsome examples of Bash scripts.