The CLI has basic support for being called to generate web pages. It does not support all of CGI (Common Gateway Interface), but it can print an HTTP header.
For a CGI enabled web directory, prepend the shell command to run tpt to the top of your template.
#!/usr/local/bin/tpt --cgiheader