CGI scripts can be written in many languages like Perl or PhP.
Most of them can be run from the command line too.
The only disadvantage is that the code may not have all the input parameters it expects, which can
lead to errors of course.
So, please provide additional details on what you are trying to achieve.