Repository navigation
CLI Usage & Arguments
0808 edited this page Sep 16, 2026
·
3 revisions
Due to the technical limitation of the Tap library, the compiled binary file cannot display parameter variable annotations.
When running the source code, the parameter variable annotations will be displayed in the help information.
usage: bamt-cli [--lang LANG] [-h]
{update,batch-update,pack,extract,crc,parse,report,batch-preview,backup,env}
...
BA Modding Toolkit - Command Line Interface.
positional arguments:
{update,batch-update,pack,extract,crc,parse,report,batch-preview,backup,env}
Available commands
update Update or port a Mod, migrating assets from an old Mod to a specific Bundle.
batch-update Batch update multiple Mod files from an input directory.
pack Pack contents from an asset folder into a target bundle file.
extract Extract assets from Unity Bundle files.
crc Tool to fix file CRC32 checksum or calculate/compare CRC32 values.
parse Parse BA bundle filename(s) and print the parsed components.
report Generate a report of all modded bundle files.
batch-preview Batch render Spine preview images for all Spine resources.
backup Backup all modded bundle files.
env Display system information and library versions.
options:
--lang LANG (str | None, default=None) Interface language for localized output (e.g., "en-US", "zh-CN", "debug"; default: auto-detect).
-h, --help show this help message and exit
usage: bamt-cli update [--output-dir OUTPUT_DIR] [--target [TARGET ...]]
[--resource-dir RESOURCE_DIR]
[--region {auto,global,japan}] [--no-crc]
[--extra-bytes EXTRA_BYTES]
[--asset-types [{Texture2D,TextAsset,Mesh,ALL} ...]]
[--compression {lzma,lz4,original,none}] [--save-all]
[--skel-converter-path SKEL_CONVERTER_PATH]
[--target-spine-version TARGET_SPINE_VERSION]
[--strategy {path_id,name_type,cont_name_type}] [-h]
[old ...]
Update or port a Mod, migrating assets from old Mod(s) to new Bundle(s).
Examples:
# Automatically search for new file and update single Mod
bamt-cli update "C:\path\to\old_mod.bundle"
# Update multiple Mods at once
bamt-cli update "mod1.bundle" "mod2.bundle" "mod3.bundle"
# Manually specify target file(s)
bamt-cli update "old.bundle" --target "new.bundle"
bamt-cli update "old1.bundle" "old2.bundle" --target "new1.bundle" "new2.bundle"
# Disable CRC fixing
bamt-cli update "old_mod.bundle" --no-crc
# Enable Spine skeleton conversion
bamt-cli update "old.bundle" --skel-converter-path "C:\path\to\SpineSkeletonDataConverter.exe" --target-spine-version "4.2.0808"
positional arguments:
old (list[pathlib.Path], required) Path(s) to the old Mod bundle file(s).
options:
--output-dir OUTPUT_DIR
(Path, default=output) Directory to save the generated Mod file (Default: ./output/).
--target [TARGET ...]
(list[pathlib.Path] | None, default=None) Path(s) to the new game resource bundle file(s) (Overrides --resource-dir if provided).
--resource-dir RESOURCE_DIR
(pathlib.Path | None, default=None) Path to the game resource directory. Will try to find the directory automatically if not provided.
--region {auto,global,japan}
(Literal['auto', 'global', 'japan'], default=auto) Game region used to auto-detect the install path (auto = global first, then japan).
--no-crc (bool, default=False) Disable CRC fix function.
--extra-bytes EXTRA_BYTES
(str | None, default=None) Extra bytes in hex format (e.g., "0x08080808" or "QWERTYUI") to append before CRC correction.
--asset-types [{Texture2D,TextAsset,Mesh,ALL} ...]
(list[Literal['Texture2D', 'TextAsset', 'Mesh', 'ALL']], default=['Texture2D', 'TextAsset', 'Mesh']) List of asset types to replace.
--compression {lzma,lz4,original,none}
(Literal['lzma', 'lz4', 'original', 'none'], default=lzma) Compression method for Bundle files.
--save-all (bool, default=False) Save all files including unchanged ones (default: skip unchanged files).
--skel-converter-path SKEL_CONVERTER_PATH
(pathlib.Path | None, default=None) Full path to SpineSkeletonDataConverter.exe. Spine conversion is enabled when provided.
--target-spine-version TARGET_SPINE_VERSION
(str, default=4.2.33) Target Spine version (e.g., "4.2.33").
--strategy {path_id,name_type,cont_name_type}
(Literal['path_id', 'name_type', 'cont_name_type'], default=path_id) Match strategy for cross-version migration.
-h, --help show this help message and exit
usage: bamt-cli batch-update [--output-dir OUTPUT_DIR]
[--resource-dir RESOURCE_DIR]
[--region {auto,global,japan}] [--no-crc]
[--extra-bytes EXTRA_BYTES]
[--asset-types [{Texture2D,TextAsset,Mesh,ALL} ...]]
[--compression {lzma,lz4,original,none}]
[--skel-converter-path SKEL_CONVERTER_PATH]
[--target-spine-version TARGET_SPINE_VERSION]
[--strategy {path_id,name_type,cont_name_type}]
[--max-workers MAX_WORKERS] [-h]
input_dir
Batch update multiple Mod files, migrating assets from old Mods to new game bundles.
This command scans the input directory for .bundle files, automatically finds corresponding
new game bundles in the resource directory, and updates them all in batch.
Examples:
# Batch update all bundles in a directory
bamt-cli batch-update "C:\path\to\old_mods\"
# Specify resource directory for auto-search
bamt-cli batch-update "C:\path\to\old_mods\" --resource-dir "C:\game\resources"
# Disable CRC fixing
bamt-cli batch-update "C:\path\to\old_mods\" --no-crc
# Enable Spine conversion
bamt-cli batch-update "C:\path\to\old_mods\" --skel-converter-path "C:\tools\SpineSkeletonDataConverter.exe" --target-spine-version "4.2.0808"
positional arguments:
input_dir (Path, required) Directory containing old Mod bundle files to update.
options:
--output-dir OUTPUT_DIR
(Path, default=output) Directory to save the generated Mod files.
--resource-dir RESOURCE_DIR
(pathlib.Path | None, default=None) Path to the game resource directory for searching new bundles.
--region {auto,global,japan}
(Literal['auto', 'global', 'japan'], default=auto) Game region used to auto-detect the install path (auto = global first, then japan).
--no-crc (bool, default=False) Disable CRC fix function.
--extra-bytes EXTRA_BYTES
(str | None, default=None) Extra bytes in hex format (e.g., "0x08080808" or "QWERTYUI").
--asset-types [{Texture2D,TextAsset,Mesh,ALL} ...]
(list[Literal['Texture2D', 'TextAsset', 'Mesh', 'ALL']], default=['Texture2D', 'TextAsset', 'Mesh']) List of asset types to replace.
--compression {lzma,lz4,original,none}
(Literal['lzma', 'lz4', 'original', 'none'], default=lzma) Compression method.
--skel-converter-path SKEL_CONVERTER_PATH
(pathlib.Path | None, default=None) Full path to SpineSkeletonDataConverter.exe. Spine conversion is enabled when provided.
--target-spine-version TARGET_SPINE_VERSION
(str, default=4.2.33) Target Spine version.
--strategy {path_id,name_type,cont_name_type}
(Literal['path_id', 'name_type', 'cont_name_type'], default=path_id) Match strategy.
--max-workers MAX_WORKERS
(int, default=1) Number of parallel worker threads (1 = sequential).
-h, --help show this help message and exit
usage: bamt-cli pack --bundle [BUNDLE ...] --folder FOLDER
[--output-dir OUTPUT_DIR] [--no-crc]
[--extra-bytes EXTRA_BYTES]
[--compression {lzma,lz4,original,none}] [--save-all]
[--skel-converter-path SKEL_CONVERTER_PATH]
[--target-spine-version TARGET_SPINE_VERSION] [-h]
Pack contents from an asset folder into target bundle files.
Examples:
# Pack single folder into single bundle
bamt-cli pack --bundle "target.bundle" --folder "assets_folder" --output-dir "output"
# Pack single folder into multiple bundles
bamt-cli pack --bundle "b1.bundle" "b2.bundle" --folder "assets_folder"
# Pack with Spine conversion
bamt-cli pack --bundle "target.bundle" --folder "spine_assets" --skel-converter-path "C:\path\to\SpineSkeletonDataConverter.exe" --target-spine-version "4.2.0808"
options:
--bundle [BUNDLE ...]
(list[pathlib.Path], required) Path(s) to the target bundle file(s) to modify.
--folder FOLDER (Path, required) Path to the folder containing asset files.
--output-dir OUTPUT_DIR
(Path, default=output) Directory to save the modified bundle file(s).
--no-crc (bool, default=False) Disable CRC fix function.
--extra-bytes EXTRA_BYTES
(str | None, default=None) Extra bytes in hex format (e.g., "0x08080808" or "QWERTYUI") to append before CRC correction.
--compression {lzma,lz4,original,none}
(Literal['lzma', 'lz4', 'original', 'none'], default=lzma) Compression method for Bundle files.
--save-all (bool, default=False) Save all bundles including unchanged ones (default: skip unchanged bundles).
--skel-converter-path SKEL_CONVERTER_PATH
(pathlib.Path | None, default=None) Full path to SpineSkeletonDataConverter.exe. Spine conversion is enabled when provided.
--target-spine-version TARGET_SPINE_VERSION
(str, default=4.2.33) Target Spine version.
-h, --help show this help message and exit
usage: bamt-cli extract [--output-dir OUTPUT_DIR] [--subdir SUBDIR]
[--asset-types [{Texture2D,TextAsset,Mesh,ALL} ...]]
[--skel-converter-path SKEL_CONVERTER_PATH]
[--target-spine-version TARGET_SPINE_VERSION]
[--unpack-atlas] [-h]
[bundles ...]
Extract assets from Unity Bundle files.
Examples:
# Extract all supported assets from a single bundle
bamt-cli extract "C:\path\to\bundle.bundle"
# Extract with Spine downgrade
bamt-cli extract "bundle.bundle" --skel-converter-path "C:\path\to\SpineSkeletonDataConverter.exe" --target-spine-version 3.8.75
# Extract multiple bundles
bamt-cli extract "bundle1.bundle" "bundle2.bundle" --output-dir "C:\output"
# Extract files at "output/CH0808/"
bamt-cli extract "CH0808_assets.bundle" --subdir "CH0808"
# Extract with unpack mode for atlas files
bamt-cli extract "bundle.bundle" --unpack-atlas
positional arguments:
bundles (list[pathlib.Path], required) Path(s) to the bundle file(s) to extract assets from.
options:
--output-dir OUTPUT_DIR
(Path, default=output) Base directory to save the extracted assets.
--subdir SUBDIR (str | None, default=None) Subdirectory name within output_dir. Auto-generated from bundle name if not specified.
--asset-types [{Texture2D,TextAsset,Mesh,ALL} ...]
(list[Literal['Texture2D', 'TextAsset', 'Mesh', 'ALL']], default=['Texture2D', 'TextAsset', 'Mesh']) List of asset types to extract.
--skel-converter-path SKEL_CONVERTER_PATH
(pathlib.Path | None, default=None) Full path to SpineSkeletonDataConverter.exe. Spine downgrade is enabled when provided.
--target-spine-version TARGET_SPINE_VERSION
(str, default=3.8.75) Target Spine version for downgrade (e.g., "3.8.75").
--unpack-atlas (bool, default=False) Unpack Atlas into individual PNG frames while keeping the original files.
-h, --help show this help message and exit
usage: bamt-cli crc [--target-crc TARGET_CRC] [--check] [--no-backup]
[--extra-bytes EXTRA_BYTES] [--resource-dir RESOURCE_DIR]
[--region {auto,global,japan}] [-h]
[files ...]
Tool to fix file CRC32 checksum or calculate/compare CRC32 values.
Fix mode OVERWRITES the input file and will NOT output at "output/" directory.
Examples:
# Fix CRC of my_mod.bundle (target CRC extracted from the filename)
bamt-cli crc "my_mod.bundle"
# Fix CRC with an explicit target value
bamt-cli crc "my_mod.bundle" --target-crc "0xABCD1234"
# Calculate CRC of a file (also compares with the CRC in the filename if present)
bamt-cli crc "my_mod.bundle" --check
# Compare CRC of two files
bamt-cli crc "my_mod.bundle" "original.bundle" --check
# Calculate CRC and additionally compare with the same-name file in the game directory
bamt-cli crc "my_mod.bundle" --check --resource-dir "C:\path\to\game_data"
positional arguments:
files (list[pathlib.Path], required) Check mode: 1 file to calculate (compare with filename CRC if present), or 2 files to compare. Fix mode: exactly 1 file.
options:
--target-crc TARGET_CRC
(str | None, default=None) Target CRC32 in hex (e.g., "0xABCD1234"). If omitted, extracted from the filename.
--check (bool, default=False) Only calculate and compare CRC, do not modify any files.
--no-backup (bool, default=False) Do not create a backup (.backup) before fixing the file.
--extra-bytes EXTRA_BYTES
(str | None, default=None) Extra bytes in hex format (e.g., "0x08080808" or "QWERTYUI") to append before CRC correction.
--resource-dir RESOURCE_DIR
(pathlib.Path | None, default=None) Path to the game resource directory. Search for a same-name file to compare against.
--region {auto,global,japan}
(Literal['auto', 'global', 'japan'], default=auto) Game region used to auto-detect the install path (auto = global first, then japan). Search only runs when --resource-dir/--region is explicitly provided.
-h, --help show this help message and exit
usage: bamt-cli parse [--bacii-path BACII_PATH] [--index-column INDEX_COLUMN]
[--name-field NAME_FIELD] [-h]
[filenames ...]
Parse BA bundle filename(s) and print the parsed components.
Examples:
# Parse a single filename (full path is also accepted)
bamt-cli parse "assets-_mx-spinecharacters-ch0808_spr-mxdependency-textures-2077-08-08_12345678.bundle"
# Parse multiple filenames
bamt-cli parse "a.bundle" "b.bundle"
# Resolve character name from the BACII mapping
bamt-cli parse "ch0001_spr.bundle" --bacii-path "C:\path\to\BA-Characters-Internal-ID.csv"
positional arguments:
filenames (list[pathlib.Path], required) Filename(s) or path(s) to parse (only the name part is used).
options:
--bacii-path BACII_PATH
(pathlib.Path | None, default=None) Path to BA-Characters-Internal-ID.csv. Character name lookup is enabled when provided.
--index-column INDEX_COLUMN
(str, default=file_id) CSV column used as the lookup key for character mapping.
--name-field NAME_FIELD
(str, default=full_name) Character name field to display.
-h, --help show this help message and exit
usage: bamt-cli report [--output-dir OUTPUT_DIR] [--resource-dir RESOURCE_DIR]
[--region {auto,global,japan}]
[--spine-viewer-path SPINE_VIEWER_PATH]
[--bacii-path BACII_PATH] [--index-column INDEX_COLUMN]
[--name-field NAME_FIELD] [--format {list,table}]
[--max-workers MAX_WORKERS] [-h]
Generate a report of all modded bundle files in the game directory.
Note: The feature recognizes a "modded" bundle as one that has a trailing byte greater than 0.
For a game version that CRC check is unnecessary, modded bundles may not be recognized.
Examples:
# Generate report with auto-detected game directory
bamt-cli report
# Generate table format report
bamt-cli report --format table
# Generate report with Spine preview images
bamt-cli report --spine-viewer-path "C:\path\to\SpineViewerCLI.exe"
# Use character name mapping
bamt-cli report --bacii-path "C:\path\to\BA-Characters-Internal-ID.csv" --name-field "name_jp"
# Use a different CSV column as the lookup key
bamt-cli report --bacii-path "C:\path\to\BA-Characters-Internal-ID.csv" --index-column "student_id" --name-field "name_en"
options:
--output-dir OUTPUT_DIR
(Path, default=output\reports) Directory to save the report file.
--resource-dir RESOURCE_DIR
(pathlib.Path | None, default=None) Path to the game resource directory.
--region {auto,global,japan}
(Literal['auto', 'global', 'japan'], default=auto) Game region used to auto-detect the install path (auto = global first, then japan).
--spine-viewer-path SPINE_VIEWER_PATH
(pathlib.Path | None, default=None) Path to SpineViewerCLI.exe. Spine preview rendering is enabled when provided.
--bacii-path BACII_PATH
(pathlib.Path | None, default=None) Path to BA-Characters-Internal-ID.csv.
--index-column INDEX_COLUMN
(str, default=file_id) CSV column used as the lookup key for character mapping.
--name-field NAME_FIELD
(str, default=full_name) Character name field to display.
--format {list,table}
(Literal['list', 'table'], default=list) Report output format.
--max-workers MAX_WORKERS
(int, default=1) Number of parallel worker threads for Spine preview rendering (1 = sequential).
-h, --help show this help message and exit
usage: bamt-cli batch-preview [--output-dir OUTPUT_DIR]
[--resource-dir RESOURCE_DIR]
[--region {auto,global,japan}]
[--preset {low,high}]
[--categories [{spinecharacters,spinelobbies,spinebackground} ...]]
[--max-workers MAX_WORKERS] [-h]
spine_viewer_path
Batch render Spine preview images for all Spine resources in the game directory.
Note: This command renders ALL Spine resources (not limited to modded files),
grouped by file prefix. Existing preview images with the same name are overwritten.
Examples:
# Render previews with auto-detected game directory
bamt-cli batch-preview "C:\path\to\SpineViewerCLI.exe"
# Specify game resource directory and high quality preset
bamt-cli batch-preview "C:\path\to\SpineViewerCLI.exe" --resource-dir "C:\game\resources" --preset high
# Render only characters and lobbies
bamt-cli batch-preview "C:\path\to\SpineViewerCLI.exe" --categories spinecharacters spinelobbies
# Render with 4 parallel workers
bamt-cli batch-preview "C:\path\to\SpineViewerCLI.exe" --max-workers 4
positional arguments:
spine_viewer_path (Path, required) Path to SpineViewerCLI.exe.
options:
--output-dir OUTPUT_DIR
(Path, default=output\batch_preview) Directory to save preview images.
--resource-dir RESOURCE_DIR
(pathlib.Path | None, default=None) Path to the game resource directory. Will try to find the directory automatically if not provided.
--region {auto,global,japan}
(Literal['auto', 'global', 'japan'], default=auto) Game region used to auto-detect the install path (auto = global first, then japan).
--preset {low,high} (Literal['low', 'high'], default=low) Preview render preset.
--categories [{spinecharacters,spinelobbies,spinebackground} ...]
(list[Literal['spinecharacters', 'spinelobbies', 'spinebackground']], default=['spinecharacters', 'spinelobbies', 'spinebackground']) Categories to render (default: render all).
--max-workers MAX_WORKERS
(int, default=1) Number of parallel worker threads (1 = sequential).
-h, --help show this help message and exit
usage: bamt-cli backup [--output-dir OUTPUT_DIR] [--resource-dir RESOURCE_DIR]
[--region {auto,global,japan}] [--yes] [-h]
Backup all modded bundle files from the game directory.
Note: The feature recognizes a "modded" bundle as one that has a trailing byte greater than 0.
For a game version that CRC check is unnecessary, modded bundles may not be recognized.
Examples:
# Backup with auto-detected game directory
bamt-cli backup
# Backup with custom paths
bamt-cli backup --resource-dir "C:\path\to\game" --output-dir "C:\backups"
# Auto-confirm clearing existing backup directory
bamt-cli backup --yes
options:
--output-dir OUTPUT_DIR
(Path, default=output\backup) Directory to save the backup files.
--resource-dir RESOURCE_DIR
(pathlib.Path | None, default=None) Path to the game resource directory.
--region {auto,global,japan}
(Literal['auto', 'global', 'japan'], default=auto) Game region used to auto-detect the install path (auto = global first, then japan).
--yes (bool, default=False) Automatically confirm clearing the existing backup directory.
-h, --help show this help message and exit
usage: bamt-cli env [-h]
Display system information and library versions of the current environment.
options:
-h, --help show this help message and exit