Skip to Content
FrontendCrud V2Crud GeneratorGenerator v2Commands & CLI Flags

Commands & CLI Flags


Commands Reference

JSON Layer

CommandAliasDescription
generateJsongen:jsonFetch API metadata → create JSON v0
generateJsonAllFetch API metadata for all entities in bundle
generateJsonMigrationCreate / refresh changes.json template for an entity
generateJsonMigrationAllRefresh changes.json for all entities
checkJsonChangescheck:jsonPreview what current changes.json will do
checkJsonChangesAllcheck:json allPreview changes for all entities
matchScraperFieldsmatch:scraperMatch with legacy scraper data, create new version
matchScraperFieldsAllmatch:scraper allBatch scraper matching
listJsonVersionsList all JSON versions for an entity

TSX Layer

CommandAliasDescription
generateTsxgen:tsxGenerate TSX from JSON version
generateTsxAllgen:tsx allGenerate TSX for all entities
generateTsxMigrationCreate TSX changes.json template
applyTsxChangesapply:tsxCopy previous TSX → new version (for manual edits)
checkTsxChangescheck:tsxPreview TSX changes
listTsxVersionsList all TSX versions for an entity

Preview & Validation

CommandAliasDescription
previewChangespreview:changes, previewFull preview of what changes.json will produce
validateChangesvalidate:changesValidate field references exist in API data
validateEntityvalidateCheck JSON–TSX consistency
validateJsonvalidate:jsonValidate JSON layer only
validateTsxvalidate:tsxValidate TSX layer only
validateAllValidate every entity in bundle

Pipeline & Utilities

CommandAliasDescription
generateVersionedFull pipeline: JSON + TSX for all entities
exportEntityCopy generated TSX to destination folder
generateTableNamesgen:table-namesBuild config/tableNames.js from all versioned data
generateEntityNamesgen:entity-namesBuild config/entityNames.js from all versioned data
tokenoauth2token, oauth2Fetch OAuth2 token → save to config/token.txt

CLI Flags

Core

FlagDescription
--entityEntity path: BundleName/EntityName
--bundleCrudBundle: phprCrud ticketCrud configCrud accountCrud
--baseUrlAPI base URL (required for fetch commands)
--devUsername / --devPasswordCredentials for token generation

Versioning

FlagDescription
--fromVersionBase version for incremental generation (e.g. v0)
--jsonVersionJSON version to read when generating TSX (e.g. v1)
--tsxVersionSpecific TSX version to use
--versionGeneric version selector
--layerTarget layer: json or tsx (default json)

Caching

Cache flags are mutually exclusive — use only one per command.

FlagDescription
--generateFromApiAlways fetch fresh from API, ignore cache
--generateFromCacheUse cache when available, fallback to API
--generateCacheOnlyUpdate cache only — skip TSX generation

Other

FlagDescription
--dryRunPreview without writing any files
--destinationExport destination path
--debug / -dPrint debug information

Batch Operations

Generate Everything

# JSON only — all entities in bundle ./index.js generateJsonAll \ --bundleCrud=phprCrud \ --baseUrl=https://demo.phpreaction.com/open-api/v3 # JSON + TSX — full pipeline for all entities ./index.js generateVersioned \ --bundleCrud=phprCrud \ --baseUrl=https://demo.phpreaction.com/open-api/v3

Validate Everything

./index.js validateAll \ --bundleCrud=phprCrud \ --baseUrl=https://demo.phpreaction.com/open-api/v3

Preview All Changes

./index.js check:json all \ --bundleCrud=phprCrud \ --baseUrl=https://demo.phpreaction.com/open-api/v3

Shell Scripts (Per Project)

# All entities — legacy mode ./scripts/generate-phpr-entities.sh legacy # All entities — versioned ./scripts/generate-phpr-entities.sh versioned # Single entity ./scripts/generate-phpr-entities.sh versioned-entity AccountingBundle/Account

Troubleshooting

ProblemSolution
Entity not foundCheck format: BundleName/EntityName — no spaces, exact casing
Unauthorized (401)Re-run token command — token may have expired
API connection errorVerify --baseUrl is reachable from your machine
tag already exists in changes.jsonRun validate:changes — field was removed from API
MANY_TO_MANY field in formExpected — excluded automatically; check sideboxFields instead
TSX generation failsRun listJsonVersions to confirm JSON version exists
Export failsCheck destination path exists and is writable
Cache stale / wrong fieldsClear cache and re-run with --generateFromApi
Multiple cache flag errorUse only one of --generateFromApi, --generateFromCache, --generateCacheOnly
changes.json wiped on new versionIt is not — old customizations are merged automatically
Last updated on