cdf.toml to configure the Cognite Toolkit CLI. The file is created automatically when you run the cdf modules init command.
The cdf.toml file is written in the TOML format and looks similar to this:
The cdf section
The cdf section contains these keys:
default_organization_dir(string): specifies the default organization directory to use if the--organization-dir/-oflag isn’t specified. The key is used by all commands that require the organization directory.default_env(string): specifies the default environment to use when the--env/-eflag isn’t specified. The key is used by all commands that require the environment.file_encoding(string, available from version0.5.14): specifies the encoding used by the Cognite Toolkit when reading configuration files from the/modulesdirectory. If not specified, the default depends on the operating system, typicallyutf-8on Linux and MacOS, andcp1252on Windows. We recommend usingutf-8to avoid issues with special characters and ensure compatibility across different platforms.file_upload_timeout_seconds(float, available from version0.7.139): specifies the timeout in seconds for uploading function code when running thecdf uploadcommand. To deploy a Cognite Function, the Cognite Toolkit first uploads a file with the function code and then references that file in the function configuration. If the upload exceeds the specified timeout, the deployment fails. The default value is120seconds.
The rules section
This section controls how cdf build reports insights. An insight is a finding in your configuration, such as a missing reference, a schema warning, or a recommendation. For example, referenced resources must be in the build or already exist in CDF.
ignore(list of strings): insight codes to skip in every file.cdf buildleaves these codes out of the terminal output and still writes them tobuild/insights.csv.enforce(boolean, defaultfalse): whentrue,cdf buildraises an error if any insight remains after ignored codes are filtered out, including errors, warnings, and recommendations. Setenforce = truein CI/CD when the build must be clean. Whenfalse,cdf buildlogs the violations tobuild/insights.csvand prints them in the terminal output.
# rules: ignore[CODE] or # rule: ignore[CODE]. Separate multiple codes with commas.
Insight codes
The Cognite Toolkit version 0.9 reports these insight codes. Use a code inrules.ignore or in a file comment.
The plugins section
This section turns plugins on or off. See the Plugins for more information.
The alpha_flags section
This section enables alpha features. Alpha features are experimental and may change or be removed in future releases.
The modules section
This section specifies the version of the modules found in the modules/ directory. The Cognite Toolkit uses it to ensure that the CLI matches the modules. It’s automatically updated when you run the cdf modules upgrade command.