Skip to main content
Version: Next

Common CLI

For the full parameter list, see CLI Reference. This page covers only what you need for everyday generation.

Basic form

dotnet Luban.dll --conf luban.conf -t client -c cs-simple-json -d json ^
-x outputCodeDir=../Projects/Xxx/Assets/Gen ^
-x outputDataDir=../Projects/Xxx/Assets/Data
ParameterRequiredDescription
--confYesPath to luban.conf
-t/--targetYesExport target name
-c/--codeTargetNoMultiple allowed: -c cs-bin -c java-json
-d/--dataTargetNoMultiple allowed
-x key=valueNoExtension options such as output directories

When a single command uses multiple -c/-d, -t must be the same.

Output directories

-x outputCodeDir=...
-x outputDataDir=...

With multiple targets, use cascading options to avoid overwriting each other:

-x cs-bin.outputCodeDir=...
-x json.outputDataDir=...
danger

By default, old generated files in the output directories are cleaned. Do not point these directories at folders that contain hand-written code.

Other common switches

ParameterPurpose
-e/--excludeTagExclude records with a given tag
-i/--includeTagOutput only the specified tag (mutually exclusive with exclude)
-o/--outputTableExport only the specified tables
--validationFailAsErrorTreat validation failures as generation failures (recommended for release)
-f/--forceLoadTableDatasLoad data even without a dataTarget, so you can validate only
-x outputSaver=nullValidate only, write no files (often with -f)

Full generation examples

Unity + cs-bin + bin (with path validation, l10n):

dotnet Luban.dll ^
-t client ^
-c cs-bin ^
-d bin ^
--conf luban.conf ^
-x outputCodeDir=../Assets/Gen ^
-x outputDataDir=../Assets/Data ^
-x pathValidator.rootDir=../Assets ^
-x l10n.provider=default

Unity + cs-simple-json + json:

dotnet Luban.dll -t client -c cs-simple-json -d json ^
--conf luban.conf ^
-x outputCodeDir=../Assets/Gen ^
-x outputDataDir=../Assets/Data

Designers validate only (no code/data output):

dotnet Luban.dll -t all -f --conf luban.conf --validationFailAsError

Generate C# and Java together (cascading output to avoid overwrite):

dotnet Luban.dll -t server ^
-c cs-bin -c java-bin -d bin ^
--conf luban.conf ^
-x cs-bin.outputCodeDir=../csharp/Gen ^
-x java-bin.outputCodeDir=../java/Gen ^
-x bin.outputDataDir=../Data