<commit_before>== Quick Start Guide

This guide will show how to start Selenoid in a fastest way with help of Configuration Manager.
First, you need to download latest release binary from https://github.com/aerokube/cm/releases/latest[GitHub releases] for your platform (linux/darwin/windows).

To simplify this process you launch small script:

.On Linux and Mac OS
[source,bash]
----
curl -s aerokube.com/cm/bash | bash \
&& ./cm selenoid start --vnc
----

**On Windows** - just download the latest binary with your browser from https://github.com/aerokube/cm/releases/latest[releases page] for windows (386 and amd64 binaries available).
Then if you have https://en.wikipedia.org/wiki/PowerShell[Powershell] type:

[source,powershell]
----
> ./cm.exe selenoid start --vnc
----

[NOTE]
====
If you have https://docs.docker.com/engine/installation/[Docker] installed you can also use this one-liner:
[source,bash,subs="attributes+"]
# docker run --rm -v /var/run/docker.sock:/var/run/docker.sock  \
    -v ${HOME}:/root                                            \
    -e OVERRIDE_HOME=${HOME}                                    \
    aerokube/cm:latest-release selenoid start --vnc --tmpfs 128
====

[WARNING]
====
If you are working behind proxy you should set environment variables `HTTP_PROXY`, `HTTPS_PROXY` or `NO_PROXY`
described in https://docs.docker.com/engine/admin/systemd/#runtime-directory-and-storage-driver[Docker documentation]:
[source,bash,subs="attributes+"]
$ HTTP_PROXY=http://proxy.example.com:80/ ./cm selenoid start
+
When running `cm` in container - pass variable via `-e` flag of the `docker` command. These variables work because `cm` is using the same client as `docker` command.
====


== Configuring Selenoid
This section describes supported ways of automatic https://github.com/aerokube/selenoid[Selenoid] configuration.

[TIP]
====
To quickly configure and run Selenoid with defaults type:

[source,bash]
----
./cm selenoid start
----

====

Selenoid can be configured in two ways:

* Using https://docker.com/[Docker] containers.
* Using standalone binaries - when Docker is not installed.

Which mode to use is detected automatically by trying to access Docker API. To view the list of available commands:

[source,bash]
----
./cm selenoid --help
----

To launch command:

[source,bash]
----
./cm selenoid <command> [args...]
----

Supported commands are:

.Commands to configure and run Selenoid 
|===
| Command | Meaning

| args | Print Selenoid command line arguments
| cleanup | Removes Selenoid traces
| configure | Creates Selenoid configuration file (implies download)
| download | Downloads Selenoid binary or container image
| start | Starts Selenoid process or container (implies download and configure)
| status | Shows actual configuration status (whether Selenoid is downloaded, configured or running)
| stop | Stops Selenoid process or container
| update | Updates Selenoid and configuration to latest version
|===

To see supported flags for each command append `--help`:

[source,bash]
----
./cm selenoid start --help
----

=== Example Commands
* `download` command downloads latest or specified Selenoid release as standalone binary or container image:
+
[source,bash]
----
./cm selenoid download [--version 1.2.1] [--force]
----
+
This command does nothing when already downloaded. Use `--force` flag to download again.


* `configure` command in addition to downloading Selenoid also downloads container images or webdriver binaries and generates configuration file:
+
[source,bash]
----
./cm selenoid configure [--browsers firefox,opera] [--last-versions 2] [--tmpfs 128]
----
+    
Use `--browsers` to limit browsers to be configured, `--tmpfs` - to add https://en.wikipedia.org/wiki/Tmpfs[Tmpfs] support, `--last-versions` - to limit how many last browser versions to download. If you wish to download all available versions - specify `--last-versions 0`.


