go-c8y-cli
Unofficial Cumulocity IoT Command Line Tool
Supported on
- Linux (amd64, x86, armv5->7)
- MacOS (amd64)
- Windows (amd64, x86)
Installation
See the following installation instructions
Documentation
See the documentation website for instructions on how to install and use it.
Contributing
-
Fork the project, then clone it
git clone https://github.com/reubenmiller/go-c8y-cli.git
-
Open the project in Microsoft VS Code (using Dev Containers - this requires Docker!)
-
Run initial setup tasks so that you can run c8y inside the dev container
make init_setup
-
Add or edit a command specification (
.yaml
file) inapi/spec/yaml/
. The specifications are used to auto generate the go code -
Run the code generation and build the go binary
make build
-
Try out the newly built binary (it should already be added to your)
Shell
c8y currentuser get
PowerShell
Import-Module ./tools/PSc8y/dist/PSc8y -Force Get-CurrentUser
Building the documentation
-
Update the auto generated cli docs (if you have changed something)
make docs
-
Launch the documentation preview
make gh_pages
-
View the documentation in the browser
Tests
Pre-requisites
-
Build the latest version and update auto generated tests
make build make generate_cli_tests
-
Set the c8y session that you want to use for the tests
set-session
Run test on example code
The examples included in the API specification can be validated by running the follow make task.
make test_cli
Run all tests
make TEST_THROTTLE_LIMIT=1 test_powershell
Running a test on a single
make TEST_FILE_FILTER=ClientRequest test_powershell