Find song/sheet music PDF files from Google Drive and merge them into a single PDF. Use when the user wants to: (1) combine worship song PDFs or sheet music from Drive into one file, (2) search a Drive folder for PDFs by name/keyword and merge them, (3) create a combined songbook or order-of-service PDF from Google Drive files. Requires gog CLI with Drive access configured. Triggers on phrases like "merge PDFs from Drive", "combine song sheets", "find song PDFs", "create combined PDF from Google Drive".
Search Google Drive for PDF files and merge them into a single PDF using gog + pypdf.
gog CLI with Drive access (gog auth add <email> --services drive)pypdf: auto-installed by script if missing (pip install pypdf)python3 scripts/merge_pdfs.py \
--files <file_id1> <file_id2> <file_id3> \
--output ~/Desktop/combined.pdf \
--account [email protected]
python3 scripts/merge_pdfs.py \
--folder <folder_id> \
--output ~/Desktop/combined.pdf \
--account [email protected]
python3 scripts/merge_pdfs.py \
--query "name contains 'hymn'" \
--output ~/Desktop/combined.pdf \
--account [email protected]
python3 scripts/merge_pdfs.py \
--folder <folder_id> \
--query "name contains '詩歌'" \
--output ~/Desktop/songs.pdf \
--account [email protected] \
--max 100
Find files: Use gog drive search to locate PDFs. To explore:
gog drive search "mimeType = 'application/pdf' and trashed = false" --max 20 --account <email>
gog drive search "'<folder_id>' in parents and mimeType = 'application/pdf'" --max 20 --account <email>
Find folder IDs:
gog drive search "mimeType = 'application/vnd.google-apps.folder' and name contains '樂譜'" --account <email>
Run the merge script with the results.
01_song.pdf, 02_song.pdf)--max to limit results (default 50).pdfEdit PDFs with natural-language instructions using the nano-pdf CLI.