I'm planning to write a tutorial on this topic, but one of things I've started doing is making a command line interfaces for common actions for my R projects.
So for my dissertation, I have dissertate

Each command justs calls an R function. For example, I have clean_site()
#' delete current bookdown files
clean_site <- function(...) {
rmarkdown::clean_site()
if (file.exists("./dissertation.Rmd")) {
message(" dissertation.Rmd")
invisible(file.remove("./dissertation.Rmd"))
}
}
Then, in the terminal, ./dissertate clean_site will run that function for me.
Here's an example of one of the CLI scripts I've written. The basic idea is to clean up the command line arguments then invoke the function named in the command line arguments.