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] [--platform-version PLATFORM_VERSION] [--profile PROFILE]
                   [--namespace NAMESPACE] [--slug SLUG] [--version VERSION] [--function FUNCTION] [--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] [--task-script-function TASK_SCRIPT_FUNCTION]
                   [--data-app-namespace DATA_APP_NAMESPACE] [--data-app-slug DATA_APP_SLUG] [--data-app-version DATA_APP_VERSION]
                   [--ids-namespace IDS_NAMESPACE] [--ids-slug IDS_SLUG] [--ids-version IDS_VERSION] [--template {default,react,spark,streamlit}]
                   [{data-app,ids,protocol,schema,task-script,tetraflow}] [target]

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

    ts-cli init protocol .

Syntax:
    ts-cli init <kind> <target>

The target directory defaults to the current working directory.

The kind configuration field is required.

Each template uses up to 3 of the following artifact configurations;
    protocol, task-script, ids, or data-app
  consisting of the following fields:
    namespace, slug, version
  Additionally, for the task-script artifact referenced by the protocol
    template, 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 version is found, the current TDP version
    v4.4 is assumed.

positional arguments:
  {data-app,ids,protocol,schema,task-script,tetraflow}
                        Artifact kind 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
  --platform-version PLATFORM_VERSION
                        The version of the platform
  --profile PROFILE     The name of the configuration profile to use
  --template {default,react,spark,streamlit}
                        Template to use

General Artifact Configuration:
  --namespace NAMESPACE
                        Artifact namespace configuration
  --slug SLUG           Artifact slug configuration
  --version VERSION     Artifact version configuration
  --function FUNCTION   Task Script function 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
  --task-script-function TASK_SCRIPT_FUNCTION
                        Task Script function configuration

Data App Configuration:
  --data-app-namespace DATA_APP_NAMESPACE
                        Data App namespace configuration
  --data-app-slug DATA_APP_SLUG
                        Data App slug configuration
  --data-app-version DATA_APP_VERSION
                        Data App 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,data-app,ids,protocol,schema,task-script,tetraflow}] [--namespace NAMESPACE] [--slug SLUG] [--version VERSION] [--interactive] [--exclude EXCLUDE] [--include INCLUDE] [--force] [--no-verify] [--dry-run] [--verbose] [--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
        (version field only)
    6. A package.json file in the root of the artifact directory
        (version field only)
For the namespace field, the publish command will additionally look for
  a configured org (see below).
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 to an artifact.
These patterns are relative to the artifact directory, not the current
working directory.
Exclude patterns will be added to the patterns already excluded in the
[manifest.json].exclude list.
The following patterns are automatically excluded:
    venv/*, .venv/*, node_modules/*, .git/*

Use --include to re-include files or folders that have been excluded.
Include patterns will be added to the patterns already included in the
[manifest.json].include list.

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
  --verbose, -v         Enable verbose output for debugging

Artifact Configuration:
  --type {connector,data-app,ids,protocol,schema,task-script,tetraflow}
                        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,data-app,ids,protocol,schema,task-script,tetraflow}] [--namespace NAMESPACE] [--slug SLUG]
                        [--version VERSION] [--interactive] [--no-verify] [--dry-run] [--verbose] [--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
        (version field only)
    6. A package.json file in the root of the artifact directory
        (version field only)
For the namespace field, the unpublish command will additionally look for
  a configured org (see below).
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
  --verbose, -v         Enable verbose output for debugging

Artifact Configuration:
  --type {connector,data-app,ids,protocol,schema,task-script,tetraflow}
                        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] [--config CONFIG] {platform-version,format,org,api-url,profile,auth-token,ignore-ssl}

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:
  {platform-version,format,org,api-url,profile,auth-token,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
  --config CONFIG, -c CONFIG
                        yaml or json formatted file with an API configuration

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