CLI
The jiangyu CLI mirrors most of Studio's authoring operations. Its job is to make Jiangyu scriptable: build pipelines, CI checks, batch exports, ad-hoc inspection. For interactive authoring, Studio is the better surface.
All commands run from your project directory. Run jiangyu <command> --help for the authoritative flag listing. This page covers what each command is for.
Project commands
jiangyu init
Scaffolds a new mod project in the current directory. Writes jiangyu.json (with name derived from the directory) and a .gitignore excluding .jiangyu/ and compiled/.
Equivalent to Studio's "New project" dialog. See Manifest for the scaffolded shape.
jiangyu compile
Compiles the project's replacements and templates into a shippable mod under compiled/. Reads jiangyu.json, walks assets/replacements/ and templates/, emits AssetBundles and the compiled manifest. If unity/Assets/Prefabs/ has any .prefab files, invokes Unity batchmode against the unity/ project to build prefab addition bundles.
Equivalent to Studio's Compile dossier. Returns non-zero on any compile error.
jiangyu unity sync
Scaffolds the per-mod Unity Editor project at unity/ for prefab addition authoring. Idempotent: re-running refreshes Jiangyu-managed files under unity/Assets/Jiangyu/ and .gitignore, and modder content elsewhere is preserved.
Only needed for mods that ship prefab additions. Data-only and replacement-only mods never need to run this.
jiangyu unity open
Launches Unity Editor on the mod's unity/ project, detaching so the CLI returns immediately. Uses the editor path resolved from your global config's unityEditor field.
jiangyu unity import-prefab <name>
Extracts a vanilla game prefab plus its transitive dependency closure (meshes, materials, textures, shaders) into unity/Assets/Imported/<name>/ as Unity-native assets so you can author against a real game baseline. Auto-bootstraps unity/ if missing. Targeted extraction: only the dependency closure of the named asset is written, not the whole game.
jiangyu unity import-prefab rmc_default_female_soldier_2Pass --path-id and/or --collection when the name is ambiguous (use jiangyu assets search to disambiguate).
Assets
The asset pipeline is index-first: build the catalogue once, then search and export against it.
jiangyu assets index
Builds the searchable asset index and an attribute-hint supplement (covering [NamedArray], [Range], [Min], [Tooltip], [HideInInspector], [SoundID]) used by the compiler and template inspector. Run this once after a game update or first-time setup, and subsequent commands read the cached output.
The index lives in your global cache (XDG / LocalAppData). Configure the cache root with the cache field in the global config (see Configuration).
jiangyu assets search <query>
Searches the asset index by name. Filters by class with --type:
jiangyu assets search window_background --type Texture2D
jiangyu assets search local_forces --type PrefabHierarchyObject
jiangyu assets search mortar --type AudioClipThe output includes each match's pathId, collection, and the suggested replacement path under assets/replacements/. --type takes raw Unity class names (Texture2D, Sprite, AudioClip, PrefabHierarchyObject, GameObject, Mesh). These are the same values as the asset index's className field.
jiangyu assets export <kind> <name>
Exports a vanilla asset as a starting point for your replacement. Four kinds:
| Kind | Output |
|---|---|
jiangyu assets export model <name> | Self-contained model package directory (cleaned glTF + auxiliary textures). |
jiangyu assets export texture <name> | PNG file. |
jiangyu assets export sprite <name> | PNG file. |
jiangyu assets export audio <name> | Audio file in whatever format Unity embedded (typically .ogg). |
Common options:
--path-id <id>picks a specific asset when the name matches more than one. Required for ambiguous names. The error tells you when.--collection <name>filters by source collection alongside--path-id.--output <path>overrides the default output location (defaults under<cache>/exports/).assets export modelalso accepts--rawto keep the native AssetRipper representation. Don't author against--raw. It's for inspection only.
jiangyu assets inspect <subcommand>
Power-user inspection tools. Useful when you're debugging a replacement that compiles but doesn't behave as expected.
| Subcommand | Purpose |
|---|---|
assets inspect glb | Dump a glTF/GLB's node hierarchy and skin info. |
assets inspect mesh | Inspect a serialised mesh's contract fields in a bundle. |
assets inspect prefab | Compare a game prefab to a bundle prefab side by side. |
assets inspect package <dir> | Validate an exported model package. |
assets inspect object | Dump a game object's observed field tree. |
Each takes its own flag set, so run with --help for specifics.
Templates
jiangyu templates index
Builds the template index by walking Assembly-CSharp.dll and the live DataTemplate instances in resources.assets. Like the asset index, this is a one-time-per-game-update operation, and later template commands read the cached output.
jiangyu templates list
Lists template types and instances:
jiangyu templates list # all template subtypes
jiangyu templates list --type UnitLeaderTemplate # all instances of one subtypejiangyu templates search <query>
Substring search across template type names, ids, and collections. The fastest way to find an id when you only remember part of the name.
jiangyu templates inspect
Reads the current value shape of one template:
jiangyu templates inspect --type UnitLeaderTemplate \
--name squad_leader.darby --output text--output text is the scan-friendly view, and the default JSON output is for scripting. Pass --with-mod <project-path> to preview the effective state after your project's clones and patches apply, before launching MENACE.
jiangyu templates query
A jq-like navigator over the template type tree, parsed offline from Assembly-CSharp.dll. Useful for finding the right fieldPath for a patch:
jiangyu templates query EntityTemplate.Properties.Accuracy
jiangyu templates query 'UnitLeaderTemplate.InitialAttributes[0]'
jiangyu templates query EntityTemplate.Skills # auto-unwraps to SkillTemplateFor leaf fields it emits a copy-pasteable KDL snippet you can drop into a templates/*.kdl file.
Configuration
The CLI reads global configuration from a JSON file in your platform's standard config location (XDG / AppData adaptive). Three fields:
| Field | Purpose |
|---|---|
game | Path to your MENACE install root (the directory containing MENACE.exe). |
unityEditor | Path to a Unity Editor binary, used by compile to build AssetBundles. |
cache | Cache root for the asset index, exports, and the attribute-hint supplement. |
Studio's Settings dialog and the CLI write to the same file. The CLI doesn't have a config-edit subcommand, so edit the file directly or use Studio.
Exit codes
0: success.1: any handled error (missing config, parse failure, compile failure, ambiguous asset name, etc.). Error messages go to stderr.
The CLI doesn't distinguish error categories beyond 0 vs 1 today, so check stderr for the specific cause.