cdf init sets up a new Cognite Toolkit project. A Cognite Toolkit administrator runs it once, in an empty directory, to create the Git repository that data engineers later commit to.
Install the Cognite Toolkit CLI first. See Set up locally.
1
Start the wizard
Open a terminal in an empty directory and run:The wizard lists four tasks. Only Create toml file is required. You can rerun a task, and you can quit and come back later. When the required task has succeeded, quitting prints
Setup complete!.2
Create the cdf.toml file
Select Create toml file. The Cognite Toolkit asks for an optional subdirectory:Press Enter to use the current directory. If this repository will hold more than Cognite Toolkit configuration, enter a subdirectory name. The command writes
cdf.toml there. That file sets the CLI version and optional features. See cdf.toml.If cdf.toml already exists, the wizard skips this task.3
Set up authentication
Select Authentication. This runs the same wizard as
cdf auth init.Choose a device-code or interactive sign-in flow for local development. Choose client credentials for a CI/CD service account. The wizard writes a .env file and checks that the credentials can reach Cognite Data Fusion (CDF).See Authenticating with the Cognite Toolkit for the sign-in commands, and Authentication and authorization for how to register the identity provider application.4
Select modules
Select Modules. This runs the same wizard as
cdf modules init.You pick one or more deployment packs, then the environments to create. dev and prod are selected by default. staging is optional. If a module includes example data, the wizard asks whether to download it.The command creates a modules/ directory and a config.<environment>.yaml file for each environment you select. You can add more packs later with cdf modules add. See Working with modules and Deployment packs.5
Add the Git repository files
Run
git init in the project directory before this task. If the directory is not a Git repository, the Cognite Toolkit warns you and continues.Select Git repository. The wizard asks where you host the repository:- GitHub copies
.github/workflows/pipeline files. - Azure DevOps copies
.devops/pipeline files. - Other and None skip the pipeline template. Set up the pipeline yourself. See CI/CD.
.gitignore and .env.tmpl. Existing files are left in place. If .gitignore already exists, the command appends only the entries that are missing.The same files are what cdf repo init writes. After the pipelines exist, connect them to your Git host. See GitHub or Azure DevOps.