* `start` command configures Selenoid and starts it:
+
[source,bash]
----
./cm selenoid start
----
+    
By default Selenoid data is stored in `~/.aerokube/selenoid` but you can specify another
directory using `--config-dir` flag. To download images with VNC server (to see live browser screen) use `--vnc` flag:
+
[source,bash]
----
./cm selenoid start --vnc
----
+
To override Selenoid listen port add `--port` flag:
+
[source,bash]
----
./cm selenoid start --port 4445
----
+
To override Selenoid startup arguments sessions add `--args` flag:
+
[source,bash]
----
./cm selenoid start --args "-limit 10"
----
+
To download images from private registry - log in with `docker login` command and add `--registry` flag:
+
[source,bash]
----
docker login my-registry.example.com # Specify user name and password
./cm selenoid start --registry https://my-registry.example.com
----
+
An alternative to downloading `cm` manually is using Docker container:
+
[source,bash]
----
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${HOME}:/root -e OVERRIDE_HOME=${HOME} aerokube/cm:latest-release selenoid start
----
<commit_msg>Fixed one-liner command (related to aerokube/selenoid#431)<commit_after>== Quick Start Guide

This guide will show how to start Selenoid in a fastest way with help of Configuration Manager.
First, you need to download latest release binary from https://github.com/aerokube/cm/releases/latest[GitHub releases] for your platform (linux/darwin/windows).

To simplify this process you launch small script:

.On Linux and Mac OS
[source,bash]
----
curl -s https://aerokube.com/cm/bash | bash \
&& ./cm selenoid start --vnc
----

**On Windows** - just download the latest binary with your browser from https://github.com/aerokube/cm/releases/latest[releases page] for windows (386 and amd64 binaries available).
Then if you have https://en.wikipedia.org/wiki/PowerShell[Powershell] type:

[source,powershell]
----
> ./cm.exe selenoid start --vnc
----

[NOTE]
====
If you have https://docs.docker.com/engine/installation/[Docker] installed you can also use this one-liner:
[source,bash,subs="attributes+"]
# docker run --rm -v /var/run/docker.sock:/var/run/docker.sock  \
    -v ${HOME}:/root                                            \
    -e OVERRIDE_HOME=${HOME}                                    \
    aerokube/cm:latest-release selenoid start --vnc --tmpfs 128
====

[WARNING]
====
If you are working behind proxy you should set environment variables `HTTP_PROXY`, `HTTPS_PROXY` or `NO_PROXY`
described in https://docs.docker.com/engine/admin/systemd/#runtime-directory-and-storage-driver[Docker documentation]:
[source,bash,subs="attributes+"]
$ HTTP_PROXY=http://proxy.example.com:80/ ./cm selenoid start
+
When running `cm` in container - pass variable via `-e` flag of the `docker` command. These variables work because `cm` is using the same client as `docker` command.
====


== Configuring Selenoid
This section describes supported ways of automatic https://github.com/aerokube/selenoid[Selenoid] configuration.

[TIP]
====
To quickly configure and run Selenoid with defaults type:

[source,bash]
----
./cm selenoid start
----

====

Selenoid can be configured in two ways:

* Using https://docker.com/[Docker] containers.
* Using standalone binaries - when Docker is not installed.

Which mode to use is detected automatically by trying to access Docker API. To view the list of available commands:

[source,bash]
----
./cm selenoid --help
----

To launch command:

[source,bash]
----
./cm selenoid <command> [args...]
----

Supported commands are:

.Commands to configure and run Selenoid 
|===
| Command | Meaning

| args | Print Selenoid command line arguments
| cleanup | Removes Selenoid traces
| configure | Creates Selenoid configuration file (implies download)
| download | Downloads Selenoid binary or container image
| start | Starts Selenoid process or container (implies download and configure)
| status | Shows actual configuration status (whether Selenoid is downloaded, configured or running)
| stop | Stops Selenoid process or container
| update | Updates Selenoid and configuration to latest version
|===

To see supported flags for each command append `--help`:

[source,bash]
----
./cm selenoid start --help
----

=== Example Commands
* `download` command downloads latest or specified Selenoid release as standalone binary or container image:
+
[source,bash]
----
./cm selenoid download [--version 1.2.1] [--force]
----
+
This command does nothing when already downloaded. Use `--force` flag to download again.


* `configure` command in addition to downloading Selenoid also downloads container images or webdriver binaries and generates configuration file:
+
[source,bash]
----
./cm selenoid configure [--browsers firefox,opera] [--last-versions 2] [--tmpfs 128]
----
+    
Use `--browsers` to limit browsers to be configured, `--tmpfs` - to add https://en.wikipedia.org/wiki/Tmpfs[Tmpfs] support, `--last-versions` - to limit how many last browser versions to download. If you wish to download all available versions - specify `--last-versions 0`.


* `start` command configures Selenoid and starts it:
+
[source,bash]
----
./cm selenoid start
----
+    
By default Selenoid data is stored in `~/.aerokube/selenoid` but you can specify another
directory using `--config-dir` flag. To download images with VNC server (to see live browser screen) use `--vnc` flag:
+
[source,bash]
----
./cm selenoid start --vnc
----
+
To override Selenoid listen port add `--port` flag:
+
[source,bash]
----
./cm selenoid start --port 4445
----
+
To override Selenoid startup arguments sessions add `--args` flag:
+
[source,bash]
----
./cm selenoid start --args "-limit 10"
----
+
To download images from private registry - log in with `docker login` command and add `--registry` flag:
+
[source,bash]
----
docker login my-registry.example.com # Specify user name and password
./cm selenoid start --registry https://my-registry.example.com
----
+
An alternative to downloading `cm` manually is using Docker container:
+
[source,bash]
----
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${HOME}:/root -e OVERRIDE_HOME=${HOME} aerokube/cm:latest-release selenoid start
----

{'fraction_non_alphanumeric': 0.12846025022165303, 'fraction_numerical': 0.005024135553147473, 'mean_word_length': 3.5160142348754446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 19, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1332065', 'n_tokens_mistral': 3132, 'n_tokens_neox': 2880, 'n_words': 1119}