It all starts with defining exactly what task needs to be run, and designing it in a way that doesn't require human intervention to run.
Some ideal characteristic points are as follows:
- Single, clear entry point: No confusion on what the task to run is.
- Clear parameters: If there are any parameters, they should be very explicit.
- No interactivity: Stopping the execution to request information from the user is not possible.
- The result should be stored: To be able to be checked at a different time than when it runs.
- Clear result: If we are working interactively in a result, we accept more verbose results, or progress reports. But, for an automated task, the final result should be as concise and to the point as possible.
- Errors should be logged: To analyze what went wrong.
A command-line program has a lot of those characteristics already. It has a clear way...