Context: this issue ties in perfectly with #497 (specifically #497 (comment))
Currently, almost all our commands (excluding actor get-input, get-value, push-data and set-value) return strictly human readable content.
For example, when running apify call apify/hello-world, what you'll get is something like this:

This is fine for normal users:
- it sometimes prints our update checker (which needs to be moved to stderr)
- it prints the fact the actor is getting called
- it prints the logs of the run
- it returns the actor run detail shortcut
- and then ends with a success/error message, whichever is the status
This is not processable at ALL with CLI tools. A lot of CLI tools have a way to return just a JSON blob that can passed down to jq, curl, or w/e users want.
We should add in a flag to all commands that print user-readable data but could also print machine-readable data. I propose either --api, --raw or any other names you can come up with. Regardless of the name, it must be a flag that can be expected on all commands, is not likely to clash with other params, and is clear enough.
We also need to decide whether certain logs should be printed to stderr instead of stdout (like the logs for an actor call). We also need to decide on adding a flag for that to not print the logs, but that can be sort-of achieved with setting wait-for-finish to 0 and not printing logs in that case (or should, thats another bug :) )
CC @jancurn @netmilk @B4nan @barjin
Context: this issue ties in perfectly with #497 (specifically #497 (comment))
Currently, almost all our commands (excluding actor get-input, get-value, push-data and set-value) return strictly human readable content.
For example, when running
apify call apify/hello-world, what you'll get is something like this:This is fine for normal users:
This is not processable at ALL with CLI tools. A lot of CLI tools have a way to return just a JSON blob that can passed down to
jq,curl, or w/e users want.We should add in a flag to all commands that print user-readable data but could also print machine-readable data. I propose either
--api,--rawor any other names you can come up with. Regardless of the name, it must be a flag that can be expected on all commands, is not likely to clash with other params, and is clear enough.We also need to decide whether certain logs should be printed to stderr instead of stdout (like the logs for an actor call). We also need to decide on adding a flag for that to not print the logs, but that can be sort-of achieved with setting wait-for-finish to 0 and not printing logs in that case (or should, thats another bug :) )
CC @jancurn @netmilk @B4nan @barjin