Metadata-Version: 2.3
Name: tetrascience-cli
Version: 1.3.3
Summary: Tetrascience CLI
License: Apache-2.0
Author: tetrascience
Requires-Python: >=3.9,<4
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: colorama (>=0.4.4,<1)
Requires-Dist: inquirer (>=3.1.4,<4.0.0)
Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
Requires-Dist: jsonschema (>=3.2.0)
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
Requires-Dist: requests (>=2.22.0,<3)
Requires-Dist: simplejson (>=3.17.6,<4)
Requires-Dist: toml (>=0.10.2,<0.11.0)
Requires-Dist: ts-ids-validator (>=0.10.4)
Project-URL: Homepage, https://developers.tetrascience.com
Description-Content-Type: text/markdown

# ts-cli <!-- omit in toc -->

Tetrascience CLI

## Version <!-- omit in toc -->

v1.3.3

## Table of Contents <!-- omit in toc -->
<details>
<summary>Show</summary>

- [Install](#install)
- [Usage](#usage)
  - [Create an artifact](#create-an-artifact)
  - [Publish an artifact](#publish-an-artifact)
    - [API Configuration](#api-configuration) 
    - [IDS Validation](#ids-validation)
- [Documentation](#documentation)
- [Changelog](#changelog)

</details>

## Intro

`ts-cli` allows you to interface with the Tetrascience Data Platform from the comfort of your shell

### Example

Create and publish a new task script:

```bash
ts-cli config save ~/Downloads/ts-cfg.json
ts-cli init task-script
ts-cli publish
```

## Install

```
pip install tetrascience-cli
```

## Usage

### Create an artifact

Using an IDS, Protocol, Task Script or "All-in-one" template

```bash
ts-cli init <template-type>
```

To set up the artifact's configuration interactively, use the `--interactive` or `-i` flag.

```bash
ts-cli init --interactive
```

### Publish an artifact

Including IDS, Protocol, and Task Script artifacts from their source code

```bash
ts-cli publish
```

The artifact's type, namespace, slug and version are automatically read from its `manifest.json`
file if it exists.  
To set up the artifact's configuration interactively, use the `--interative` or `-i` flag. Examples:

```bash
ts-cli publish --interactive
```

![An example of publishing an artifact using interactive mode](https://tetrascience.github.io/ts-cli/figures/interactive-mode-example.gif)

#### API Configuration

An API configuration is required.
This can be the API configuration JSON file (`cfg.json`) found on the Tetra Data Platform.

```json
{
	"api_url": "https://api.tetrascience.com/v1",
	"auth_token": "your-token",
	"org": "your-org",
	"ignore_ssl": false
}
```

This configuration can be referred to explicitly in the command line.
Example:

```bash
ts-cli publish --config cfg.json
```

Or saved to a specific profile.

```bash
ts-cli config save cfg.json --profile dev
ts-cli publish --profile dev
```

To apply the API configuration to all your projects automatically,
save your configuration file globally

```bash
ts-cli config save cfg.json --global
ts-cli publish
```

#### IDS Validation

When uploading IDS artifact, validation will be performed using `ts-ids-validator` package.
Validation failures for IDS will be printed to the console.

## Documentation

Click [here](https://tetrascience.github.io/ts-cli/) for `--help` and a development guide

## Changelog
<details>
<summary>Show</summary>

### v1.3.3 <!-- omit in toc -->

- update vulnerable dependencies
- update documentation

### v1.3.2 <!-- omit in toc -->

- fix output of monitored build when no args provided (build from the artifact directory)

### v1.3.1 <!-- omit in toc -->

- output {namespace, slug, version} when monitored build (via CodeBuild) completes

### v1.3.0 <!-- omit in toc -->

- Rename the `delete` command to `unpublish`
- Display the number of other artifacts that depend on artifact that is to be unpublished
  - Example: `warning: This protocol artifact is used by at least 1 pipeline`

### v1.2.0 <!-- omit in toc -->

- Allow publishing of connectors artifacts

### v1.1.0 <!-- omit in toc -->

- Adjust publish to support Codebuild build_id in response for all artifact types

### v1.0.5 <!-- omit in toc -->

- Fix incorrect messages to console when using `ts-cli init --interactive`

### v1.0.4 <!-- omit in toc -->

- Add a `delete` command
- Remove extra `<unset>` strings in task script configurations

### v1.0.3 <!-- omit in toc -->

- Rename the `nodeType` field to `category` in the tetraflow template
- Fix a crash on `ts-cli config {save,set}`
- Fix broken IDS schemas generated from non-existent manifest.json

### v1.0.2 <!-- omit in toc -->

- Adds the dry-run flag to the `publish` cli

### v1.0.1 <!-- omit in toc -->

- Fix a crash on startup

### v1.0.0 <!-- omit in toc -->

- Initial release
- Includes the `init`, `publish` and `config` commands

</details>

