Accessing CFSAI with the command line
To access cfsai, open a new terminal (View > Terminal or `Ctrl+``). Then complete the following steps:
- In the terminal panel, click the dropdown arrow next to the + icon.
- Select CFS Terminal from the list.
- Run your command, for example:
cfsutil cfsai --help
Note
To run cfsai from a system terminal outside VS Code:
- Windows: <CFS-Install>/Tools/cfsai/bin/cfsai.exe
- Linux/macOS: <CFS-Install>/Tools/cfsai/bin/cfsai
Help
You can pass --help at any level to view available options:
cfsai --helpprovides top-level help.cfsai build --helpshows all options for thebuildcommand.cfsai compat --helpshows all options for thecompatcommand.
cfsai --help
Top level options
The following options are available for all cfsai commands.
| Flag / Option | Description |
|---|---|
--version |
Show the current CFSAI version. |
--verbose |
Enable detailed logging of internal steps (for example, datamodel loading, parsing). |
--json |
Format log messages as JSON. Affects console output only, not generated files. |
--verbose and --json must be placed before the subcommand.
Example
cfsai --verbose build --model model.tflite --target MAX32690.CM4
cfsai --version
Data model options
CFSAI relies on a .cfsdatamodels index file to look up supported SoCs, cores and accelerators. A default data model is bundled with the installation, but users can override it by generating their own data model index file. See the CodeFusion Studio GitHub repository for instructions on generating a data model index file.
Use either --datamodel-search-path to point to a directory containing the .cfsdatamodels file, or --datamodel-file to specify the JSON file directly.
| Flag | Description |
|---|---|
--datamodel-search-path, -s |
Path to a folder that contains a .cfsdatamodels file. |
--datamodel-file, -d |
Path to a specific data model JSON file. Expects a valid schema-compliant JSON file. |
Use a directory as the search path
cfsai --datamodel-search-path /path/to/codefusion-studio-repo/packages/cfs-data-models/socs list-targets
Specify the index file directly
cfsai --datamodel-file /path/to/codefusion-studio-repo/packages/cfs-data-models/socs/max32690-tqfn.json build --model m4/hello_world_f32.tflite --target "MAX32690[TQFN].CM4"

