<commit_before>---
title: Platform API CLI SDK
---

This CLI focuses mainly on exposing the following operations:

- **get** - Get a defined object by ID
- **list** - Get a list of all the Genesys Cloud objects of a particular type for an organization
- **create** - Create a Genesys Cloud object via data passed in via stdin or via file.
- **update** - Update a Genesys Cloud object via data passed in via stdin or via file.
- **delete** - Delete a Genesys Cloud object via data passed in via stdin or via file.

**Note:** Most operations exposed by the `list` command and some operations exposed by the `get` command support the `pageSize` parameter. It's important to set this to an appropriate value if a large number of resources are being listed to reduce the load on the API and reduce wait times.

# Installation

The [Developer Center](https://developer.mypurecloud.com/api/rest/command-line-interface/) contains installation instructions for supported operating systems.

# Setup and Configuration

All access to Genesys Cloud is provided via OAuth client credentials.  Security is enforced via the OAuth client credentials.

If you are using the CLI in a pipeline or don't wish to set up a config file, see [environment variables](#environment-variables) and [parameter overrides](#parameter-overrides).  

The "environment" value can be provided as the API base path such as `mypurecloud.com` or AWS region.

To setup and configure your gc CLI run `gc profiles new` command and answer the questions.  If everything works correctly you should have a file created in your home directory called .gc/config.toml.  If for some reason you have problems with the `gc profiles new` command, you can manually create the config file by following the steps below.

-  Create .gc directory in your home directory
-  Create a config.toml file in this directory.

```
[DEFAULT]
environment="mypurecloud.com" 
client_credentials="OAUTH CLIENT CREDENTIAL GRANT"
client_secret="OAUTH CLIENT SECRET"

[test_pro_1]
environment="mypurecloud.com"
client_credentials="OAUTH CLIENT CREDENTIAL GRANT"
client_secret="OAUTH CLIENT SECRET"

[test_pro_2]
environment="mypurecloud.com"
access_token="OAUTH ACCESS TOKEN"

```

**Note:** You can setup up multiple profiles.  The default profile is what will be used by the CLI by default.  You can use a different profile by passing in a `-p=profile_name` flag on the CLI.

## Environment variables

The following environment variables can be used as overrides or alternatives to their corresponding config file values

```
GENESYSCLOUD_REGION
GENESYSCLOUD_OAUTHCLIENT_ID
GENESYSCLOUD_OAUTHCLIENT_SECRET
GENESYSCLOUD_ACCESS_TOKEN
```

`GENESYSCLOUD_REGION` can refer to the API base path or AWS region

## Parameter overrides

The following flags can be used as overrides or alternatives to their corresponding config file values

```
--environment
--clientid
--clientsecret
--accesstoken
```

# Using the CLI<commit_msg>small change to README<commit_after>---
title: Platform API CLI SDK
---

This CLI focuses mainly on exposing the following operations:

- **get** - Get a defined object by ID
- **list** - Get a list of all the Genesys Cloud objects of a particular type for an organization
- **create** - Create a Genesys Cloud object via data passed in via stdin or via file.
- **update** - Update a Genesys Cloud object via data passed in via stdin or via file.
- **delete** - Delete a Genesys Cloud object via data passed in via stdin or via file.

**Note:** Most operations exposed by the `list` command and some operations exposed by the `get` command support the `pageSize` parameter. It's important to set this to an appropriate value if a large number of resources are being listed to reduce the load on the API and reduce wait times.

# Installation

The [Developer Center](https://developer.mypurecloud.com/api/rest/command-line-interface/) contains installation instructions for supported operating systems.

# Setup and Configuration

All access to Genesys Cloud is provided via OAuth client credentials.  Security is enforced via the OAuth client credentials.

If you are using the CLI in a pipeline or don't wish to set up a config file, see [environment variables](#environment-variables) and [parameter overrides](#parameter-overrides).  

The "environment" value can be provided as the API base path such as `mypurecloud.com` or AWS region.

To setup and configure your gc CLI run `gc profiles new` command and answer the questions.  If everything works correctly you should have a file created in your home directory called .gc/config.toml.  If for some reason you have problems with the `gc profiles new` command, you can manually create the config file by following the steps below.

-  Create .gc directory in your home directory
-  Create a config.toml file in this directory.

```
[DEFAULT]
environment="mypurecloud.com" 
client_credentials="OAUTH CLIENT CREDENTIAL GRANT"
client_secret="OAUTH CLIENT SECRET"

[test_pro_1]
environment="mypurecloud.com"
client_credentials="OAUTH CLIENT CREDENTIAL GRANT"
client_secret="OAUTH CLIENT SECRET"

[test_pro_2]
environment="mypurecloud.com"
access_token="OAUTH ACCESS TOKEN"
```

**Note:** You can setup up multiple profiles.  The default profile is what will be used by the CLI by default.  You can use a different profile by passing in a `-p=profile_name` flag on the CLI.

## Environment variables

The following environment variables can be used as overrides or alternatives to their corresponding config file values

```
GENESYSCLOUD_REGION
GENESYSCLOUD_OAUTHCLIENT_ID
GENESYSCLOUD_OAUTHCLIENT_SECRET
GENESYSCLOUD_ACCESS_TOKEN
```

`GENESYSCLOUD_REGION` can refer to the API base path or AWS region

## Parameter overrides

The following flags can be used as overrides or alternatives to their corresponding config file values

```
--environment
--clientid
--clientsecret
--accesstoken
```

# Using the CLI
{'fraction_non_alphanumeric': 0.06529093369418133, 'fraction_numerical': 0.0006765899864682003, 'mean_word_length': 4.702025072324012, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2265601', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1559, 'n_words': 792}