Skip to main content

Snapser CLI Tool

Project description

Snapser CLI Tool

Dependencies

The Snapser CLI tool depends on Python 3.X and Pip. MacOS comes pre isntalled with Python. But please make sure you are running Python 3.X. On Windows, you can download Python 3.X from the Windows store. Some of the commands also need docker.

Installation

Installing PIP on MacOS

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

Installing PIP on Windows

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

Once you have Python and Pip installed

pip install --user snapctl

If you also have Python 2.X on your machine, you may have to run instead

pip3 install --user snapctl

Important Please verify that your python path has been added to $PATH

Upgrade

Upgrade your snapctl version

pip install --user snapctl --upgrade

Setup

Get your Snapser Access Key

Log in to your Snapser account. Click on your user icon on the top right and select, User Settings. Under developer key tab you will be able to copy your Access Key.

Setup a local config

Create a file named ~/.snapser/config. Open it using the editor of your choice and replace with your personal Snapser Access key. Save the file.

[default]
snapser_access_key = <key>

Or you can run the following command

on MacOSX

# $your_api_key = Your Snapser developer key
echo -e "[default]\nSNAPSER_API_KEY=$your_api_key" > ~/.snapser/config

on Windows Powershell

# $your_api_key = Your Snapser developer key
echo "[default]
SNAPSER_API_KEY=$your_api_key" | Out-File -encoding utf8 ~\.snapser\config

Verify Snapctl installation

snapctl --version

You should see the latest snapctl version in the output

Supported commands

Run the following to see the list of commands Snapser supports

snapctl --help

Advanced Setup

Snapser by default supports access to multiple accounts. You can create multiple profiles in your Snapser config ~/.snapser/config.

[profile personal]
snapser_access_key = <key>

[profile professional]
snapser_access_key = <key>

You can then set an environment variable telling Snapser which profile you want to use.

# Mac
export SNAPSER_PROFILE="my_profile_name";
# Windows
setx SNAPSER_PROFILE="my_profile_name";

Or you can pass --profile my_profile_name with every command to tell Snapser to use a particular profile.

Commands

1. byosnap publish-image

Ability to publish a custom snap code image.

# Help for the byosnap command
snapctl byosnap publish-image --help

# Publish a new image
# $byosnap_sid = Snap ID for your snap
# $image_tag = An image tag for your snap
# $code_root_path = Local code path where your Dockerfile is present
# Example:
# snapctl byosnap publish-image byosnap-jinks-flask my-first-image --path /Users/DevName/Development/SnapserEngine/jinks_flask
snapctl byosnap publish-image $byosnap_sid $image_tag --path $code_root_path

2. byosnap publish-version

Ability to publish a new version for your Snap.

# Help for the byosnap command
snapctl byosnap publish-version --help

# Publish a new image
# $byosnap_sid = Snap ID for your snap
# $image_tag = An image tag for your snap
# $prefix = Prefix for your snap Eg: /v1
# $version = Semantic version for your snap Eg: v0.0.1
# $ingress_port = Ingress port for your snap Eg: 5003
# Example:
# snapctl byosnap publish-image byosnap-jinks-flask my-first-image --prefix /v1 --version v0.0.1 --http-port 5003
snapctl byosnap publish-version $byosnap_sid $image_tag --prefix $prefix --version $version --http-port $ingress_port

3. byosnap upload-docs

Ability to upload swagger.json and README.md for you Snap

# Help for the byogs command
snapctl byosnap upload-docs --help

# Publish a new image
# $byogs_sid = Game server ID for your snap
# $image_tag = An image tag for your snap
# $code_root_path = Local code path where your swagger.json and README.md files are present
# Example:
# snapctl byosnap upload-docs byogs-jinks-flask my-first-image --path /Users/DevName/Development/SnapserEngine/jinks_flask
snapctl byosnap upload-docs $byogs_sid $image_tag --path $code_root_path

4. byogs publish-image

Ability to publish your custom game server image.

# Help for the byogs command
snapctl byogs publish-image --help

# Publish a new image
# $byogs_sid = Game server ID for your snap
# $image_tag = An image tag for your snap
# $code_root_path = Local code path where your Dockerfile is present
# Example:
# snapctl byogs publish-image byogs-jinks-flask my-first-image --path /Users/DevName/Development/SnapserEngine/jinks_flask
snapctl byogs publish-image $byogs_sid $image_tag --path $code_root_path

5. byogs publish-version

Ability to publish a new version for your Game server.

# Help for the byogs command
snapctl byogs publish-version --help

# Publish a new image
# $byogs_sid = Snap ID for your snap
# $image_tag = Any image tag for your snap
# $prefix = Prefix for your snap Eg: /v1
# $version = Semantic version for your snap Eg: v0.0.1
# $ingress_port = Ingress port for your snap Eg: 5003
# Example:
# snapctl byogs publish-image byogs-jinks-flask my-first-image --prefix /v1 --version v0.0.1 --http-port 5003
snapctl byogs publish-version $byogs_sid $image_tag --prefix $prefix --version $version --http-port $ingress_port

6. sdk download

Download a Snapser SDK for your game

# Help for the byogs command
snapctl sdk download --help

# Publish a new image
# $cluster_id = Cluster Id
# $sdk_type = One of the supported SDK names: unity, unreal, roblox, godot, cocos, ios-objc, ios-swift, android-java, android-kotlin, web-ts, web-js, csharp, cpp, lua, ts, go, python, kotlin, java, c, node, js, perl, php, closure, ruby, rust.
# Example:
# snapctl sdk download gx5x6bc0 unity
snapctl sdk download $cluster_id $sdk_type

Project details


Release history Release notifications | RSS feed

This version

0.3.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snapctl-0.3.2.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snapctl-0.3.2-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file snapctl-0.3.2.tar.gz.

File metadata

  • Download URL: snapctl-0.3.2.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.8 Darwin/22.6.0

File hashes

Hashes for snapctl-0.3.2.tar.gz
Algorithm Hash digest
SHA256 6c7d8099351e6077032d4ac79102a5c5fa2324a04b8e0371f3a4d8ffb4e217c3
MD5 1295f954f2059795b5eb1314bd178f1b
BLAKE2b-256 69877c859016dcce92fc79ee4541677ecf6227c7fbd3b8e2a2aec72063ff0942

See more details on using hashes here.

File details

Details for the file snapctl-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: snapctl-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.8 Darwin/22.6.0

File hashes

Hashes for snapctl-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fce16bd03eaceb1d3b1e9dd55b847166c502ab68bf486a9ebd3a9b5f22891299
MD5 74fb7e44bbdbb8696af6cf36e64ae52f
BLAKE2b-256 a889a06d4202a17bca4c0cd6764d3d4fd87ac252681d89889c7530097d68046e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page