DotGEN: Code/Data Generator
The DotGEN command-line tool is the core utility for bootstrapping new applications, generating boilerplate components, managing project dependencies, and handling internationalization (i18n) resources within the DotHRB ecosystem.
Usage Syntax
dotgen [options] <command>
1. ⚙️ Global Options
These options affect the overall operation of the dotgen tool.
| Option | Description |
|---|---|
--help | Display this help message and exit. |
-v | Enable verbose output for detailed operation logs. |
-data | Include the data directory when publishing builds (used for deployment). |
--license | Display license and copyright information. |
--version | Display the version information. |
2. 🧩 Primary Commands
These are the main actions used for project scaffolding and dependency management.
| Command | Description |
|---|---|
new <tpl> [-o <name>] | Create a New Application from the specified template (<tpl>). Optionally, use -o to define the output folder name. |
make:<type> <name> [tpl] | Generate a Component of the specified type (e.g., make:Controller, make:Page). |
restore | Run npm install (or equivalent) to restore project dependencies and rebuild necessary assets. |
Example: Creating a new WebApp
dotgen new webapp -o myapp
dotgen make:Controller MyController template model=MyModel
dotgen make:Page UserPage template model=User
3. 🗃️ seed Command: Database Population
The seed command is used to quickly populate a database table with data from a JSON file.
| Sub-Option | Description |
|---|---|
| (Command) | seed |
-d 'sqlite db' | Specify the target SQLite database file path. |
-t 'table' | Specify the target table name for seeding. |
-json 'file' | Specify the source JSON file path containing the data. |
-no-truncate | Prevents truncation of the table before seeding (new data is appended). |
-execute | REQUIRED flag to execute the seed operation. |
4. 🌐 lang Command: Localization & AI Translation
The lang command provides tools to manage language resource files and generate AI prompts for translation.
| Subcommand | Purpose |
|---|---|
reload | Force a reload of all language resource files. |
prompt-for-json=file.json | Generates an AI prompt to translate all values found in the specified JSON file. |
prompt-for-words=word1[,word2,...] | Generates an AI prompt to translate a list of specific words or phrases. |
prompt-model-json=model,lang | Generates an AI prompt for a model's translation, specifying the target language. |
prompt-model-auto=model | Generates an AI prompt, allowing the AI to guess the target language based on context. |
prompt-new-lang-project-json=json,lang | Generates an AI prompt to create a new project-level language file. |
prompt-new-lang-common-json=json,lang | Generates an AI prompt to create a new common-level language file. |
rename-key=old,new | Rename a translation key across all language files. |
delete-key=key | Delete a specific translation key across all language files. |
reorder-all-by-alphanum | Reorder all keys in all language files alphabetically. |
add-project-json=file.json | Add or merge keys from a JSON file into the project language resource. |
add-common-json=file.json | Add or merge keys from a JSON file into the common language resource. |
Example: Generating a Translation Prompt
dotgen lang prompt-for-json=file.json
5. 💻 ts Command: TypeScript Utilities
The ts command is used to generate TypeScript code based on existing models.
| Subcommand | Purpose |
|---|---|
interface-from-model=model.json | Generate a TypeScript interface (I<Model>.ts) based on the structure defined in the specified model JSON file. |
Example: Generating a TypeScript Interface
dotgen ts interface-from-model=Models/Model.json