To access Commands, click on the Server icon at the top left of the Agent UI and "Commands" under System. You can also press "C" as a shortcut.

Agent comes with a few pre-built commands that act on multiple devices. These commands call the API under the hood to perform tasks. You can add your own commands here to call the API or to run other software on your computer.

Calling a script file

To run a generic script file, just add a .bat or (.sh on linux/ OSX) file to the commands directory. The filename (less the extension) will then appear in the Commands list and you can click to run it. (You may have to reload the UI).

Calling the API

Create a new .bat file in the Commands folder where Agent is installed. The first line of this file should be:
REM ispy-internal
This tells Agent that the file is to be processed by Agent, not run as it's own application. If this line is missing Agent will just execute the file as a regular batch file.

The rest of the file is processed as commands into Agent's API. For example:

REM ispy-internal
broadcast 'external cameras are on and recording'

These commands get appended to the API calls of the format /command.cgi?cmd=... So any commands using that format in the API are available.

The commands above will switch on all devices with the group name "external", switch off all devices with the group name "internal" and start recording on all devices with the group name "external". It'll then send a message to all connected clients.

See the readme command button for examples and the API for commands.

Make sure you use & to separate the parameters and not ?

Reload the UI and press "C" to open commands - your new command should show up in the list. Click on it to execute it.

New in you can use location names instead of groups - like switchon&location=home - assign a location to a device first!