Rename
The rename
command is used to rename document folders based on
a provided format or using add-folder-name
.
It will (except when run with --all
) bring up the picker with a list of
documents that match the query. In the picker, you can select one or more
documents and then initiate renaming by pressing enter. Folder names are cleaned,
so that various characters (white spaces, punctuation, capital letters, and some
others) are automatically converted.
Examples
Rename folders for documents whose author is “Rick Astley”. You can then either enter a new folder name or accept Papis’ suggestion. The suggested folder name will be generated according to
add-folder-name
or, if this option isn’t set, the current folder name.papis rename author:"Rick Astley"
You can use
--folder-name
to pass in your desired name. This option supports Papis formatting patterns. You will be asked for confirmation before the folder is renamed.papis rename --folder-name "{doc[author]}-never-gonna" author:"Rick Astley"
This will give you a folder named “rick-astley-never-gonna”.
To stop Papis from asking for confirmation, use the
--batch
flag:papis rename --batch author:"Rick Astley"
If you want to rename all documents without narrowing down your selection in the picker, you can use the
--all
flag. Be careful when combining this with--batch
, as you might end up renaming a lot folders without confirmation:papis rename --all author:"Rick Astley"
Command-line Interface
Rename document folders
papis rename [OPTIONS] [QUERY]
Options
- --folder-name <folder_name>
Name for the document’s folder (papis format)
- -b, --batch
Batch mode, do not prompt
- -h, --help
Show this message and exit.
- -a, --all
Apply action to all matching documents
- --git, --no-git
Commit changes to git
- --sort <FIELD>
Sort documents with respect to the FIELD
- --reverse
Reverse sort order
- --doc-folder <doc_folder>
Document folder on which to apply action
Arguments
- QUERY
Optional argument