I have the following configuration that only makes sense for vagrant up command:
config.vm.provider :virtualbox do |vb|
  vb.gui = false
  if ENV["VB_GUI"] == "true" then vb.gui = true
  else
     puts("[info] VB_GUI environment variable not set so running headless")
  end
end
Is it possible to hook into the vagrant API to retrieve the command currently being executed? E.g.
config.vm.provider :virtualbox do |vb|
  vb.gui = false
  if VAGRANT_API.command == "up"  # how can I do this?
    if ENV["VB_GUI"] == "true" then vb.gui = true
    else
       puts("[info] VB_GUI environment variable not set so running headless")
    end
  end
end