CLI Reference

DvCliAdaptive is a command-line interface for working with DaVinci Developer Adaptive projects. The CLI provides commands to inspect project contents, validate, generate, and run script tasks. This reference summarizes commands and their options and usage as well as exit codes.

Basic Syntax

DvCliAdaptive [-v | --version] [-h | --help] [COMMAND] [ARGS…​]

Global Options

  • -v, --version

    Prints version information and exits.

  • -h, --help

    Displays general help and exits.

  • --telemetry

    Enables sending telemetry data to Vector.

Commands

Overview

Command Purpose

list-generators

Lists the currently available generators.

list-model-files

Lists all files used in the loaded project/model.

list-scopes

Lists all available scopes in the loaded project/model.

Lists all available script tasks.

validate

Validates the given project and reports any issues.

generate

Validates and then generates the given project.

run

Executes the specified script task(s).

export

Exports the merged model of a project/model into a single arxml file.

Using Abbreviations

The DaVinci Developer Adaptive CLI supports abbreviations. If the CLI finds exactly one match, then the command is executed. If the CLI finds multiple matches, execution of the CLI is cancelled.

Case-Sensitivity:

  • Abbreviations: case-insensitive

  • Full command: case-insensitive

Examples:

# Command
list-model-files
# Case-insensitive full command
list-Model-Files
# Case-insensitive abbreviated command
list-M-F or l-M-F.

Common Options

The following argument options are available for almost all commands. The exception is list-generators with only the basic options.

Basic Options

Argument Purpose

-b=<folder>, --bsw-package=<folder>

Directory of the BSW package.

--log-file=<file>

Specifies the path for the log file.

--verbose

Enables the verbose output of logging messages.

-h, --help

Display the help.

Project Options

Specify the path to a ADPA project (-p) OR to the model folders (--models). You cannot use both arguments for the same command line.

Table 1. Project Options
Argument Purpose

-p=<file>, --project=<file>

Specifies the path to an ADPA project.

--models=<folder>[,<folder>…​]

Specifies the paths to folders containing model files.

--referenced-projects=<folder>[,<folder>…​]

Specifies additional search locations for referenced projects.

--no-mex-migration

Disables the execution of automatic MEX migration.

--save

Persists any changes to the files after execution.

--schema-validation

Validates the model against the schema.

Command Options and Usage

list-generators

Lists the currently available generators.

Syntax: DvCliAdaptive list-generators [ARGS…​]

Examples:

DvCliAdaptive list-generators
DvCliAdaptive list-generators -b=./bsw –verbose
DvCliAdaptive list-generators --log-file=output.log
DvCliAdaptive list-generators --help

Options:

list-model-files

Lists all files used in the loaded project/model.

Syntax: DvCliAdaptive list-model-files [ARGS…​]

Examples:

DvCliAdaptive list-model-files
    -p="C:\Project\main.adpa"

DvCliAdaptive list-model-files
    -b="C:\BSW"
    --models="C:\Models\A,C:\Models\B"
    --log-file="C:\Logs\example.log"
    --save
    --schema-validation

Options:

list-scopes

Lists all available scopes in the loaded project/model.

Syntax: DvCliAdaptive list-scopes [ARGS…​]

Example:

DvCliAdaptive list-scopes
    --p="C:\project\main.adpa"
    --referenced-projects="D:\project\myotherproject.adpa,D:\dev\projects\project.adpa"
    --save
    --schema-validation

DvCliAdaptive list-scopes
    --models="C:\Models\A,C:\Models\B"

Options:

list-script-tasks

Lists all available script tasks.

Syntax: DvCliAdaptive list-script-tasks [ARGS…​]

Example:

DvCliAdaptive list-script-tasks
    -p="project.adpa"

DvCliAdaptive list-script-tasks
    --models="/home/user/models/base,/home/user/models/extended"
    --tasks="InitTask,ValidateTask"
    --task-args="InitTask:mode=fast"
    --task-args="ValidateTask:level=high"

Options:

Table 2. Script Options
Argument Purpose

--script-locations=<folder>[,<folder>…​]

Specifies additional folders to search for scripts.

--ignore-user-script-locations

Exclude all script locations of the scopes

  • User@Machine and

  • User@Project.

--tasks=<taskName>[,<taskName>…​]

Specifies one or more script tasks to execute, separated by commas.

--task-args=<taskName:key=value>

Passes arguments to the specified script task.

validate

Validates the given project and reports any issues.

Syntax: DvCliAdaptive validate [ARGS…​]

Typical use: Run before generation to catch configuration errors.

Example:

DvCliAdaptive validate
    --models="/home/user/models/base,/home/user/models/extended"
    --report-dir="/home/user/reports"
    --report-type="xml"

DvCliAdaptive validate
    -p="project.adpa"
    --report-dir="/home/user/reports"
    --report-type="html,json"
    --full

Options:

Table 3. Generation and Validation Options
Argument Purpose

--generators=<generator>[,<generator>…​]

Defines the generators to use. If not specified, all available generators are included.

--excluded-generators=<generator>[,<generator>…​]

Defines which generators should be ignored.

--scopes=<scope>[,<scope>…​]

Specifies the model scopes that will be used. All available scopes are used if this option is omitted.

--include-autosar

Enables the display of non-generator AUTOSAR warnings.

--ignore-warnings=<validationId>[,<validationId>…​]

