Just a small tip , to run the foreground agent on the begin of the session , i put this command
node /home/YOURUSERNAME/TRIGGERcmd-Agent/src/agent.js --console > /dev/null 2>&1 &
on ./bashrc and then setup fot the terminal start on the begin of the session...
if any one have more ideias how to do it , just share