Cache
This command allows the user to interact with the Papis cache (database).
To clear the cache (remove it from the filesystem), you can run the following command:
papis cache clear
This command is also useful for plugin developers.
Let us suppose that you are editing the YAML file of a document at path
/path/to/info.yaml.
If you are editing this file without the machinery of Papis
you might want to make Papis aware of this change by using the update
subcommand. You might do:
papis cache update --doc-folder /path/to
or maybe by query:
papis cache update query-matching-document
Furthermore, a noteworthy subcommand is update-newer, which
updates the cache for those documents whose info file is newer than
the cache itself. This subcommand has the same interface as most
papis commands, so that if you want to check all documents you have to
input:
papis cache update-newer --all
This command is much faster than rebuilding the cache from scratch. You can therefore run this command once in a while in order to update the cache for those documents that have been synchronized by the means of synchronization that you are using, for instance using git, Syncthing, Dropbox, etc.
Command-line interface
Manage the cache (database) of a Papis library.
Usage
papis cache [OPTIONS] COMMAND [ARGS]...
Options
- -h, --help
Show this message and exit.
add
Add a document to the cache.
This is useful for adding single folders from a previous synchronization step.
Usage
papis cache add [OPTIONS]
Options
- -h, --help
Show this message and exit.
- --doc-folder <doc_folder>
Document folder on which to apply action.
clear
Clear the cache from disk.
The next invocation of any command that uses the cache will rebuild it.
Usage
papis cache clear [OPTIONS]
Options
- -h, --help
Show this message and exit.
pwd
Print the path to the cache file or directory.
Usage
papis cache pwd [OPTIONS]
Options
- -h, --help
Show this message and exit.
reset
Reset the cache (clear and rebuild).
Usage
papis cache reset [OPTIONS]
Options
- -h, --help
Show this message and exit.
rm
Delete documents from the cache.
Usage
papis cache rm [OPTIONS] [QUERY]
Options
- -h, --help
Show this message and exit.
- --doc-folder <doc_folder>
Document folder on which to apply action.
- -a, --all
Apply action to all matching documents.
- --sort <FIELD>
Sort documents with respect to the FIELD.
- --reverse
Reverse sort order.
Arguments
- QUERY
Optional argument
update
Reload info.yaml files from disk and update the cache.
Usage
papis cache update [OPTIONS] [QUERY]
Options
- -h, --help
Show this message and exit.
- --doc-folder <doc_folder>
Document folder on which to apply action.
- -a, --all
Apply action to all matching documents.
- --sort <FIELD>
Sort documents with respect to the FIELD.
- --reverse
Reverse sort order.
Arguments
- QUERY
Optional argument
update-newer
Update documents newer than the cache modification time.
Usage
papis cache update-newer [OPTIONS] [QUERY]
Options
- -h, --help
Show this message and exit.
- --doc-folder <doc_folder>
Document folder on which to apply action.
- -a, --all
Apply action to all matching documents.
- --sort <FIELD>
Sort documents with respect to the FIELD.
- --reverse
Reverse sort order.
Arguments
- QUERY
Optional argument