Cumulocity IoT Command Line Tool
Supported on
See the following installation instructions
See the documentation website for instructions on how to install and use it.
Fork the project, then clone it
git clone https://github.com/reubenmiller/go-c8y-cli.git
Optional: If you have existing .cumulocity sessions folder, then you can copy the files into the local directory so that they are available for use during development
cd go-c8y-cli
# bash/zsh
mkdir -p .cumulocity
cp -R ~/.cumulocity/ .cumulocity/
Open the project in Microsoft VS Code (using Dev Containers - this requires Docker!)
code go-c8y-cli
# When prompted, build and open the dev container
Run initial setup tasks so that you can run c8y inside the dev container
task init-setup
Add or edit a command specification (.yaml
file) in api/spec/yaml/
. The specifications are used to auto generate the go code
Run the code generation and build the go binary
task generate build-snapshot-single
# reload your shell
zsh
Try out the newly built binary (it should already be added to your)
Shell
c8y currentuser get
PowerShell
task generate build-powershell
pwsh
Import-Module ./tools/PSc8y/dist/PSc8y -Force
Get-CurrentUser
Update the auto generated cli docs (if you have changed something)
task docs
Launch the documentation preview
task gh-pages
View the documentation in the browser
Build the latest version and update auto generated tests
task build
task generate-cli-tests
Set the c8y session that you want to use for the tests
set-session
The examples included in the API specification can be validated by running the follow make task.
task test-cli
task test-powershell