Closed RobotSail closed 2 years ago
Logs should go to STDERR
, output should still go to STDOUT
. The output should now be formatted based on user specification, e.g. raw output, JSON, YAML.
The formats could vary depending on whether you're using filesets, regular files, etc.
{
"generatedFiles": [
{
"name": "generated.yaml"
"path": "path/to/dir"
"contents": "<generated contents>"
},
],
"errors": [
{
"error_code": "OPENAI_MISSING_TOKEN",
"message": "We couldn't find the OpenAI token, please make sure it is set",
}
]
}
This should be regardless of the --write
flag, e.g. should I also write or not.
Log level can be controlled by a verbosity setting, e.g. --verbose
would print out logs, --verbose 5
would be verbose with level 5.
At the time of writing, the
copilot-ops
CLI only has one way of printing the data to STDOUT: plaintext. This is not sufficient for integrating the CLI into other services since processes will need to be able to extract data efficiently. Copilot-ops should be able to format its output as JSON in addition to the current plaintext output.