ztcli - ZillaTech Command Line Interface
Version: 0.1
Command line interface for zillatech.io services. This tool will help you to configure CI/CD system for your project.
With this tool, you can do everything that you can do on a website. Internally the website is using this tool under the hood.
So when you do some operations like upload a new version, or changing HEAD version - you will see how
our back-end services are executing this command. You can copy them and insert to your CI/CD configurations.
Installation and configuration
The ztcli executable can be found here: https://portal.zillatech.io/Downloads
At the bottom of the page in "ztcli" download section.
You can choose executable for your platform. It is a self containing application, and requires no dependencies or configs - pure exe single binary ! :)
Before using of the tool you need to define environment variables:
- ZT_API_PUBLIC_KEY
- ZT_API_PRIVATE_KEY
You can create these keys here https://portal.zillatech.io/ManageAccount/ApiKeys
To define these variables on windows you have to do:
set ZT_API_PUBLIC_KEY=<your_public_key>
set ZT_API_PRIVATE_KEY=<your_secret_key>
in bash/shell:
export ZT_API_PUBLIC_KEY=<your_public_key>
export ZT_API_PRIVATE_KEY=<your_secret_key>
We do not recommend using email and password for authentication ! As it creates additional security risk for you.
Usage
ztcli [command] [options]
Global Options
-?|-h|--help- Show help information-v|--version- Show version information
Commands
ztcli provides two main service commands:
- gamecdn - GameCDN Service for managing versions in the cloud
- installer_maker - InstallerMaker Service for managing game installer and launcher parameters
GameCDN Command
Manages game versions in the cloud with incremental update capabilities.
ztcli gamecdn [command] [options]
GameCDN Subcommands
upload
Creates a new version and uploads it to the cloud.
ztcli gamecdn upload [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--build-id <BUILD_ID>- Build id (build number, changelist hash, or any unique string like sequence number or datetime)--build-description <BUILD_DESCRIPTION>- Optional build description with short description of changes--directory <BUILD_FOLDER>- Build directory where files are located (do not archive, just point to folder location)--product-id <PRODUCT_ID>- Product id where the build will be uploaded (see: https://portal.zillatech.io/Products)--set-as-head- Set uploaded build as head version (users will update to this version ASAP)
Description:
The program determines file differences and uploads only changes compared to the released HEAD build of the specified product.
download
Downloads the latest (HEAD) build.
ztcli gamecdn download [options]
Options:
--no-prompts- No prompts will be asked via stdin--directory <BUILD_FOLDER>- Build directory where to download (folder can contain existing build for incremental update)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)
prepare_full_version
Prepares a full version that users can download via direct link and serves as a starting point for incremental updates.
ztcli gamecdn prepare_full_version [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)--hash <HASH>- Hash of the version to prepare as full version
Important Notes:
- Full versions consume storage equal to the full version size
- Manage full versions carefully
- Recommended for very large version updates or major updates
clean_full_version
Cleans prepared full version zip archive from the cloud.
ztcli gamecdn clean_full_version [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)--hash <HASH>- Hash of the version to clean full version
Important Notes:
- This does NOT delete the actual data
- Only removes the prepared full version zip archive
- Direct download link will no longer work
- Users can still download the build using installer with incremental updates
- Version control system will search for another starting point for updates
set_head
Sets a specific version as the HEAD version. The HEAD version is the version to which all users will update the next time they run game installer.
So it acts like a "Push Release" button. By default, web console is setting every upload as HEAD version by adding --set-as-head command argument.
Important Notes:
- If you decide to rollback version (for example in case of crashes or critical bugs in your build) - better to upload working version on top of current HEAD (buggy version). If you set HEAD to previous version, users will download full size build from scratch. So it very similar to what git system does with rollback commits.
ztcli gamecdn set_head [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)--hash <HASH>- Hash of the version to set as head
remove_leaf_version
Removes a leaf version (a version with no derived versions based on it).
ztcli gamecdn remove_leaf_version [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)--hash <HASH>- Hash of the version to remove (if version is head, previous version will be set to head)
delete_repository
Deletes all data for a repository.
ztcli gamecdn delete_repository [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)
WARNING: This will delete all your data and cannot be reverted!
sync_with_storage
Syncs repository with cold storage. Dont use this command for now.
It was made to synchronize metadate in DB with 'cold' storage.
ztcli gamecdn sync_with_storage [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--organization-id <ORGANIZATION_ID>- Organization id (see: https://portal.zillatech.io/ManageOrganization)--product-id <PRODUCT_ID>- Product id (see: https://portal.zillatech.io/Products)
Note: Normally should never be used. Can be used after serious outages or backup restore operations.
InstallerMaker Command
Manages game installer and launcher parameters.
ztcli installer_maker [command] [options]
InstallerMaker Subcommands
update_config
Sets new configuration parameters for the installer maker (launcher application).
ztcli installer_maker update_config [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--directory <BUILD_FOLDER>- Directory with configuration files (should contain global config.json with all required parameters, plus optional PNG and GIF files referenced from config.json)--product-id <PRODUCT_ID>- Product id associated with installer (see: https://portal.zillatech.io/Products)
generate_default
Generates default config for the launcher.
ztcli installer_maker generate_default [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--product-id <PRODUCT_ID>- Product id associated with installer (see: https://portal.zillatech.io/Products)
make_installer
Increments installer version, compiles, and builds a new installer artifact that will be published to the internet.
ztcli installer_maker make_installer [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--product-id <PRODUCT_ID>- Product id associated with installer (see: https://portal.zillatech.io/Products)
Note: To get a list of existing artifacts, use the list_artifacts command.
list_artifacts
Lists existing artifacts with Id, filename, and download link.
ztcli installer_maker list_artifacts [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--product-id <PRODUCT_ID>- Product id associated with installer (see: https://portal.zillatech.io/Products)
remove_artifacts
Removes artifacts with specified Ids from the cloud and distribution.
ztcli installer_maker remove_artifacts [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--product-id <PRODUCT_ID>- Product id associated with installer (see: https://portal.zillatech.io/Products)--artifact-id <ARTIFACT_ID>- Artifact Id to remove (uselist_artifactscommand to get Ids)
Note: This will delete the artifact (installer or launcher) from distribution so users won't be able to download it.
clean_config
Removes all installer configs for the specified product.
ztcli installer_maker clean_config [options]
Options:
--no-prompts- No prompts will be asked via stdin--user-email <ZT_USEREMAIL>- User email (also read from env var: ZT_USEREMAIL)--password <ZT_PASSWORD>- Password (also read from env var: ZT_PASSWORD)--api-public-key <ZT_API_PUBLIC_KEY>- API Public Key (also read from env var: ZT_API_PUBLIC_KEY)--api-private-key <ZT_API_PRIVATE_KEY>- API Private Key (also read from env var: ZT_API_PRIVATE_KEY)--product-id <PRODUCT_ID>- Product id associated with installer (see: https://portal.zillatech.io/Products)
Authentication
Most commands support two authentication methods:
1. User Credentials - possible but not recommended way
--user-email- User email--password- User password
2. API Keys - recommended way
--api-public-key- API Public Key--api-private-key- API Private Key
All authentication parameters can also be provided via environment variables:
ZT_USEREMAILZT_PASSWORDZT_API_PUBLIC_KEYZT_API_PRIVATE_KEY
Common Patterns
Non-Interactive Mode
Use the --no-prompts flag for automation and CI/CD pipelines to prevent interactive prompts.
Environment Variables
Set authentication credentials as environment variables for convenience:
export ZT_USEREMAIL=your.email@example.com
export ZT_PASSWORD=your_password
Or for API keys:
export ZT_API_PUBLIC_KEY=your_public_key
export ZT_API_PRIVATE_KEY=your_private_key
Examples
Upload a new game build
ztcli gamecdn upload --build-id "v1.2.3" --build-description "Bug fixes" --directory "C:\MyGame\Build" --product-id 123 --set-as-head
Download latest build
ztcli gamecdn download --directory "C:\MyGame\Download" --organization-id "org123" --product-id 456
Create a new installer
ztcli installer_maker make_installer --product-id 123
List all installer artifacts
ztcli installer_maker list_artifacts --product-id 123
Getting Help
For help with any command, use the -h or --help flag:
ztcli --help
ztcli gamecdn --help
ztcli gamecdn upload --help
ztcli installer_maker --help
ztcli installer_maker make_installer --help
Related Resources
- Portal: https://portal.zillatech.io
- Products page: https://portal.zillatech.io/Products
- Api keys management: https://portal.zillatech.io/ManageAccount/ApiKeys
- Organization management: https://portal.zillatech.io/ManageOrganization