Local JSON CLI

Use an AI coding agent or terminal to call the same workbook editing engine used by the Unity editor. Python 3 with the standard library is required. Keep Unity open, idle and outside Play Mode. No network service or AI account is required by this transport.

Documentation

Run a request

Save a JSON request as request.json. Run from your project directory:

python Assets/DesignDataTable/Scripts/Editor/ddt_cli.py --project . --request request.json

Omit --request to read JSON from standard input. Output is JSON. Exit codes: 0 success, 1 rejected operation, 2 timeout. The response schema is designdatatable.cli/1.

Inspect and read

{"operation":"capabilities"}
{"operation":"inspect","path":"Assets/Sheets/Book.xlsx"}
{"operation":"read","path":"Assets/Sheets/Book.xlsx","sheet":"Sheet1","row":0,"column":0,"rows":2,"columns":3}

Rows and columns are zero-based worksheet coordinates. Registered game sources retain their name/type header rows. Inspect returns worksheet names, source revision and mode (spreadsheet or game-data-table). Read returns original input and calculated display; protected hidden formula inputs are omitted. Reads use the saved file, not an open window's unsaved draft. A single request is limited to 10,000 cells.

Write an ordinary workbook

Use the revision returned by inspect/read as expectedRevision. Do not substitute the illustrative placeholder below.

{"operation":"write","path":"Assets/Sheets/Book.xlsx","sheet":"Sheet1","expectedRevision":"SHA256_FROM_INSPECT","cells":[{"row":0,"column":0,"input":"2"},{"row":0,"column":1,"input":"3"},{"row":0,"column":2,"input":"=SUM(A1:B1)"}]}

Write applies one edit transaction and saves through WorkbookEditSession, including its preservation and conflict checks. It rejects stale revisions, duplicate targets, invalid coordinates and open workbook windows with pending edits. Inspect the new revision after success. Workbook formatting and unsupported structures remain subject to the editor's existing support restrictions.

Registered game data

{"operation":"validate-game","path":"Assets/DesignDataTable/Tables/SampleCharacter.xlsx"}

Validation checks the saved registered source by constructing its typed binary representation without publishing generated outputs. Registered game-data writes use the unified editor save path: validate all registered sheets before saving, then update generated code and binary outputs. validate-game also returns binaryMatches to compare the registered binary with the saved source. This is not an MCP server and does not automatically attach to Codex's spreadsheet tools.

Transport and recovery

Requests and responses stay in Library/DesignDataTable/Automation under the selected project. Source paths must resolve inside the project and use XLSX or CSV. A CLI timeout does not cancel a queued request: inspect its ID in responses before retrying a write. Retained request/response files may contain cell contents; they are local development data and must not be distributed with the asset. Do not manually re-enqueue a completed write with a new ID without checking the current revision.

Verified on Windows with an open Unity 6000.0.83f1 editor. macOS, editor-free execution, MCP clients and complete Excel compatibility are not verified.