--- layout: "docs_machine_readable" page_title: "Command: build - Machine-Readable Reference" --- # Build Command Types These are the machine-readable types that exist as part of the output of `packer build`.
Information about an artifact of the targetted item. This is a fairly complex (but uniform!) machine-readable type that contains subtypes. The subtypes are documented within this page in the syntax of "artifact subtype: SUBTYPE". The number of arguments within that subtype is in addition to the artifact args.
Data 1: index - The zero-based index of the artifact being described. This goes up to "artifact-count" (see below).
Data 2: subtype - The subtype that describes the remaining arguments. See the documentation for the subtype docs throughout this page.
Data 3..n: subtype data - Zero or more additional data points related to the subtype. The exact count and meaning of this subtypes comes from the subtype documentation.
The number of artifacts associated with the given target. This will always be outputted _before_ any other artifact information, so you're able to know how many upcoming artifacts to look for.
Data 1: count - The number of artifacts as a base 10 integer.
The unique ID of the builder that created this artifact.
Data 1: id - The unique ID of the builder.
The last machine-readable output line outputted for an artifact. This is a sentinel value so you know that no more data related to the targetted artifact will be outputted.
A single file associated with the artifact. There are 0 to "files-count" of these entries to describe every file that is part of the artifact.
Data 1: index - Zero-based index of the file. This goes from 0 to "files-count" minus one.
Data 2: filename - The filename.
The number of files associated with this artifact. Not all artifacts have files associated with it.
Data 1: count - The number of files.
The ID (if any) of the artifact that was built. Not all artifacts have associated IDs. For example, AMIs built have IDs associated with them, but VirtualBox images do not. The exact format of the ID is specific to the builder.
Data 1: id - The ID of the artifact.
If present, this means that the artifact was nil, or that the targetted build completed successfully but no artifact was created.
The human-readable string description of the artifact provided by the artifact itself.
Data 1: string - The string output for the artifact.
The number of errors that occurred during the build. This will always be outputted before any errors so you know how many are coming.
Data 1: count - The number of build errors as a base 10 integer.
A build error that occurred. The target of this output will be the build that had the error.
Data 1: error - The error message as a string.