Install
npm install -g @cognite/itg-cli
Commands
itg init
itg schema view
itg schema view --full
itg schema view --type=Equipment
itg schema validate -f mymodel.graphql
itg schema validate --fail-on-invalid -f mymodel.graphql
itg schema update -f mymodel.graphql
itg nodes add --type Equipment -f equipment.csv
itg nodes add --type Document -f documents.csv
itg relations add Equipment.documents -f relations.csv
itg prune
Global variables
Set the COGNITE_CREDENTIALS variable with an api key for the respective cdf project to get access
Set COGNITE_CREDENTIALS_CLIENT_ID and COGNITE_CREDENTIALS_CLIENT_SECRET variables (and COGNITE_TENANT if the clientId/secret are not for itg-testing tenant) with clientId & clientSecret for the respective cdf project to get access
CI/CD
We expect the main use of the CLI for CI/CD will be validating and updating schemas. The validate step should be added to the create pr
workflow, while the update step should be added to the merge to master
workflow. Remember to include the --fail-on-invalid
flag in the validate command to avoid false positives in the workflow.