abr_sdk.__main__#

The abr-sdk command-line tool.

Currently exposes one subcommand, activate, which reads this device’s fingerprint from the SDK library, trades a license key for a signed machine file from Keygen, and writes it under the license directory.

The fingerprint is read from the library’s fingerprint property, available without instantiating a model, so activation needs no license to discover the fingerprint it must bind to. Verifying and installing the downloaded envelope is the SDK’s job: abr_sdk.core.install_license hands it to the native abr_app_activate_license, which checks the signature and writes the device-bound license and integrity files under the license directory.

Author: Trevor Bekolay (Applied Brain Research)

Module Contents#

Classes#

ExitCode

Process exit codes. The specific reason is in the stderr message.

Functions#

build_parser

Construct the top-level abr-sdk parser with its subcommands.

is_valid_fingerprint

Return True when value is exactly 64 hexadecimal characters.

cmd_activate

Read the device fingerprint from the library, then run activation.

_resolve_key

Return the license key from --key or the --key-file contents.

run_activation

Download the license envelope from Keygen and install it via the SDK.

_fail

Print a prefixed message to stderr and return code.

main

Parse arguments and dispatch to the selected subcommand.

Data#

API#

class abr_sdk.__main__.ExitCode#

Bases: enum.IntEnum

Process exit codes. The specific reason is in the stderr message.

Initialization

Initialize self. See help(type(self)) for accurate signature.

SUCCESS#

0

ERROR#

1

NETWORK#

2

LICENSE#

3

abr_sdk.__main__._EXIT_FOR_FAILURE: Final[dict[abr_sdk.keygen.Failure, abr_sdk.__main__.ExitCode]]#

None

abr_sdk.__main__.build_parser() argparse.ArgumentParser#

Construct the top-level abr-sdk parser with its subcommands.

abr_sdk.__main__.is_valid_fingerprint(value: str) bool#

Return True when value is exactly 64 hexadecimal characters.

abr_sdk.__main__.cmd_activate(args: argparse.Namespace) int#

Read the device fingerprint from the library, then run activation.

abr_sdk.__main__._resolve_key(args: argparse.Namespace) str#

Return the license key from --key or the --key-file contents.

abr_sdk.__main__.run_activation(client: abr_sdk.keygen.KeygenClient, library: abr_sdk.core.Library, fingerprint: str, license_dir: pathlib.Path) int#

Download the license envelope from Keygen and install it via the SDK.

abr_sdk.__main__._fail(code: abr_sdk.__main__.ExitCode, message: str) int#

Print a prefixed message to stderr and return code.

abr_sdk.__main__.main(argv: list[str] | None = None) None#

Parse arguments and dispatch to the selected subcommand.