Skip to main content

dfx schema

The dfx schema command prints the schema for dfx.json.

Basic usage

dfx schema [option] [flag]

Flags

You can use the following optional flags with the dfx schema command.

FlagDescription
-h, --helpDisplays usage information.
-V, --versionDisplays version information.

Options

You can use the following option with the dfx schema command.

OptionDescription
--for <dfx/networks>Display schema for either dfx.json or networks.json. (default: dfx)
--outfile <outfile>Specifies a file to output the schema to instead of printing it to stdout.

Examples

You can print the schema for dfx.json by running the following command:

dfx schema

You can print the schema for networks.json by running the following command:

dfx schema --for networks

If you want to write the schema for dfx.json to path/to/file/schema.json, you can do so by running the following command:

dfx schema --outfile path/to/file/schema.json