Terminal Power Users - How do you use command line tools in conjunction with Obsidian?

Just polished off my solution to archive any external links in my Vault.
I have some custom metadata based on @tallguyjenks PKM for any relevant URLs for that note.
I use grep to search recursively in the Obsidian vault for any file that contains the Metadata tag URL: I then just match text after that tag with http.* to return all URL’s (of importance) in my vault.

I then send those URL’s to Archivebox which will archive all the URL’s and of course skips any that is already in the archive.

It then updates all the notes that had URL’s archived with another metadata tag Archived: which then gets populated with the date as a link in ISO 8601 format.

This is really powerful for me as I do a lot of bookmarking in Obsidian, along with capturing various online media. Thankfully Archivebox is a reasonably robust way of making sure the website is captured in multiple formats, along with grabbing 99% of the media on a webpage.

Some improvements I’m working on are

  • Updating URL’s in the notes with the archived version.
  • The script runs with cron daily so I could probably only run this for files modified in the last day
  • Archive any link (more than just ones in the tag). This would be trivial to do.

If any of you have suggestions I would love to hear them!