Articles
Fundamentals
The Command Line Tool

Using the Command Line Tool

A screenshot of the Spark AR Studio command line tool.

Use the command line tool to automate workflows in Spark AR Studio.

Finding the command line tool

On Mac, the tool is located inside the app bundle:

/Spark AR Studio.app/Contents/MacOS/sparkTerminalAppleMac

On Windows, the tool is inside the install folder:

\Spark AR Studio\versionNumber\sparkTerminalBinaryWindows.exe

Command syntax

Commands take the following form:

<Command> [Options] [Subcommand] [Subcommand options] [Path to file]

  • Command: The top-level command. On MacOS this will be ./sparkTerminalAppleMac, on Windows this will be .\sparkTerminalBinaryWindows.exe.

  • Options: Additonal command options.

  • Subcommand: Specifies an operation to perform.

  • Subcommand options: Modifies the parameters of the subcommand.

  • Path to file: The path to the file the command will be performed on.

For example:

./sparkTerminalAppleMac export -d ./MyFolder ./PathTo/project

Enabling a structured output

The tool supports structured output, including as JSON, meaning it can be driven by scripts in a robust way.

To enable structured output, add --output-format=json to the command line parameters:

./sparkTerminalAppleMac export --output-format=json

export

Exports the project file(s) for upload.


Options

-d,--output-directory

The directory to output exported files to. Defaults to the current working directory if none is specified.


--export-version

The version of the SDK to target. If the project contains features not supported by the target version the command will fail. Defaults to the latest SDK version if none is specified.



Example

./sparkTerminalAppleMac export -d ./MyFolder ./PathTo/Project

package

Packages the project file(s).


Options

-d,--output-directory

The directory to output project packages to. Defaults to the current working directory if none is specified.



Example

./sparkTerminalAppleMac package -d ./MyFolder ./PathTo/Project

extract_metadata

Extracts metadata from a patch asset. This includes the name, description, compatibility and metadata for ports.


Options

-d,--output-directory

The directory to output the metadata to. Defaults to the current working directory if none is specified.



Example

./sparkTerminalAppleMac extract_metadata -d ./MyFolder ./PathTo/Project

3d

Actions related to 3D objects.


Subcommand options:

convert

Converts a 3D object to Spark AR Studio format.


Options

-o,--output-directory

The directory to output the converted files to. Defaults to the current working directory if none is specified.

-s,--scale-factor

The value to scale the object to, as a float. For example -s 2.0 scales the object by 2.



Example

./sparkTerminalAppleMac 3d convert -o ./MyFolder -s 2.0 ./PathTo/File



convert_to_remote_mesh

Converts a 3D object to GLB format.


Options

-o,--output-directory

The directory to output the converted files to. Defaults to the current working directory if none is specified.



Example

./sparkTerminalAppleMac 3d convert_to_remote_mesh ./PathTo/File

mesh_replace

Replaces a 3D object in a project file.


Options

-r,--remove

The scene object and asset name to remove.

-i,--insert

The 3D object file path to add and instantiate.

-c,--compress

Enables texture compression for the 3D model. By default, they are uncompressed.

--export-version

Exports the project for publication with target version. Use 0 for the current production version. 3D models will be stored in Studio format by default.

-o,--output-directory

The directory to output the converted files to. Defaults to the current working directory if none is specified.



Example

./sparkTerminalAppleMac 3d mesh_replace -r Sphere ./PathTo/Project

Was this article helpful?