und is the command-line interface to Understand — script project creation, analysis, CodeCheck, metrics, and reports, locally or in CI.
Run Understand from the command line · Headless workflow: create, analyze, check, report
und create
creates an empty database
und create [-db <database.und>] [-local] [-languages <c++ c#> ...] [settings...]
The create command generates a new database. It accepts the same settings as the settings command (und help settings).
Basic Usage
Specify the new database name with the -db option or as the last parameter.
und create -db newDatabase.und -languages <c++ c#> (optional) ...
Saving Analysis Data Locally
Use -local to save analysis data in the project's 'local' folder. This allows sharing data between machines, but requires identical source code, library, system, and compiler file paths. If -local is not used, data is stored in the user's AppData folder.
und create -db <newDatabase.und> -local -languages <c++ c#> ...
Creating a Database for a Specific Git Commit
Use -gitcommit to associate the database with a specific commit. This only affects how file contents are found, not which files are added (use und add for that).
und create -db <newDatabase.und> -gitcommit <githash> -languages ...
| Option | Description |
|---|---|
-gitcommit githash | Associate the database with the given git commit; file contents are read from that commit. |
Additional Options for Git Commit Databases:
| Option | Description |
|---|---|
-refdb dbname.und | Copy settings from an existing database (dbname.und) instead of creating an empty database. This also sets the new database as a comparison project in the referenced database. |
-gitrepo path | Use the provided directory as the git repository. If this is not provided and a reference database is provided, the reference database's repository is used. If a reference database is not available, this defaults to the directory of the new database. |
Important Notes
- Creating a database at a specific git commit does not automatically add files. Use the und add command to add files.
- If sharing the project between machines, ensure identical file paths (using -local) for source code, libraries, system files, and compilers.