Installation
Prerequisites
- Python 3.9+
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 %%APP_DATA%% or $HOME 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.
- Bash
- Zsh
- Fish
mkdir -p ~/.local/share/bash-completion/completions
_CGC_COMPLETE=bash_source cgc > ~/.local/share/bash-completion/completions/cgc
mkdir -p ~/.local/share/zsh/completions/
_CGC_COMPLETE=zsh_source cgc > ~/.local/share/zsh/completions/_cgc
Now add the following to your ~/.zshrc file:
fpath=(~/.local/share/zsh/completions $fpath)
autoload -Uz compinit
compinit
mkdir -p ~/.config/fish/completions
env _CGC_COMPLETE=fish_source cgc > ~/.config/fish/completions/cgc.fish
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
User id: <user-id>
Access key: <access-key>
Register successful! You can now use the CLI. Config file saved in <path_to_config_file>