cmc



Tool for assembly, compilation, and validation of component manifests.

USAGE:
    cmc [OPTIONS] <SUBCOMMAND>


OPTIONS:


    -h, --help
            Prints help information

    -V, --version
            Prints version information

    -s, --stamp <stamp>
            Stamp this file on success


SUBCOMMANDS:


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

check-includes


cmc-check-includes
check if given includes are present in a given component manifest

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

ARGS:
    <FILE>
            file to process

    <expect>...



OPTIONS:


    -h, --help
            Prints help information

    -V, --version
            Prints version information

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

            If specified, include paths will be listed here, delimited by newlines.
    -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.
    -p, --includepath <includepath>...
            base paths for resolving includes [default: ]

    -r, --includeroot <includeroot>
            base path for resolving include paths that start with "//" [default: ]


compile


cmc-compile
compile a CML file

USAGE:
    cmc compile [OPTIONS] <FILE> --output <output>

ARGS:
    <FILE>
            file to format


OPTIONS:


    -h, --help
            Prints help information

    -V, --version
            Prints version information

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

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

            If specified, include paths will be listed here, delimited by newlines.
        --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.
    -f, --features <features>...
            The set of non-standard features to compile with. Only applies to CML files.

    -p, --includepath <includepath>...
            base paths for resolving includes [default: ]

    -r, --includeroot <includeroot>
            base path for resolving include paths that start with "//" [default: ]

        --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
    -o, --output <output>
            file to write the formatted results to


debug-print-cm


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

USAGE:
    cmc debug-print-cm <FILE>


OPTIONS:


    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <FILE>    file to process

format


cmc-format
format a json file

USAGE:
    cmc format [FLAGS] [OPTIONS] <FILE>


OPTIONS:


        --cml         deprecated and ignored. Please do not use (https://fxbug.dev/42060365).
    -h, --help        Prints help information
    -i, --in-place    replace the input file with the formatted output (implies `--output <inputfile>`)
    -p, --pretty      deprecated and ignored. Please do not use (https://fxbug.dev/42060365).
    -V, --version     Prints version information

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

ARGS:
    <FILE>    file to format

include


cmc-include
recursively process contents from includes, and optionally validate the result

USAGE:
    cmc include [OPTIONS] <FILE>

ARGS:
    <FILE>
            file to process


OPTIONS:


    -h, --help
            Prints help information

    -V, --version
            Prints version information

    -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 [default: ]

    -r, --includeroot <includeroot>
            base path for resolving include paths that start with "//" [default: ]

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

        --validate <validate>
            validate the result [default: true]


merge


cmc-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]...

ARGS:
    <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:


    -h, --help
            Prints help information

    -V, --version
            Prints version information

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

            If specified, include paths will be listed here, delimited by newlines.
    -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.
    -o, --output <output>
            file to write the merged results to, will print to stdout if not provided



cmc-print-cml-reference
print generated .cml reference documentation

USAGE:
    cmc print-cml-reference [OPTIONS]


OPTIONS:


    -h, --help       Prints help information
    -V, --version    Prints version information

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

validate


cmc-validate
validate that one or more cml files are valid

USAGE:
    cmc validate [OPTIONS] [--] [FILE]...


OPTIONS:

-h, --help
        Prints help information

-V, --version
        Prints version information

    --must-offer-protocol <must_offer_protocol>...
        verifies that all children and collections are offered the given protocols

        If specified, for each protocol named, cmc will require that all children or collections in `files` have
        been offered the given protocol. This can be used to help find missing offers of capabilities like
        `fuchsia.logger.LogSink`
    --must-use-protocol <must_use_protocol>...
        verifies that components use the given protocols

        If specified, for each protocol named, cmc will require that each component in `files` uses the given
        protocol. This can be used to help find missing usages of capabilities like `fuchsia.logger.LogSink`

ARGS: ... files to process

validate-references


cmc-validate-references
validate a component manifest against package manifest.

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


OPTIONS:


    -h, --help       Prints help information
    -V, --version    Prints version information

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