Specifies the IDs of validation results to be ignored.

--report-dir=<reportDir>

Specifies the path to the execution report.

--report-type=<reportType>[,<reportType>…​]…​

Specifies the report format. Valid options are:

  • XML

  • HTML

  • JSON

  • None

--cache-report=<jsonReportFileLocation>

Specifies the location and filename for the cache JSON report. Must be a JSON file and the parent folder needs to exist.

--gen-args-universal=<key=value>

Passes arguments to all code generators.

--gen-args=<generator:key=value>

Passes arguments to the specified code generators.

--full

Validates the entire model in the project specified by the -p option. It uses all available generators and scopes for the validation.

generate

Validates and then generates the given project.

Syntax: DvCliAdaptive generate [ARGS…​]

Generation stops if validation fails.

Example:

DvCliAdaptive generate
    -b="/home/user/bsw"
    -p="project.adpa"
    --referenced-projects="/home/user/ref1,/home/user/ref2"
    --excluded-generators="GenC"
    --ignore-warnings="VAL001,VAL002"
    --report-dir="/home/user/reports"
    --report-type="html,json"
    --cache-report="home/user/cache_report.json"
    --gen-args-universal="optimize=true"
    --gen-args="GenA:mode=fast"
    --gen-args="GenB:level=high"
    -o="/home/user/output"

DvCliAdaptive generate
    --models="/home/user/models/base,/home/user/models/extended"
    --generators="GenA,GenB"
    -o="/home/user/output"

Options:

  • Basic Options

  • Project Options

    Table 4. Generation and Validation Options
    Argument Purpose

    --generators=<generator>[,<generator>…​]

    Defines the generators to use. If not specified, all available generators are included.

    --excluded-generators=<generator>[,<generator>…​]

    Defines which generators should be ignored.

    --scopes=<scope>[,<scope>…​]

    Specifies the model scopes that will be used. All available scopes are used if this option is omitted.

    --include-autosar

    Enables the display of non-generator AUTOSAR warnings.

    --ignore-warnings=<validationId>[,<validationId>…​]

    Specifies the IDs of validation results to be ignored.

    --report-dir=<reportDir>

    Specifies the path to the execution report.

    --report-type=<reportType>[,<reportType>…​]…​

    Specifies the report format. Valid options are:

    • XML

    • HTML

    • JSON

    • None

    --cache-report=<jsonReportFileLocation>

    Specifies the location and filename for the cache JSON report. Must be a JSON file and the parent folder needs to exist.

    --gen-args-universal=<key=value>

    Passes arguments to all code generators.

    --gen-args=<generator:key=value>

    Passes arguments to the specified code generators.

    -o=<folder>

    Specifies the output folder for the generated data files.

    --output=<folder>

    Specifies the output folder for the generated data files.

Run

Executes the specified script task(s).

Syntax: DvCliAdaptive run [ARGS…​]

Example:

DvCliAdaptive run
    --script-locations="/home/user/scripts,/opt/scripts"
    --ignore-user-script-locations
    --log-file="/home/user/logs/full_run.log"
    --verbose
    --tasks="BuildTask,DeployTask"
    --task-args="BuildTask:optimize=true"
    --task-args="DeployTask:env=prod"
    --no-mex-migration
    --save
    --schema-validation

Options:

Table 5. Script Options
Argument Purpose

--script-locations=<folder>[,<folder>…​]

Specifies additional folders to search for scripts.

--ignore-user-script-locations

Exclude all script locations of the scopes

  • User@Machine and

  • User@Project.

--tasks=<taskName>[,<taskName>…​]

Specifies one or more script tasks to execute, separated by commas.

--task-args=<taskName:key=value>

Passes arguments to the specified script task.

Export

Exports the merged model of a project/model into a single arxml file.

Syntax: DvCliAdaptive export [ARGS…​]

Example:

DvCliAdaptive export
    --models="/home/user/models/base,/home/user/models/extended"
    --output="/home/user/exported_model"

DvCliAdaptive export
    -p="project.adpa"
    --output="/home/user/exported_model"

DvCliAdaptive export
    -p="project.adpa"
    --referenced-projects="/home/user/ref1,/home/user/ref2"
    --name="exported_model"
    --output="/home/user/exported_model"
    --no-mex-migration

Options:

Table 6. Script Options
Argument Purpose

-o=<folder>, --output=<folder>

Specifies the output folder for the exported model.

-n=<name>, --name=<name>

Specifies the filename of the exported model.

task-help

Shows help for a specific script task.

Syntax: DvCliAdaptive task-help [ARGS…​]

Example:

DvCliAdaptive task-help
    -p="project.adpa"
    --script-locations="/home/user/scripts,/opt/scripts"
    --tasks="BuildTask,DeployTask

Options:

Table 7. Script Options
Argument Purpose

--script-locations=<folder>[,<folder>…​]

Specifies additional folders to search for scripts.

--ignore-user-script-locations

Exclude all script locations of the scopes

  • User@Machine and

  • User@Project.

--tasks=<taskName>[,<taskName>…​]

Specifies one or more script tasks to execute, separated by commas.

--task-args=<taskName:key=value>

Passes arguments to the specified script task.

Exit Codes

Table 8. DvCliAdaptive Exit Codes
Exit Code Description

0

Successful program execution.

1

Command execution failed.

2

Usage error: User input for the command was incorrect.