Stash CLI
Learn how to use the Stash CLI to integrate build uploads and release management into your pipelines and CI/CD workflows. Download the CLI for Windows or macOS and automate your game distribution.
Use the Stash CLI to integrate build uploads and release management into your pipelines and CI/CD workflows.
One-line installers
Run the following one-line installers to set up the Stash CLI:
Windows:
powershell.exe -ExecutionPolicy Bypass -Command "IEX (Invoke-WebRequest 'https://cli.stash.gg/install.ps1')"Unix (macOS, Linux):
/bin/bash -c "$(curl -fsSL https://cli.stash.gg/install.sh)"After installation, run the CLI with stash-cli.
Upload builds
Use the Stash CLI to upload and configure builds. Run a separate command for each target platform.
stash-cli upload --env=<test|prod> \
--secret=<secret_from_stash_studio> \
--file_path=<zip_file_name> \
--executable_path="Build\my_game.exe" \
--platform=<windows|mac>
--channel=<channel_id>Parameters
The following table lists the parameters for the upload command.
| Parameter | Description | Example | Required |
|---|---|---|---|
secret | Your Stash Studio secret. Find it in Settings > API Secrets | HFeMGWYd-Tn | Yes |
file_path | Local path to the ZIP file you want to upload | /Users/dev/builds/test.zip | Yes |
executable_path | The path to the game executable within the zip folder | /build/test-build.exe (Windows) /build/test-build.app/Contents/MacOS/TestBuild (Mac) | Yes |
platform | The platform for the binary | windows or mac | Yes |
env | The environment to upload the binary | test or prod | No |
channel | The release channel ID. Find it in Launcher > Channels | 933e5aae-2e9-c8bd30 | No |
Maintenance mode
The Stash CLI can also turn launcher maintenance mode on and off, so your maintenance automation can block game downloads and launches while your servers are down. See Launcher Maintenance Mode for the commands and behavior.
CI/CD
The Stash CLI is great for CI/CD pipelines to automate your build uploads to the launcher. Here is a simple GitHub Actions / Jenkins sample:
# Install Stash CLI on Unix runner
- name: Install Stash CLI
run: |
/bin/bash -c "$(curl -fsSL https://cli.stash.gg/install.sh)"
echo "Stash CLI installed"
stash-cli --version
# Upload macOS build to Stash Studio using Stash CLI
- name: Upload macOS build to Stash Studio
run: |
stash-cli upload \
--env=test \
--secret="${{ secrets.STASH_API_KEY }}" \
--file_path="${{ github.workspace }}/StandaloneOSX-latest.zip" \
--executable_path="${{ env.EXECUTABLE_PATH }}" \
--platform=mac \
--channel="${{ env.LAUNCHER_CHANNEL_ID }}"
echo "Build uploaded to Stash Studio"How is this guide?