# NFCommander command API This interfaces specifies the way NFCommander calls and communicates with the tools actually implementing the commands specified on tags. ## Specification TBD ## Execution The command executable is spawned when the tag has been detected, read and parsed. The `stdin` and `stdout` streams are connected to NFCommander and are used to exchange data and commands. Once the tag is removed, NFCommander will send a SIGINT signal to the process. The process is required to handle this signal and appropriately release any resources held. Should the process terminate before the tag is removed, it is not respawned until the tag has been removed and presented to the reader again. ## Parameters & Environment The command process receives as its first argument the static part of the tag command. The second parameter will be the dynamic part at the time of tag presentation, if present. The command process will find in its environment the following variables: * `TAG_UID`: UID of the tag that caused the execution of the command ## Communication Commands may receive subsequent instructions (e.g. physical button presses) via their stdin stream. This feature is not yet specified or implemented, but may become available in subsequent releases. Commands may control the dynamic data section of the present tag using commands on their stdout stream. This feature can be used to persist a limited amount of state across tag presentations. To set the dynamic data of the current tag, a command may send the following newline-terminated (\r\n) command: `DYNAMIC `