bacommontools package

Tools functionality shared by all Ballistica components.

Submodules

bacommontools.bacloud module

A tool for interacting with ballistica’s cloud services. This facilitates workflows such as creating asset-packages, etc.

class bacommontools.bacloud.App[source]

Bases: object

Context for a run of the tool.

run() int[source]

Run the tool.

run_interactive_command(cwd: str, args: list[str]) None[source]

Run a single user command to completion.

class bacommontools.bacloud.StateData(login_token: str | None = None)[source]

Bases: object

Persistent state data stored to disk.

login_token: str | None = None
bacommontools.bacloud.get_tz_offset_seconds() float[source]

Return the offset between utc and local time in seconds.

bacommontools.bacloud.run_bacloud_main() None[source]

Do the thing.

bacommontools.pcommands module

Pcommands for bacommontools.

bacommontools.pcommands.bacurl() None[source]

Run curl with the Ballistica API key injected.

Usage: bacurl [curl-args…] <url>

Reads ballistica_api_key from config/localconfig.json and passes it as a Bearer token in the Authorization header. All arguments are forwarded to curl. The -s (silent) flag is added automatically.

Examples:

bacurl https://dev.ballistica.net/api/v1/admin/stats/catalog
bacurl -X POST -H 'Content-Type: application/json' \
    -d '{"dry_run":true}' \
    https://dev.ballistica.net/api/v1/admin/stats/flush
bacommontools.pcommands.require_ballistica_api_key() None[source]

Verify a Ballistica API key is available; error if not.