Material Management CLI
Flowgram provides a dedicated CLI command-line tool to help you manage official materials in your project.
Installation
You can run it directly with npx:
Sync Materials to Project
Use the materials command to add the source code of official materials to your project for customization:
After running, the CLI will prompt you to select materials to add to your project:
Advanced Options
The materials command supports the following options:
Find Used Materials
Use the find-used-materials command to analyze project code and find all used official materials:
Output example:
This command will:
- Scan all TypeScript files in the project
- Analyze import statements from
@flowgram.ai/form-materials - Identify specific materials being used
- Output detailed usage location information
Case Run Down
Sync all used official materials in the project to the src/custom-materials directory
- Use the
find-used-materialscommand to see the official materials used in the project.
After the command runs, it will output a list of official materials used in the project.
- Use the
materialscommand to add the source code of these materials to the project's src/custom-materials directory.
- The
--refresh-project-importsoption will refresh the import paths for copied materials in the project, ensuring the latest customized versions are used. - The
--target-material-root-dir src/custom-materialsoption specifies the target directory for material copying as src/custom-materials.
FAQ
Q: Can't find the newly added dependencies after CLI adds them?
A: Please check if you have run npm install to install the newly added dependencies.