mitchellh/packer — pull request #274 by mitchellh (2013-08-12 01:33:06+00:00)
Title: Machine readable output [RFC]

The next big thing I'm going to embark on is adding machine-readable output to Packer. This will allow Packer to more easily be used in CI and human-less environments while allowing important information such as artifacts to be parsed out.

I strongly believe in adding machine-readable output over adding something like a REST server/HTTP API to the project. I see Packer as a command-line tool that should, as much as possible, behave in a Unixy way (even if you're running it on Windows).

My proposal is to add a global `--machine-readable` flag to `packer`. This would globally switch ALL output to machine readable. This output would go on stdout. Log output, if it exists, continues to go on stderr.

The FORMAT of the output is particularly bothersome. People have recommended JSON or something but I'm adamant in keeping the output friendly to traditional Unix programs like sed, grep, awk, and so on. Therefore the only real option is a delimited, new-line oriented output format.

The format I'm thinking is structured like the following:

```
timestamp,target,type,data...
```

Example:

```
1376268547,amazon-ebs,machine,instance-id,i-123456789
1376268547,amazon-ebs,machine,public-dns,abcd.amazonaws.com
1376268547,amazon-ebs,artifact-id,ami-12345678
```

The types and data that is associated with a type will have to be carefully documented. There will be a set of built-in types that builders/provisioners/etc. should follow but ultimately it is up to anyone to do what they want.

I want this in for 0.3.0.