Agentic Research

DesignCraft Deep Dive: Layout and Publishing with designcraft-cli

2026/10/1020 min readBryan Chan閱讀中文原文
TopicsDesignCraftLayout & PublishingCLIAI Agent

If OfficeCLI solves "Office file automation", DesignCraft solves layout — columns, bleed, facing pages, font pairing, page composition. It uses its native .designcraft format and also imports IDML (the Adobe InDesign interchange format), so it interoperates with traditional publishing workflows. The designcraft-cli command line (tested v0.5.0) can be driven entirely by an agent.

Positioning: Layout Automation on the Command Line

Layout is "seventy percent spec, thirty percent feel". Once it's on the command line, the spec can be verified and replayed — exactly what an agent needs. Every command in this article was tested against a local designcraft-cli 0.5.0, and the rendered pages were produced headlessly by the CLI.

Install and Version

designcraft-cli --version

--version should print 0.5.0. For downloads and the desktop app, see the DesignCraft page on getartcraft.com; this article focuses on the CLI.

The Nine Subcommands

designcraft-cli run    [--in FILE | --sample] [--cmd ID[=JSON]]... [--page N] [--scale S] [--export OUT] [--all-pages DIR]
designcraft-cli commands [FILTER]
designcraft-cli describe COMMAND
designcraft-cli script [FILE|-] [--in FILE | --sample] [--connect PORT] [--save OUT] [--export OUT] [--keep-going]
designcraft-cli app    [--port PORT] COMMAND [JSON] | --method METHOD [JSON]
designcraft-cli mcp    [--connect PORT] [--sample]
designcraft-cli perf   [--pages N] [--runs N] [--strict]
designcraft-cli bench  FILE [--runs N]
designcraft-cli links
SubcommandWhat it does
runRuns one or more actions headlessly; outputs PDF, per-page PNG, or rescales
commandsLists all available commands (444 in total), optionally filtered
describeShows the parameter schema of a single command
scriptMulti-step runs (file or stdin), can --connect to the App
appControls the running App (over the control port)
mcpMounts as an MCP server for AI agents to call directly
perfStress test (page count / run count / strict mode)
benchBenchmarks a single file
linksOfficial Discord / website / GitHub / Issues

The Document Model: file.new

{
  "preset": "A4",
  "pages": 1,
  "facingPages": true,
  "columns": 3,
  "gutter": 4,
  "margins": { "top": 12, "bottom": 12, "inside": 14, "outside": 14 },
  "bleed": 3
}

A few useful entry points:

Command IDWhat it does
file.openOpens .designcraft or .idml; a Document Fonts folder beside it loads first
file.openBytesFeeds base64 directly (no temp file)
file.newSampleBuilt-in multi-page magazine sample, ideal for validating the pipeline
file.presetsLists the built-in page presets

From Zero to Publish: Real Rendering

Render four PNG pages from the built-in magazine sample in one command:

designcraft-cli run --sample --cmd file.newSample='{}' --all-pages ./out

Export a PDF from a file, or render a single page at 2x scale:

designcraft-cli run --in my.designcraft --export out.pdf
designcraft-cli run --in my.designcraft --page 2 --scale 2 --export page2.png

Magazine sample page 1 (cover)

Magazine sample page 2

Magazine sample page 3

Magazine sample page 4

All four pages were rendered headlessly by designcraft-cli (630×810), with no GUI needed.

Three Ways to Automate

6.1 Scripted Runs (Multiple Steps)

designcraft-cli script steps.json --in my.designcraft \
  --save out.designcraft --export out.pdf --keep-going

--keep-going keeps going even if a single step fails, which helps long flows; you can also feed an array of command JSON via stdin.

6.2 Connect to the App (GUI ↔ CLI)

designcraft-cli app --port 7979 file.new '{"preset":"A4"}'

Without the App or its control port you'll get Connection refused — open the control port on the App side first (designcraft --control 7979), then let the CLI connect.

6.3 Mount as MCP (for Agents)

designcraft-cli mcp --connect 7979 --sample

Once it's an MCP server, an AI agent can call layout capabilities directly, with no human opening a GUI.

Performance and Benchmarks

designcraft-cli perf --pages 50 --runs 3 --strict
designcraft-cli bench my.designcraft --runs 5

In practice the four-page sample renders headlessly at single-digit to low-double-digit milliseconds per page (slower on first run, then stable) — entirely acceptable.

Next Steps