<commit_before># ServerGrove Control Panel Command Line Interface (CLI)

The utility allows interaction with the ServerGrove Control Panel through the command line. It also provides an interactive shell.

The following command line tools are provided:

* API client Command Line Interface
* Interactive Shell

The API client CLI allows to connect to the ServerGrove Control Panel through a HTTP API. To connect to the API you will
need to be a registered customer with access to the Control Panel and API, and you will need to enable API access in the
user profile.

## Installation:

Download [`sgcli.phar`](http:///sgcli.phar) executable and place it in a directory in your PATH.

Make sure sgcli.phar has executable permissions or use with php sgcli.phar

## Configuration:

By default, the API client will use our demo API secret/key combination. This only lets you runs some tests against the
server but it won't allow you to access your account and servers.

You will need to enable API access in your user profile in https://control.servergrove.com/profile

Once you have the API key and secret, add it to your environment variables:

	Example:
		$ export SG_API_KEY=yourkey
		$ export SG_API_SECRET=yoursecret


## Usage:

	./sgcli.phar client call [args]

* call: call composed of namespace and action (ie. server/list)
* args: (optional) list of variables to send to the call (ie. serverId=abc123&isActive=0)

## Example:<commit_msg>added phar<commit_after># ServerGrove Control Panel Command Line Interface (CLI)

The utility allows interaction with the ServerGrove Control Panel through the command line. It also provides an interactive shell.

The following command line tools are provided:

* API client Command Line Interface
* Interactive Shell

The API client CLI allows to connect to the ServerGrove Control Panel through a HTTP API. To connect to the API you will
need to be a registered customer with access to the Control Panel and API, and you will need to enable API access in the
user profile.

## Installation:

Download [`sgcli.phar`](https://github.com/servergrove/sgcli/raw/master/sgcli.phar) executable and place it in a directory in your PATH.

Make sure sgcli.phar has executable permissions or use with php sgcli.phar

## Configuration:

By default, the API client will use our demo API secret/key combination. This only lets you runs some tests against the
server but it won't allow you to access your account and servers.

You will need to enable API access in your user profile in https://control.servergrove.com/profile

Once you have the API key and secret, add it to your environment variables:

	Example:
		$ export SG_API_KEY=yourkey
		$ export SG_API_SECRET=yoursecret


## Usage:

	./sgcli.phar client call [args]

* call: call composed of namespace and action (ie. server/list)
* args: (optional) list of variables to send to the call (ie. serverId=abc123&isActive=0)

## Example:
{'fraction_non_alphanumeric': 0.056448853917208344, 'fraction_numerical': 0.0027369141293191925, 'mean_word_length': 4.445065176908752, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4342634', 'n_tokens_mistral': 815, 'n_tokens_neox': 766, 'n_words': 414}