<commit_before>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/cloudslang).
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.

#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
To run a flow or operation located at `c:/.../your_flow.sl`, use the `--f` flag to specify the location of the flow to be run:
```bash
cslang>run --f c:/.../your_flow.sl
```

##Run with Inputs
If the flow or operation takes in input parameters, use the `--i` flag and a comma-separated list of key=value pairs:
```bash
cslang>run --f c:/.../your_flow.sl --i input1=root,input2=25
```
Commas (`,`) can be used as part of input values by escaping them with a backslash (`\`).

```bash
cslang>run --f c:/.../your_flow.sl --i list=1\,2\,3
```

To use inputs that include spaces, enclose the entire input list in quotes (`"`):
```bash
cslang>run --f c:/.../your_flow.sl --i "input1=Hello World, input2=x"
```

Double quotes (`"`) can be used as part of quoted input values by escaping them with a backslash (`\`). When using a quoted input list, spaces between input parameters will be trimmed.

To pass the value **"Hello" World** to a flow:
```bash
cslang>run --f c:/.../your_flow.sl --i "input1=\"Hello\" World"
```

Alternatively, inputs made be loaded from a file. Input files are written in flat [YAML](http://www.yaml.org), containing a map of names to values. Input files end with the **.yaml**  or **.yml** extensions. If multiple input files are being used and they contain an input with the same name, the input in the file that is loaded last will overwrite the others with the same name. 

**Example - inputs file**

```yaml
input: hello
input_list:
  - one
  - two
  - three
input_map:
  one: a
  two: b
  three: c
``` 

Input files that contain `inputs` in their name can be loaded automatically if placed in a folder named `inputs` in the directory from which the CLI is run. If the flow requires an input file that is not loaded automatically, use the `--if` flag and a comma-separated list of file paths. Inputs passed with the `--i` flag will override the inputs passed using a file. 

```bash
cslang>run --f c:/.../your_flow.sl --if c:/.../inputs.yaml --i input1=value1
```

##Run with Dependencies 
Dependencies from the content folder packaged with the CLI are added to the classpath by default. If the flow requires dependencies from another location, use the `--cp` flag with a comma-separated list of dependency paths. Note that explicitly declaring a classpath using `--cp` overrides the default classpath, and therefore if there also is a dependency in the content folder, the folder must be added to the classpath explicitly.

```bash
cslang>run --f c:/.../your_flow.sl --i input1=root,input2=25 --cp c:/.../yaml
```

##Run with System Properties

System properties files are written in flat [YAML](http://www.yaml.org), containing a map of names to values. System property files end with the .yaml  or .yml extensions. If multiple system properties files are being used and they contain a system property with the same fully qualified name, the property in the file that is loaded last will overwrite the others with the same name. 

**Example - system properties file**

```yaml
examples.properties.text: hello
examples.properties.list:
  - one
  - two
  - three
examples.properties.map:
  one: a
  two: b
  three: c
``` 

System property files can be loaded automatically if placed in a folder named `properties` in the directory from which the CLI is run. If the flow or operation requires a system properties file that is not loaded automatically, use the `--spf` flag and a comma-separated list of file paths. 

```bash
cslang>run --f c:/.../your_flow.sl --spf c:/.../yaml
```

##Run in Quiet Mode
Normally a flow's task names are printed to the screen as they are run. To disable the task names from being printed, use the `--q` flag.

```bash
cslang>run --f c:/.../your_flow.sl --q
```

##Run in Non-Interactive Mode
A flow can be run without first starting up the CLI using the non-interactive mode. 

From a shell prompt:
```bash
cslang>run --f c:/.../your_flow.sl
```

##Other Commands
Some of the available commands are:

+ `env --setAsync` - Sets the execution mode to be synchronous (`false`) or asynchronous (`true`). By default the execution mode is synchronous, meaning only one flow can run at a time. 

```bash
cslang>env --setAsync true
```

+ `inputs` - Lists the inputs of a given flow.

```bash
cslang>inputs --f c:/.../your_flow.sl
```

+ `cslang --version` - Displays the version of **score** being used.

```bash
cslang>cslang --version
```

##Execution Log
The execution log is saved in the directory in which the CLI was started in a file named `execution.log`. The log file stores all the [events](developer_cloudslang#slang-events) that have been fired, and therefore it allows for tracking a flow's execution.

##Help
To get a list of available commands, enter `help` at the CLI `cslang>` prompt. For further help, enter `help` and the name of the command.<commit_msg>changed log location<commit_after>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/cloudslang).
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.

#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
To run a flow or operation located at `c:/.../your_flow.sl`, use the `--f` flag to specify the location of the flow to be run:
```bash
cslang>run --f c:/.../your_flow.sl
```

##Run with Inputs
If the flow or operation takes in input parameters, use the `--i` flag and a comma-separated list of key=value pairs:
```bash
cslang>run --f c:/.../your_flow.sl --i input1=root,input2=25
```
Commas (`,`) can be used as part of input values by escaping them with a backslash (`\`).

```bash
cslang>run --f c:/.../your_flow.sl --i list=1\,2\,3
```

To use inputs that include spaces, enclose the entire input list in quotes (`"`):
```bash
cslang>run --f c:/.../your_flow.sl --i "input1=Hello World, input2=x"
```

Double quotes (`"`) can be used as part of quoted input values by escaping them with a backslash (`\`). When using a quoted input list, spaces between input parameters will be trimmed.

To pass the value **"Hello" World** to a flow:
```bash
cslang>run --f c:/.../your_flow.sl --i "input1=\"Hello\" World"
```

Alternatively, inputs made be loaded from a file. Input files are written in flat [YAML](http://www.yaml.org), containing a map of names to values. Input files end with the **.yaml**  or **.yml** extensions. If multiple input files are being used and they contain an input with the same name, the input in the file that is loaded last will overwrite the others with the same name. 

**Example - inputs file**

```yaml
input: hello
input_list:
  - one
  - two
  - three
input_map:
  one: a
  two: b
  three: c
``` 

Input files that contain `inputs` in their name can be loaded automatically if placed in a folder named `inputs` in the directory from which the CLI is run. If the flow requires an input file that is not loaded automatically, use the `--if` flag and a comma-separated list of file paths. Inputs passed with the `--i` flag will override the inputs passed using a file. 

```bash
cslang>run --f c:/.../your_flow.sl --if c:/.../inputs.yaml --i input1=value1
```

##Run with Dependencies 
Dependencies from the content folder packaged with the CLI are added to the classpath by default. If the flow requires dependencies from another location, use the `--cp` flag with a comma-separated list of dependency paths. Note that explicitly declaring a classpath using `--cp` overrides the default classpath, and therefore if there also is a dependency in the content folder, the folder must be added to the classpath explicitly.

```bash
cslang>run --f c:/.../your_flow.sl --i input1=root,input2=25 --cp c:/.../yaml
```

##Run with System Properties

System properties files are written in flat [YAML](http://www.yaml.org), containing a map of names to values. System property files end with the .yaml  or .yml extensions. If multiple system properties files are being used and they contain a system property with the same fully qualified name, the property in the file that is loaded last will overwrite the others with the same name. 

**Example - system properties file**

```yaml
examples.properties.text: hello
examples.properties.list:
  - one
  - two
  - three
examples.properties.map:
  one: a
  two: b
  three: c
``` 

System property files can be loaded automatically if placed in a folder named `properties` in the directory from which the CLI is run. If the flow or operation requires a system properties file that is not loaded automatically, use the `--spf` flag and a comma-separated list of file paths. 

```bash
cslang>run --f c:/.../your_flow.sl --spf c:/.../yaml
```

##Run in Quiet Mode
Normally a flow's task names are printed to the screen as they are run. To disable the task names from being printed, use the `--q` flag.

```bash
cslang>run --f c:/.../your_flow.sl --q
```

##Run in Non-Interactive Mode
A flow can be run without first starting up the CLI using the non-interactive mode. 

From a shell prompt:
```bash
cslang>run --f c:/.../your_flow.sl
```

##Other Commands
Some of the available commands are:

+ `env --setAsync` - Sets the execution mode to be synchronous (`false`) or asynchronous (`true`). By default the execution mode is synchronous, meaning only one flow can run at a time. 

```bash
cslang>env --setAsync true
```

+ `inputs` - Lists the inputs of a given flow.

```bash
cslang>inputs --f c:/.../your_flow.sl
```

+ `cslang --version` - Displays the version of **score** being used.

```bash
cslang>cslang --version
```

##Execution Log
The execution log is saved in the directory in which the CLI was started at `logs/execution.log`. The log file stores all the [events](developer_cloudslang#slang-events) that have been fired, and therefore it allows for tracking a flow's execution.

##Help
To get a list of available commands, enter `help` at the CLI `cslang>` prompt. For further help, enter `help` and the name of the command.
{'fraction_non_alphanumeric': 0.10230641312992553, 'fraction_numerical': 0.004771889234328682, 'mean_word_length': 3.6935866983372923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '3476861', 'n_tokens_mistral': 4245, 'n_tokens_neox': 3936, 'n_words': 2032}