Skip to main content

CGC CLI installation

How to install the CGC CLI (pip package cgcsdk), enable tab completion and register your account with cgc register.

Prerequisites​

  • Python 3.11+

Windows​

Install Python and add it to PATH.

Linux​

Install Python and add it to PATH.

Installing CGC via pip​

CGC CLI is available as a pip package.

pip install cgcsdk

PS D:\cgc-docs> pip install cgcsdk
Collecting cgcsdk
Downloading cgcsdk-0.1.1-py3-none-any.whl (31 kB)
...
Installing collected packages: cgcsdk
WARNING: The script cgc.exe is installed in 'C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed cgcsdk-0.1.1

Please be aware of the message at the end of the installation process.

WARNING: The script cgc.exe is installed in 'C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.

In that case, please follow instruction how to add location to your PATH

powershell example:

$env:Path += ';C:\Users\user\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts'

The package creates a directory named cgcsdk in your %APPDATA% (Windows) or $XDG_CONFIG_HOME / $HOME/.config dir. This directory will contain the config file after you complete the next step.

Tab Completion​

This part is optional, but it will make your life way easier, therefore we advise to do it.

mkdir -p ~/.local/share/bash-completion/completions
_CGC_COMPLETE=bash_source cgc > ~/.local/share/bash-completion/completions/cgc

Done! Restart your terminal and now you can use tab completion. To test it, just type cgc and press tab.

CGC Register​

In order to login to CGC CLI you need to use the data provided in the welcome e-mail. Type:

cgc register

Next you'll need to enter your user id and the access key

cgc register
Enter CGC server address: [https://cgc-api.comtegra.cloud:443]
Enter CGC secret: [<cgc-secret>]
User ID: <user-id>
Access key: <access-key>
Register successful! You can now use the CLI. Saved data to:<path_to_config_file>