Publish your App via the iTwin Studio CLI
The studio-cli apps publish command is the recommended way to publish iTwin Studio Apps to the iTwin extensions marketplace. This command takes care to create and upload your verified packaged iTwin Studio App to the iTwin Extensions marketplace.
studio-cli apps publish [app-id] --app-publisher-client-id="your-client-id"Authentication
Section titled “Authentication”To successfully authenticate when using the CLI to publish an iTwin Studio App to Bentley’s Extensions marketplace registry, you must set the environment variable APP_PUBLISHER_SECRET to your client secret.
This can be done in the terminal before running the CLI command. On macOS or Linux, you can set the environment variable using the command export APP_PUBLISHER_SECRET=your_client_secret. On Windows, you can set it using powershell $env:APP_PUBLISHER_SECRET="your_client_secret" in PowerShell. This environment variable is mandatory for the CLI to authenticate and perform the necessary operations.
Command-Line Options
Section titled “Command-Line Options”Here are some of the key options you can use with studio-cli apps publish:
// The app publisher client ID (mandatory)--app-publisher-client-id <APP_PUBLISHER_CLIENT_ID>
// The artifact folder path, if not provided, the current working directory is used--artifact-folder <ARTIFACT_FOLDER>
// environment prefix qa- or empty string to publish the app to the extensions marketplace--env-prefix <ENV_PREFIX>supported environment variables
APP_NAME="sandbox-app"APP_PUBLISHER_CLIENT_ID="YOUR_PUBLISHER_CLIENT_ID"APP_PUBLISHER_SECRET="YOUR_SECRET"ARTIFACT_FOLDER="path/to/artifacts"ENV_PREFIX="qa-"Precedence of options
Section titled “Precedence of options”When specifying options, the order of priority is as follows:
- CLI arguments: Options specified directly on the command line.
- Environment variables: Options set as environment variables.