REnv - possible to auto-snapshot?

We're experimenting with REnv at the moment, and I'm finding the need to call renv::snapshot a bit painful - it's far too easy for our users to forget to call it.

Is there any way to just make renv automatically update the snapshot whenever a new package is installed? If the installation goes wrong - in the majority of cases where the user wants the package, then that means everything just works... and in the minority of cases where the package isn't wanted, then the user can manually rollback those changes (e.g. using git revert). It feels to me like this is a simpler workflow for the user... but maybe I'm missing some use cases where this wouldn't work.

I'd love it if there were some option (e.g. in Rprofile or Renviron) which could turn this sort of behaviour on...

I guess this might be better as an issue (or PR) in the github repo... but I thought I'd ask here first...

experiment with

options(renv.config.auto.snapshot = TRUE)

Thanks - that looks useful... now wondering if we can just redirect the other install package mechanisms to that one... will have a play/experiment - thanks!

Hmm.... looks like the shim might already "just work" with install.packages... :slight_smile: