ts-cli

--help

ts-cli --help

usage: ts-cli [-h] [--version] {init,publish,unpublish,config} ...

TetraScience Command Line Interface

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

commands:
  {init,publish,unpublish,config}
    init                Create a new artifact from a template
    publish             Publish artifact identified by namespace/slug:version
    unpublish           Unpublish an artifact identified by namespace/slug:version
    config              Get and set user options

ts-cli init --help

usage: ts-cli init [-h] [--interactive] [--overwrite] [--preserve-templates]
                   [--platform-version PLATFORM_VERSION] [--profile PROFILE]
                   [--namespace NAMESPACE] [--slug SLUG] [--version VERSION]
                   [--protocol-namespace PROTOCOL_NAMESPACE]
                   [--protocol-slug PROTOCOL_SLUG]
                   [--protocol-version PROTOCOL_VERSION]
                   [--task-script-namespace TASK_SCRIPT_NAMESPACE]
                   [--task-script-slug TASK_SCRIPT_SLUG]
                   [--task-script-version TASK_SCRIPT_VERSION]
                   [--ids-namespace IDS_NAMESPACE] [--ids-slug IDS_SLUG]
                   [--ids-version IDS_VERSION]
                   [{ids,protocol,task-script,tetraflow,lakehouse}] [target]

Create a new artifact for the Tetra Data Platform. For example:

    ts-cli init protocol .

where "." is the path to the new artifact source.
The source code positional argument defaults to the current working directory.

The template configuration field is required.

Each template uses 1 to 3 artifact configurations,
    protocol, task-script, or ids
  consisting of the following fields:
    namespace, slug, version
  Additionally, for the task-script artifact, there is the function field.
While artifact configuration fields are not required, the init command will
  sequentially check each of the following locations for each configuration:
    1. The respective command argument for the specific artifact type
        Example: --ids-slug my-slug
    2. The respective command argument for all artifacts used by the template
        Example: --slug my-slug
For the namespace field, the init command will additionally look for
  a configured org (see below)
If no configuration can be found, it will either be omitted, or filled in
  with default values from [common/example:v1.0.0@main] if it is required.

The init command will sequentially check each of the following locations
  for an org
    1. In the process's environment variables, at TS_ORG
    2. The yaml or json formatted file at  "~/.config/tetrascience/config"

The init command has support for multiple Tetra Data Platform versions.
  The init command will sequentially check each of the following locations
  for a configured platform version
    1. The `--platform-version` command line argument
    2. In the process's environment variables, at TS_PLATFORM_VERSION
    3. The yaml or json formatted file at "~/.config/tetrascience/config"
  If no platform versio is found, the current TDP version
    v4.3 is assumed.

positional arguments:
  {ids,protocol,task-script,tetraflow,lakehouse}
                        artifact template to use
  target                Destination folder

options:
  -h, --help            show this help message and exit
  --interactive, -i     interactively set up Artifact configuration
  --overwrite, -o       Force overwrite files and folders on conflict
  --preserve-templates, -p
                        Leave template files on disk instead of deleting them
  --platform-version PLATFORM_VERSION
                        The version of the platform
  --profile PROFILE     The name of the configuration profile to use

General Artifact Configuration:
  --namespace NAMESPACE
                        Artifact namespace configuration
  --slug SLUG           Artifact slug configuration
  --version VERSION     Artifact version configuration

Protocol Configuration:
  --protocol-namespace PROTOCOL_NAMESPACE
                        Protocol namespace configuration
  --protocol-slug PROTOCOL_SLUG
                        Protocol slug configuration
  --protocol-version PROTOCOL_VERSION
                        Protocol version configuration

Task Script Configuration:
  --task-script-namespace TASK_SCRIPT_NAMESPACE
                        Task Script namespace configuration
  --task-script-slug TASK_SCRIPT_SLUG
                        Task Script slug configuration
  --task-script-version TASK_SCRIPT_VERSION
                        Task Script version configuration

IDS Configuration:
  --ids-namespace IDS_NAMESPACE
                        IDS namespace configuration
  --ids-slug IDS_SLUG   IDS slug configuration
  --ids-version IDS_VERSION
                        IDS version configuration

ts-cli publish --help

usage: ts-cli publish [-h]
                      [--type {connector,ids,protocol,task-script,tetraflow,lakehouse}]
                      [--namespace NAMESPACE] [--slug SLUG]
                      [--version VERSION] [--interactive] [--exclude EXCLUDE]
                      [--include INCLUDE] [--force] [--no-verify] [--dry-run]
                      [--ignore-ssl | --enforce-ssl] [--profile PROFILE]
                      [--org ORG] [--api-url API_URL]
                      [--auth-token AUTH_TOKEN] [--config CONFIG]
                      [source]

Publish an artifact to the Tetra Data Platform. For example:

    ts-cli publish .

where "." is the path to the artifact source code.
The source code positional argument defaults to the current working directory.

The following artifact configuration fields are required:
    type, namespace, slug, version
The publish command will sequentially check each of the following locations
  for each configuration:
    1. The respective command argument.
        Example: --type protocol
    2. A manifest.json file in the root of the artifact directory
    3. A protocol.{yaml,yml,json} file in the root of the artifact directory
    4. A schema.json file in the root of the artifact directory
    5. A pyproject.toml file in the root of the artifact directory
For the namespace field, the publish command will additionally look for
  a configured org (see below).
For the version field, the publish command will additionally look for a
  pyproject.toml file in the root of the artifact directory
Use --interactive to be walked through setting up each of the fields

The following TDP API configuration fields are required:
    org, api_url, auth_token, ignore_ssl
The publish command will sequentially check each of the following locations
  for each configuration:
    1. The respective command argument.
        Example: --org my-org --auth-token q1w2e3 --api-url https://api.tdp
        Note that ignore_ssl is set to true by the flag --ignore-ssl,
          and set to false with --enforce-ssl
    2. The yaml or json formatted configuration file
        provided in a command argument.
        Example: --config ./config.json
    3. In the process's environment variables.
        The fields are prefixed with "TS_" and in all uppercase.
        Example: export TS_ORG=my-org TS_API_URL=https://api.tdp
    4. The yaml or json formatted file at "~/.config/tetrascience/config"

Use --exclude to omit files and folders from being added published artifact.
These paths are relative to the current working directory, not the artifact
directory.
The following folders are automatically omitted from the root of the artifact
directory:
    __test__, .venv, __tests__, venv, .git

Use --include to re-include a file or folder that has been excluded.

positional arguments:
  source                path to folder to be uploaded

options:
  -h, --help            show this help message and exit
  --interactive, -i     interactively set up Artifact configuration
  --exclude EXCLUDE     folder or file to exclude
  --include INCLUDE     folder to include, overriding excluded folders
  --force, -f           force overwrite of an existing artifact
  --no-verify           skip artifact validation
  --dry-run             skip actual artifact publishing

Artifact Configuration:
  --type {connector,ids,protocol,task-script,tetraflow,lakehouse}
                        artifact type
  --namespace NAMESPACE
                        Artifact namespace configuration
  --slug SLUG           Artifact slug configuration
  --version VERSION     Artifact version configuration

API Configuration:
  --ignore-ssl, -k      ignore the SSL certificate verification
  --enforce-ssl, -e     do not ignore SSL certificate verification
  --profile PROFILE     The name of the configuration profile to use
  --org ORG             org slug
  --api-url API_URL     platform API URL
  --auth-token AUTH_TOKEN
                        authorization token
  --config CONFIG, -c CONFIG
                        yaml or json formatted file with an API configuration

ts-cli unpublish --help

usage: ts-cli unpublish [-h]
                        [--type {connector,ids,protocol,task-script,tetraflow,lakehouse}]
                        [--namespace NAMESPACE] [--slug SLUG]
                        [--version VERSION] [--interactive] [--no-verify]
                        [--dry-run] [--ignore-ssl | --enforce-ssl]
                        [--profile PROFILE] [--org ORG] [--api-url API_URL]
                        [--auth-token AUTH_TOKEN] [--config CONFIG]
                        [source]

Unpublish an artifact from the Tetra Data Platform. For example:

    ts-cli unpublish .

where "." is the path to the artifact souce code.
The source code positional argument defaults to the current working directory.

The following artifact configuration fields are required:
    type, namespace, slug, version
The unpublish command will sequentially check each of the following locations
  for each configuration:
    1. The respective command argument.
        Example: --type protocol
    2. A manifest.json file in the root of the artifact directory
    3. A protocol.{yaml,yml,json} file in the root of the artifact directory
    4. A schema.json file in the root of the artifact directory
    5. A pyproject.toml file in the root of the artifact directory
For the namespace field, the unpublish command will additionally look for
  a configured org (see below).
For the version field, the unpublish command will additionally look for a
  pyproject.toml file in the root of the artifact directory
Use --interactive to be walked through setting up each of the fields

The following TDP API configuration fields are required:
    org, api_url, auth_token, ignore_ssl
The unpublish command will sequentially check each of the following locations
  for each configuration:
    1. The respective command argument.
        Example: --org my-org --auth-token q1w2e3 --api-url https://api.tdp
        Note that ignore_ssl is set to true by the flag --ignore-ssl,
          and set to false with --enforce-ssl
    2. The yaml or json formatted configuration file
        provided in a command argument.
        Example: --config ./config.json
    3. In the process's environment variables.
        The fields are prefixed with "TS_" and in all uppercase.
        Example: export TS_ORG=my-org TS_API_URL=https://api.tdp
    4. The yaml or json formatted file at "~/.config/tetrascience/config"

positional arguments:
  source                path to folder to the artifact on your local machine

options:
  -h, --help            show this help message and exit
  --interactive, -i     interactively set up Artifact configuration
  --no-verify           skip unpublish validation
  --dry-run             skip actual artifact unpublish

Artifact Configuration:
  --type {connector,ids,protocol,task-script,tetraflow,lakehouse}
                        artifact type
  --namespace NAMESPACE
                        Artifact namespace configuration
  --slug SLUG           Artifact slug configuration
  --version VERSION     Artifact version configuration

API Configuration:
  --ignore-ssl, -k      ignore the SSL certificate verification
  --enforce-ssl, -e     do not ignore SSL certificate verification
  --profile PROFILE     The name of the configuration profile to use
  --org ORG             org slug
  --api-url API_URL     platform API URL
  --auth-token AUTH_TOKEN
                        authorization token
  --config CONFIG, -c CONFIG
                        yaml or json formatted file with an API configuration

ts-cli config --help

usage: ts-cli config [-h] {get,set,unset,save} ...

Get, update or delete options with this command.

options:
  -h, --help            show this help message and exit

actions:
  {get,set,unset,save}
    get                 Display a config value
    set                 Save a new config value
    unset               Remove a config value
    save                Save an entire config file

ts-cli config get --help

usage: ts-cli config get [-h] [--global | --profile PROFILE] {ignore-ssl,auth-token,format,profile,org,platform-version,api-url}

Retrieves the currently set configuration option

If there is no option set for the specified profile,
the get command will reach out into the global scope
to look for a configuration option.

positional arguments:
  {ignore-ssl,auth-token,format,profile,org,platform-version,api-url}
                        the config name

options:
  -h, --help            show this help message and exit

Config location:
  --global, -g          option applies to all profiles
  --profile PROFILE     option applies to a single profile

ts-cli config set --help

usage: ts-cli config set [-h] [--global | --profile PROFILE] [--string VALUE] [--true, -t] [--false, -f]
                         {profile,auth-token,format,org,platform-version,api-url,ignore-ssl} [value]

Saves a new configuration option at the specified key

    ts-cli config set profile development

Use the --global flag to make the option apply to all
profiles by default

Use the the `--false` or `--true` flags in place of
the `value` positional argument to pass a boolean
instead of a string. For example:

  ts-cli config set ignore-ssl --true

positional arguments:
  {profile,auth-token,format,org,platform-version,api-url,ignore-ssl}
                        the config name

options:
  -h, --help            show this help message and exit

Config location:
  --global, -g          option applies to all profiles
  --profile PROFILE     option applies to a single profile

Value:
  value                 the new config value as a string
  --string VALUE        the new config value as a string
  --true, -t            the new config value as the value true
  --false, -f           the new config value as the value false

ts-cli config unset --help

usage: ts-cli config unset [-h] [--global | --profile PROFILE] {org,platform-version,ignore-ssl,api-url,auth-token,profile,format}

Removes the currently set configuration option

If there is no option set for the specified profile,
the unset command will *not* unset the global scope,
and will instead exit unsuccessfully with a warning

positional arguments:
  {org,platform-version,ignore-ssl,api-url,auth-token,profile,format}
                        the config name

options:
  -h, --help            show this help message and exit

Config location:
  --global, -g          option applies to all profiles
  --profile PROFILE     option applies to a single profile

ts-cli config save --help

usage: ts-cli config save [-h] [--global | --profile PROFILE] file

Copies an entire configuration file
 Example: ts-cli config save ./config.json

positional arguments:
  file               yaml or json formatted file with an API configuration

options:
  -h, --help         show this help message and exit

Config location:
  --global, -g       option applies to all profiles
  --profile PROFILE  option applies to a single profile