<commit_before>CLI
+++

There are several ways to get started with the CloudSlang CLI.

Download and Run Pre-built CLI
==============================

**Prerequisites :** To run the CloudSlang CLI, Java JRE version 7 or
higher is required.

1. `Download <http://cloudslang.io/download>`__ the CLI zip file.
2. Locate the downloaded file and unzip the archive.
   The decompressed file contains:

   -  A folder named **cslang** with the CLI tool and its necessary
      dependencies.
   -  A folder named **content** with ready-made CloudSlang flows and
      operations.
   -  A folder named **python-lib**.

3. Navigate to the folder ``cslang-cli\cslang\cslang\bin\``.
4. Run the executable:

   -  For Windows : ``cslang.bat``.
   -  For Linux : ``bash cslang``.

Download, Build and Run CLI
===========================

**Prerequisites :** To build the CloudSlang CLI, Java JDK version 7 or
higher and Maven version 3.0.3 or higher are required.

1. Git clone (or GitHub fork and then clone) the `source
   code <https://github.com/cloudslang/cloud-slang>`__.
2. Using the Command Prompt, navigate to the project root directory.
3. Build the project by running ``mvn clean install``.
4. After the build finishes, navigate to the
   ``cloudslang-cli\target\cloudslang\bin`` folder.
5. Run the executable:

   -  For Windows : ``cslang.bat``.
   -  For Linux : ``bash cslang``.

Download and Install npm Package
================================

**Prerequisites :** To download the package, Node.js is required. To run
the CloudSlang CLI, Java JRE version 7 or higher is required.

1. At a command prompt, enter ``npm install -g cslang-cli``.

   -  If using Linux, the sudo command might be neccessary:
      ``sudo npm install -g cslang-cli``.

2. Enter the ``cslang`` command at any command prompt.

Docker Image
============

- Pull the image: ``docker pull cloudslang/cloudslang``.
- Run the CLI

   - With prompt: ``docker run -it cloudslang/cloudslang``.
   - Without prompt: ``docker run --rm -ti cloudslang run --f ../content/io/cloudslang/.../flow.sl --i input1=value1``

.. _use_the_cli:

Use the CLI
===========

When a flow is run, the entire directory in which the flow resides is
scanned recursively (including all subfolders) for files with a valid
CloudSlang extension. All of the files found are compiled by the CLI. If
the ``--cp`` flag is used, all of the directories listed there will be
scanned and compiled recursively as well.

The usage of forward slashes (``/``) in all file paths is recommended
even on Windows.

Run a Flow or Operation<commit_msg>updated links to latest versions of files<commit_after>CLI
+++

There are several ways to get started with the CloudSlang CLI.

Download and Run Pre-built CLI
==============================

**Prerequisites :** To run the CloudSlang CLI, Java JRE version 7 or
higher is required.

1. `Download <http://cloudslang.io/download>`__ the CLI zip file.
2. Locate the downloaded file and unzip the archive.
   The decompressed file contains:

   -  A folder named **cslang** with the CLI tool and its necessary
      dependencies.
   -  A folder named **content** with ready-made CloudSlang flows and
      operations.
   -  A folder named **python-lib**.

3. Navigate to the folder ``cslang\bin\``.
4. Run the executable:

   -  For Windows : ``cslang.bat``.
   -  For Linux : ``bash cslang``.

Download, Build and Run CLI
===========================

**Prerequisites :** To build the CloudSlang CLI, Java JDK version 7 or
higher and Maven version 3.0.3 or higher are required.

1. Git clone (or GitHub fork and then clone) the `source
   code <https://github.com/cloudslang/cloud-slang>`__.
2. Using the Command Prompt, navigate to the project root directory.
3. Build the project by running ``mvn clean install``.
4. After the build finishes, navigate to the
   ``cloudslang-cli\target\cloudslang\bin`` folder.
5. Run the executable:

   -  For Windows : ``cslang.bat``.
   -  For Linux : ``bash cslang``.

Download and Install npm Package
================================

**Prerequisites :** To download the package, Node.js is required. To run
the CloudSlang CLI, Java JRE version 7 or higher is required.

1. At a command prompt, enter ``npm install -g cloudslang-cli``.

   -  If using Linux, the sudo command might be neccessary:
      ``sudo npm install -g cloudslang-cli``.

2. Enter the ``cslang`` command at any command prompt.

Docker Image
============

- Pull the image: ``docker pull cloudslang/cloudslang``.
- Run the CLI

   - With prompt: ``docker run -it cloudslang/cloudslang``.
   - Without prompt: ``docker run --rm -ti cloudslang run --f ../content/io/cloudslang/.../flow.sl --i input1=value1``

.. _use_the_cli:

Use the CLI
===========

When a flow is run, the entire directory in which the flow resides is
scanned recursively (including all subfolders) for files with a valid
CloudSlang extension. All of the files found are compiled by the CLI. If
the ``--cp`` flag is used, all of the directories listed there will be
scanned and compiled recursively as well.

The usage of forward slashes (``/``) in all file paths is recommended
even on Windows.

Run a Flow or Operation
{'fraction_non_alphanumeric': 0.13592420726991492, 'fraction_numerical': 0.007347254447022429, 'mean_word_length': 3.57787610619469, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4580997', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1496, 'n_words': 685}