Q:

How can I send a Tmux prefix command from outside?

I'm writing a Rakefile to configure Tmux on my machines. After installing Tmux Plugin Manager you're supposed to do prefix + I. I want to do that from my Rakefile.
I've been reading into the $ tmux send-keys command but I haven't been able to figure out how to send a prefix (and on the same not, I'm not even sure send-keys is the way to go).
Basically I want to start a Tmux session in detached mode and pass prefix + I, from the shell. How can I do this?

A:

Generally, you don't send prefix commands into tmux-- you run the tmux command directly that the keyboard shortcuts would run. 
For your specific case, read the source code of Tmux Plugin Manager. See what it does when  prefix + I is used, and then run the same commands yourself. It probably amounts to downloading and copying some files into ~/.tmux/plugins/

