Command line interface

Our Usage

Descriptions of CLI parameters are shown when Spine is run with the --help parameter. Additional, advanced parameters are shown when Spine is run with the --advanced parameter.

Editor

Spine [-hvlft] [-x <host:port>] [-u <version>] [<path>]

-h, --help      Print basic CLI help and exit.
--advanced      Print advanced CLI help and exit.
-v, --version   Print version information and exit.
-l, --logout    Logout, removing activation code.
-u, --update    The version number of the Spine update to load.
-f, --force     Force download of the Spine update.
-x, --proxy     Proxy server to use when checking for and downloading updates.
-t, --notimeout Disable timeout when checking for and downloading updates.
project.spine   Path to a Spine project file to open.

The patch part of the Export

Spine [-i <path>] [-m] [-o <path>] -e <path>
Spine [-i <path>] [-m] [-o <path>] -e json[+pack]|binary[+pack]

Export JSON, binary, images, or video:
-i, --input   Path to a folder, project, or data file. Overrides export JSON.
-m, --clean   Animation clean up is performed before export.
-o, --output  Path to write export file(s). Overrides export JSON.
-e, --export  Path to export settings JSON file.

The export settings JSON file is created using Spine by clicking on the Save button at the bottom of the Export dialog.

Most build scripts that perform exports will want to use --update to specify the Spine editor version.

Input and output paths specified on the CLI are optional. If specified, they override any input or output paths specified in the export settings JSON file.

The input path is a path to a project, JSON, or binary file. The output path may be a file or folder, depending on the export settings.

The --clean-all parameter will clean all exports, so --clean doesn't have to be specified for each one.

If the --clean parameter is specified, animation Import

Spine -i <path> [-s <scale>] -o <path> -r [<name>]

Import JSON, binary, or a project's skeletons into another project:
-i, --input   Path to a folder, project, or data file to be imported.
-o, --output  Path to project file to import into. Created if nonexistent.
-s, --scale   Scale the project being imported.
-r, --import  Perform a skeleton import. The skeleton name may be omitted.

The input path is a project, JSON, or binary file. Alternatively, it can be a folder containing .spine, .json, or .skel files.

The output path is a project file.

If --scale is specified, the project's skeletons are Clean up

Clean up: Spine -i <path> -m

Animation clean up:
-i, --input   Path to project file or folder.
-m, --clean   Animation clean up is performed and the project is saved.

Animation Pack

Spine -i <path> [-j <path>]... -o <path> -p <name>
Spine -i <path> [-j <path>]... -o <path> [-n <name>] -p <path>

Texture atlas packing:
-i, --input   Path to folder of images to be packed.
-o, --output  Path to write texture atlas and PNG files.
-j, --project Path to a project to determine which images are used by meshes.
-n, --name    Texture atlas name, the prefix for the atlas and PNG files.
-p, --pack    Texture atlas name or path to pack settings JSON file.

The input and output paths are folder paths.

The --pack or -p parameter is either:

  • The Unpack
    Spine -i <path> -o <path> -c <path>

    Texture atlas unpacking:
    -i, --input Path to folder of atlas images.
    -o, --output Path to write unpacked image files.
    -c, --unpack Path to texture atlas file.

    Info

    Spine -i <path>

    Project information:
    -i, --input   Path to a folder, project, or data file.

    Information is output for each project file. This can useful to know what version of Spine a project was saved with, how many animations are in the project, and other information.

    The input path is a folder containing .spine files, a project file, or a JSON or binary data file.

    Advanced

    Advanced:
    -Xmx2048m          Set the maximum memory usage in megabytes (2048 default).
    --trace            Enable additional logging and diagnostic checks.
    --auto-start       Start automatically.
    --no-auto-start    Do not start automatically.
    --ping             Test latency to each server (otherwise done every 4 days).
    --server x         Set the preferred server regardless of ping (eg jp/us/eu).
    --disable-audio    Disable all audio support.
    --pretty-settings  Format settings files more nicely.
    --keys             Enable hotkey popups by default.
    --hide-license     Don't show name and email on launcher (eg for streaming).
    --ui-scale x       Set the interface scale (eg 200).
    --icc-profile x    Set the path to the ICC profile file for color management.
    --intro            Show the Esoteric Software logo intro.
    --clean-all        Animation clean up for all exports.
    --mesh-debug       Show debug information on top of meshes.
    --export-selection Editor selection is shown in image and video exports.
    --ignore-unknown   Don't error if a CLI parameter is not recognized.

    Examples

    Spine --export /path/to/export.json
    Spine --export "/path/with spaces/to/export.json"
    Spine --input /path/to/project.spine --output /path/to/output/
          --export /path/to/export.json
    Spine -i /path/to/project.spine -o /path/to/output/ -e /path/to/export.json
    Spine -i /path/to/project.spine -o /path/to/output/ -e binary+pack
    Spine -e /path/to/export1.json -e /path/to/export2.json
    Spine -i /path/to/images/ -o /path/to/output/ --pack /path/to/pack.json
    Spine -i /path/to/images/ -o /path/to/output/ -n name -p /path/to/pack.json
    Spine -i /path/to/project1.spine -o /path/to/output/ -e /path/to/export1.json
          -i /path/to/project2.spine -e /path/to/export2.json -i /path/to/images/
          -o /path/to/output/ -p /path/to/pack.json
    Spine -i /path/to/skeleton.json -o /path/to/project.spine -r skeletonName

    Multiple commands can be specified in one Spine ivocation, as seen in some of the examples above.

    The folders for output paths are created if they don't exist.

    If a command fails, Spine returns a non-zero error code.

    The Unknown parameters

    The Spine launcher checks that the specified parameters are allowed, before passing them to the Spine editor. If some CLI parameters are not accepted, it could be that those parameters were not available when your Spine launcher was installed, but a newer version of the Spine editor can still understand them.

    In that case, you can download and reinstall the Spine launcher or use the --ignore-unknown parameter so the Spine launcher will allow parameters it doesn't recognize. It will print a warning for unrecognized parameters, but will still pass them to the Spine editor. If the Spine editor doesn't recognize them, they will be ignored.

    Running Spine with CLI parameters

    Windows

    Spine for Windows comes with two executables: Spine.exe and Spine.com. The EXE file is a GUI application, it starts Spine without a console window and doesn't wait for Spine to exit. The COM file is a command line application, it directs Spine's output to a console window and waits for Spine to exit.

    Either executable can be used for the command line interface, but generally the COM file is preferred. If the Spine installation folder is on the system path or is the current working directory, specifying Spine without an extension will always execute Spine.com. For example:

    Spine -e C:\path\to\export.json

    Mac

    Command line export when using Spine for Mac is done by launching the Spine executable file directly rather than opening Spine.app. The executable is found inside Spine.app at Spine.app/Contents/MacOS/Spine. For example:

    /Applications/Spine.app/Contents/MacOS/Spine -e /path/to/export.json

    Linux

    Command line export when using Spine for Linux is done by running the Spine.sh script. For example:

    ./Spine.sh -e /path/to/export.json

    Next: Settings Previous: Import PSD