@meetb, the commands.json file gets created in the home folder of the user who runs the agent.
On a Raspberry Pi I generally run the background service (daemon) as root because I'm dedicating the Pi to be a garage door opener, PiHole, or using it to wake up my PC. So I use /root/TRIGGERcmdData/commands.json and all of my commands have ground = background.
It's possible though that you might want to run X-Windows on your Pi and run the agent in foreground mode as pi, in which case you'd use the commands.json in pi's home folder.
Your commands.json file will be restored if the agent detects a problem in the json format, like a comma on the last entry, or if you forget to escape a quote or backslash. It restores the last valid commands.json file it had.