<commit_before># terrain cli

Python tools for the Terrain API

## Installation via GitHub

```
$ git clone https://github.com/jturcino/cyverse-sdk.git
$ git checkout terrain
```

## Setup
Usage of the cli requires a valid access token. The cli defaults to use of a cached token associated with the Agave API. If you do not have a cached Agave access token, tokens may be passed in manually via the -z flag. For more information about creating and caching Agave tokens, and the API generally, please see the repo [here](https://bitbucket.org/agaveapi/cli).

Once you have a valid access token readily available (cached or to be passed in at the command line), enable bash completion.
```
$ source terrain-completion.bash
```

## Usage
This cli is designed to allow you to go through all the steps of selecting an app and running a job through the TACC Discovery Environment without using the visual interface. We begin by finding an appropriate app via hierarchies or search, creating a job submission form based on that app's decription, and finallly submitting the job. Additionally, tools are available to list and delete previous jobs.
While walking through usage, I will use the example of counting words in a text file.

### Finding an app
If you are unsure of which app you would like to use, use `hierarchies-list` to find the general topic that interests you. Once found, use the iri of that topic and `apps-list-by-hierarchy` to list apps in that hierarchy.
```
$ ./terrain hierarchies list
{
    "hierarchies": [
        {
            "iri": "http://edamontology.org/topic_0003",
            "label": "Topic",
            "subclasses": [
    ...
}<commit_msg>changed "tacc discovery env" to "cyverse discovery env"<commit_after># terrain cli

Python tools for the Terrain API

## Installation via GitHub

```
$ git clone https://github.com/jturcino/cyverse-sdk.git
$ git checkout terrain
```

## Setup
Usage of the cli requires a valid access token. The cli defaults to use of a cached token associated with the Agave API. If you do not have a cached Agave access token, tokens may be passed in manually via the -z flag. For more information about creating and caching Agave tokens, and the API generally, please see the repo [here](https://bitbucket.org/agaveapi/cli).

Once you have a valid access token readily available (cached or to be passed in at the command line), enable bash completion.
```
$ source terrain-completion.bash
```

## Usage
This cli is designed to allow you to go through all the steps of selecting an app and running a job through the Cyverse Discovery Environment without using the visual interface. We begin by finding an appropriate app via hierarchies or search, creating a job submission form based on that app's decription, and finallly submitting the job. Additionally, tools are available to list and delete previous jobs.
While walking through usage, I will use the example of counting words in a text file.

### Finding an app
If you are unsure of which app you would like to use, use `hierarchies-list` to find the general topic that interests you. Once found, use the iri of that topic and `apps-list-by-hierarchy` to list apps in that hierarchy.
```
$ ./terrain hierarchies list
{
    "hierarchies": [
        {
            "iri": "http://edamontology.org/topic_0003",
            "label": "Topic",
            "subclasses": [
    ...
}
{'fraction_non_alphanumeric': 0.07090103397341212, 'fraction_numerical': 0.002363367799113737, 'mean_word_length': 3.7290502793296088, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1511430', 'n_tokens_mistral': 916, 'n_tokens_neox': 864, 'n_words': 483}