# cmc


    Tool for assembly, compilation, and validation of component manifests

    Usage: cmc [OPTIONS] <COMMAND>


**OPTIONS:**


      -s, --stamp <STAMP>  Stamp this file on success
      -h, --help           Print help

**SUBCOMMANDS:**


      validate-references  validate a component manifest against package manifest
      merge                merge the listed manifest files. Does NOT validate the resulting manifest
      include              recursively process contents from includes, and optionally validate the result
      check-includes       check if given includes are present in a given component manifest
      format               format a json file
      compile              compile a CML file
      print-cml-reference  print generated .cml reference documentation
      debug-print-cm       print pretty rust-debug-format-string representation of .cm file
      help                 Print this message or the help of the given subcommand(s)


## check-includes


    check if given includes are present in a given component manifest

    Usage: cmc check-includes [OPTIONS] <FILE> [expect]...

    Arguments:
      <FILE>
              file to process

      [expect]...



**OPTIONS:**


      -f, --fromfile <FROMFILE>
              response file for includes to expect

              If specified, additional includes to expect will be read from the path provided. The input format is delimited by newlines.

      -d, --depfile <DEPFILE>
              depfile for includes

              If specified, include paths will be listed here, delimited by newlines.

      -p, --includepath <INCLUDEPATH>...
              base paths for resolving includes

      -r, --includeroot <INCLUDEROOT>
              base path for resolving include paths that start with "//"

              \[default: ""]

      -h, --help
              Print help (see a summary with '-h')

## compile


    compile a CML file

    Usage: cmc compile [OPTIONS] --output <OUTPUT> <FILE>

    Arguments:
      <FILE>
              file to format


**OPTIONS:**


      -o, --output <OUTPUT>
              file to write the formatted results to

      -d, --depfile <DEPFILE>
              depfile for includes

              If specified, include paths will be listed here, delimited by newlines.

      -p, --includepath <INCLUDEPATH>...
              base paths for resolving includes

      -r, --includeroot <INCLUDEROOT>
              base path for resolving include paths that start with "//"

              \[default: .]

          --config-package-path <CONFIG_PACKAGE_PATH>
              path within the component's package at which its configuration will be available

      -f, --features <FEATURES>...
              The set of non-standard features to compile with. Only applies to CML files

          --experimental-force-runner <EXPERIMENTAL_FORCE_RUNNER>
              override runner to this value in resulting CML

              If specified, the program.runner field will be set to this value. This option is EXPERIMENTAL and subject to removal without warning.

          --must-offer-protocol <MUST_OFFER_PROTOCOL>
              protocols to verify that all children and collections are offered

              If specified, for each offer named, cmc will require that all children or collections in `files` have been offered a capability named for the offer specified.  This can be used to help find missing offers of important capabilities, like fuchsia.logger.LogSink

          --must-use-protocol <MUST_USE_PROTOCOL>
              protocols to verify that all children and collections are used

              If specified, for each offer named, cmc will require that the offer is in a use block. This can be used to help find missing usages of important capabilities, like fuchsia.logger.LogSink

          --must-offer-dictionary <MUST_OFFER_DICTIONARY>
              dictionaries to verify that all children and collections are used

              If specified, for each offer named, cmc will require that the offer is in a use block. This can be used to help find missing usages of important capabilities, like diagnostics

      -h, --help
              Print help (see a summary with '-h')

## debug-print-cm


    print pretty rust-debug-format-string representation of .cm file

    Usage: cmc debug-print-cm <FILE>

    Arguments:
      <FILE>  file to process


**OPTIONS:**


      -h, --help  Print help

## format


    format a json file

    Usage: cmc format [OPTIONS] [FILE]

    Arguments:
      [FILE]  file to format. If missing, use stdin


**OPTIONS:**


      -p, --pretty           deprecated and ignored. Please do not use (https://fxbug.dev/42060365)
          --cml              deprecated and ignored. Please do not use (https://fxbug.dev/42060365)
      -i, --in-place         replace the input file with the formatted output (implies `--output <inputfile>`)
      -o, --output <OUTPUT>  file to write the formatted results to, will print to stdout if not provided
      -h, --help             Print help

## include


    recursively process contents from includes, and optionally validate the result

    Usage: cmc include [OPTIONS] <FILE>

    Arguments:
      <FILE>
              file to process


**OPTIONS:**


      -o, --output <OUTPUT>
              file to write the merged results to, will print to stdout if not provided

      -d, --depfile <DEPFILE>
              depfile for includes

              If specified, include paths will be listed here, delimited by newlines.

      -p, --includepath <INCLUDEPATH>...
              base paths for resolving includes

      -r, --includeroot <INCLUDEROOT>
              base path for resolving include paths that start with "//"

              \[default: .]

          --validate <VALIDATE>
              validate the result

              \[default: true]
              \[possible values: true, false]

      -f, --features <FEATURES>...
              The set of non-standard features to compile with. Only applies to CML files

      -h, --help
              Print help (see a summary with '-h')

## merge


    merge the listed manifest files. Does NOT validate the resulting manifest.

    The semantics for merging are the same ones used for `include`: https://fuchsia.dev/reference/cml#include

    Usage: cmc merge [OPTIONS] [FILE]...

    Arguments:
      [FILE]...
              files to process

              If any file contains an array at its root, every object in the array will be merged into the final object.


**OPTIONS:**


      -o, --output <OUTPUT>
              file to write the merged results to, will print to stdout if not provided

      -f, --fromfile <FROMFILE>
              response file for files to process

              If specified, additional files to merge will be read from the path provided. The input format is delimited by newlines.

      -d, --depfile <DEPFILE>
              depfile for includes

              If specified, include paths will be listed here, delimited by newlines.

      -h, --help
              Print help (see a summary with '-h')

## print-cml-reference


    print generated .cml reference documentation

    Usage: cmc print-cml-reference [OPTIONS]


**OPTIONS:**


      -o, --output <file path>  If provided, will output generated reference documentation to a text file at the file path provided
      -h, --help                Print help

## validate-references


    validate a component manifest against package manifest

    Usage: cmc validate-references [OPTIONS] --component-manifest <Component Manifest> --package-manifest <Package Manifest>


**OPTIONS:**


      -c, --component-manifest <Component Manifest>
      -p, --package-manifest <Package Manifest>
      -e, --context <Free text label, for instance as context for errors printed>
      -h, --help                                                                   Print help