cmd

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

README

English | 简体中文

English

MeidoSerialization CLI

MeidoSerialization CLI is a command-line interface for the MeidoSerialization library, allowing you to convert between COM3D2 MOD files and JSON formats directly from the command line.

You can also use COM3D2 MOD EDITOR V2 to open the converted json file or unconverted files.

Download

Download in Release

Usage

The CLI provides four main commands:

convert2json

Convert MOD files to JSON format.

MeidoSerialization.exe convert2json [file/directory]

Examples:

MeidoSerialization.exe convert2json example.menu
MeidoSerialization.exe convert2json ./mods_directory
MeidoSerialization.exe convert2json --type menu ./mods_directory  # Only convert .menu files
convert2mod

Convert JSON files back to MOD format.

MeidoSerialization.exe convert2mod [file/directory]

Examples:

MeidoSerialization.exe convert2mod example.menu.json
MeidoSerialization.exe convert2mod ./json_directory
MeidoSerialization.exe convert2mod --type mate ./json_directory  # Only convert .mate.json files
convert

Auto-detect and convert files between MOD and JSON formats.

MeidoSerialization.exe convert [file/directory]

Examples:

MeidoSerialization.exe convert example.menu
MeidoSerialization.exe convert example.menu.json
MeidoSerialization.exe convert ./mixed_directory
MeidoSerialization.exe convert --type tex ./mixed_directory  # Only convert .tex and .tex.json files
determine

Determine the types of files in a directory or a single file.

MeidoSerialization.exe determine [file/directory]

Examples:

MeidoSerialization.exe determine example.menu
MeidoSerialization.exe determine --strict ./mods_directory
Global Flags
  • --strict or -s: Use strict mode for file type determination (based on content rather than file extension)
  • --type or -t: Filter by file type (menu, mate, pmat, col, phy, psk, tex, anm, model)

Supported File Types

see main README

FAQ

  • Does it support converting .tex to images?
    • Currently not supported, but COM3D2 MOD EDITOR V2 can do this
    • But you need to do a little programming, because it can't handle folders

Build

  1. Make sure you have Go installed (version 1.24 or higher)
  2. Clone the repository:
    git clone https://github.com/MeidoPromotionAssociation/MeidoSerialization.git
    
  3. Build the CLI:
    cd MeidoSerialization
    go build -o MeidoSerialization.exe
    

简体中文

MeidoSerialization CLI

MeidoSerialization CLI 是 MeidoSerialization 库的命令行界面,允许您直接从命令行在 COM3D2 MOD 文件和 JSON 格式之间进行转换。

您也可以使用 COM3D2 MOD EDITOR V2 打开转换后的 json 文件或是未转换的文件。

下载

Release 中下载

使用方法

CLI 提供四个主要命令:

convert2json

将 MOD 文件转换为 JSON 格式。

MeidoSerialization.exe convert2json [文件/目录]

示例:

MeidoSerialization.exe convert2json example.menu
MeidoSerialization.exe convert2json ./mods_directory
MeidoSerialization.exe convert2json --type menu ./mods_directory  # 只转换 .menu 文件
convert2mod

将 JSON 文件转换回 MOD 格式。

MeidoSerialization.exe convert2mod [文件/目录]

示例:

MeidoSerialization.exe convert2mod example.menu.json
MeidoSerialization.exe convert2mod ./json_directory
MeidoSerialization.exe convert2mod --type mate ./json_directory  # 只转换 .mate.json 文件
convert

自动检测并在 MOD 和 JSON 格式之间转换文件。

MeidoSerialization.exe convert [文件/目录]

示例:

MeidoSerialization.exe convert example.menu
MeidoSerialization.exe convert example.menu.json
MeidoSerialization.exe convert ./mixed_directory
MeidoSerialization.exe convert --type tex ./mixed_directory  # 只转换 .tex 和 .tex.json 文件
determine

确定目录中的文件或单个文件的类型。

MeidoSerialization.exe determine [文件/目录]

示例:

MeidoSerialization.exe determine example.menu
MeidoSerialization.exe determine --strict ./mods_directory
全局标志
  • --strict-s:使用严格模式进行文件类型判断(基于内容而非文件扩展名)
  • --type-t:按文件类型过滤(menu, mate, pmat, col, phy, psk, tex, anm, model)

常见问题

  • 它支持将 .tex 文件转换为图片吗?
    • 目前不支持,但 COM3D2 MOD EDITOR V2 可以实现。
    • 但你需要进行一些编程,因为它无法处理文件夹。

支持的文件类型

见主 README

构建

  1. 确保已安装 Go(版本 1.24 或更高)
  2. 克隆仓库:
    git clone https://github.com/MeidoPromotionAssociation/MeidoSerialization.git
    
  3. 构建 CLI:
    cd MeidoSerialization
    go build -o MeidoSerialization.exe
    

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "MeidoSerialization",
	Short: "MeidoSerialization CLI tool",
	Long: `MeidoSerialization CLI tool for converting between COM3D2 MOD files and JSON.
This tool can convert MOD files to JSON, JSON files to MOD files, and determine file types.

Supported file types include: .menu, .mate, .pmat, .col, .phy, .psk, .tex, .anm, and .model

Github: https://github.com/MeidoPromotionAssociation/MeidoSerialization
`,
	Run: func(cmd *cobra.Command, args []string) {

		cmd.Help()
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL