Releases: reubenmiller/go-c8y-cli
Cumulocity CLI 2.43.1
What's Changed
- feat(software): add softwareType flag to software create/update/list commands by @reubenmiller in #400
- feat(general): increase default timeout from 60s to 600s by @reubenmiller in #406
- fix(c8y microservices create): stop execution on binary upload errors by @reubenmiller in #405
- docs: remove the wording Unofficial as the product is mature now by @reubenmiller in #404
Full Changelog: v2.43.0...v2.43.1
Cumulocity CLI 2.43.0
What's Changed
This is mostly a bug-fix release, however there were some aspects related to the bug fixes which warranted bumping the minor version (to align with semver).
Features
independent session banner setting #396
By default the set-session
will print the session information without obfuscation (don't worry it does not print the password or token!).
In v2.40.0, the default "logger.hideSensitive" value was changed which caused the session banner to also be obfuscated (which was intended), but this proved to be problematic as the user would not be able to see which session was selected.
The session banner printed after selecting a session via set-session
can still be hidden if required using the following (see PR for further options on controlling this value permanently):
# Hide the session banner
set-session --no-banner
ignore basic auth header if empty #397
Small feature which allows go-c8y-cli to be used directly on a thin-edge.io device by using the c8y proxy (provided by thin-edge.io). The basic auth header is only added if both the username and password are set.
For example, if you want to use the local c8y proxy provided by thin-edge.io, then you can now run:
export C8Y_HOST=http://localhost:8001/c8y
c8y software list
Fixes
- sessions: check if expiration date is nil before logging by @reubenmiller in #393
- sessions: fix handling of encrypted sessions by @reubenmiller in #395
- set-session: preserve encryption env variables and any C8Y_SETTINGS variables by @reubenmiller in #399
Full Changelog: v2.42.1...v2.43.0
Cumulocity CLI 2.42.1
What's Changed
Fixes
Addressing bugs introduced in v2.42.0 related to set-session
(and underlying calls to c8y sessions set
).
- fix(set-session): only write json output if user provides --output json by @reubenmiller in #390
- fix(session): fix handling of non-file based sessions by @reubenmiller in #391
Full Changelog: v2.42.0...v2.42.1
Cumulocity CLI 2.42.0
What's Changed
- docs: fix type in set sessions example by @reubenmiller in #384
- feat(sessions): add alias for sessions subcommand by @reubenmiller in #386
- feat(sessions): support custom session providers by @reubenmiller in #383
- feat(microservice): strip auto index suffixes from microservice filenames when parsing by @reubenmiller in #387
Full Changelog: v2.41.1...v2.42.0
Cumulocity CLI 2.41.1
What's Changed
- build: update deprecated goreleaser syntax by @reubenmiller in #377
- fix(notification2): avoid panic due to concurrent socket writes by @reubenmiller in #382 #381
Full Changelog: v2.41.0...v2.41.1
Cumulocity CLI 2.41.0
What's Changed
New commands
Cloud Remote Access commands - #368
Add support for creating remote access configurations and connecting to passthrough connections via a local proxy.
This means go-c8y-cli is capable of replacing c8ylp as it provides the proxy functionality with zero dependencies on python!
A new Remote Access page has been added to go through all of the details on how to use the feature.
Below are some quick examples of some of the things you can now do with go-c8y-cli. See the new examples page for the full details.
Example: Connect to device via ssh client
See the examples for more details, but below shows a sample
# Create the passthrough configuration
c8y remoteaccess configurations create-passthrough --device device01 --name native-ssh --port 22
# Connect to the device (the configuration will be automatically selected)
c8y remoteaccess connect ssh --device device01 --user root
# Connect to the device and referencing the configuration via name (if the automatic selection does not work for some reason)
c8y remoteaccess connect ssh --device device01 --configuration native-ssh --user root
Example: Connect to web server on a device and open the page in your browser
# Create the passthrough configuration
c8y remoteaccess configurations create-passthrough --device device01 --name local-webapp1 --port 8080
# Start a local proxy and open up the endpoint in your web browser
c8y remoteaccess server --device device01 --configuration local-webapp1 --browser
🙏 The remote access docs may be a bit rough around the edges, so if you notice any mistakes please feel free to create a PR to address them, or at least raise a ticket so I can fix them. I could of waited for further review, however I didn't want the docs delaying the launch of this great new feature!
New features
Table view uses human friendly number format for very small/large numbers - #373
By default, the table view users a new number formatting mode, called metric
, to help display very small or very large numbers in a more human readable format. This makes numbers (e.g. floats and integers) more readable, and it makes more efficient usage of the table column width.
In addition to the new number format mode, numbers are now aligned to the right of the column (rather than left). This should also make the numbers more readable (at least via western conventions).
Example
Given the input data set:
file: large-num.jsonl
{"value":0.000000000001,"storageSize":0.000000000001}
{"value":0.000000001,"storageSize":0.000000001}
{"value":0.000001,"storageSize":0.000001}
{"value":10,"storageSize":10}
{"value":110,"storageSize":110}
{"value":3000,"storageSize":3000}
{"value":10000,"storageSize":10000}
{"value":50000,"storageSize":50000}
{"value":9999999,"storageSize":9999999}
{"value":123456789,"storageSize":123456789}
{"value":1234567.501202,"storageSize":1234567.501202}
{"value":2038373478888889,"storageSize":2038373478888889}
{"value":203837347888,"storageSize":203837347888}
When using the metric number mode in the table view, the above numbers will be displayed as follows:
% cat large-num.jsonl | c8y util show --select value
| value |
|------------|
| 1 p |
| 1 n |
| 1 µ |
| 10 |
| 110 |
| 3000 |
| 10000 |
| 50000 |
| 9.99 M |
| 123.45 M |
| 1.23 M |
| 2.03 P |
| 203.83 G |
Controlling the number format
You can turn off the default metric
number format mode by using the following setting:
# Use old number mode (e.g. no number formatting)
c8y settings update views.numberFormat none
# Use metric number mode
c8y settings update views.numberFormat metric
The metric mode can be controlled by the following settings:
# Change number of decimal places to use
c8y settings update views.metric.precision 3
# Change min-max range
# When a number is inside the range, the metric prefix will not be added
c8y settings update views.metric.rangeMin 0.00000001
c8y settings update views.metric.rangeMax 1000000
Minor features
-
feat(set-session): ignore extensions folder when scanning for available sessions by @reubenmiller in #366
-
feat(outputTemplate): support outputTemplate flags for non-request based commands by @reubenmiller in #369
-
feat(views): print file path to the matching view when using --debug by @reubenmiller in #370
Fixes
- fix(outputTemplate): unescape string output by @reubenmiller in #371
- fix(data): show error when --data mixes data types by @reubenmiller in #372
Full Changelog: v2.40.0...v2.41.0
Cumulocity CLI 2.40.0
What's Changed
New commands
Manage UI plugins using c8y ui
- #354
Introducing support for management of Cumulocity IoT Plugins. Management of UI plugins is much easier now and can be easily integrated into CI/CD pipelines.
Checkout the examples page to get a quick overview of some common ui plugin management tasks.
Deploying new plugins versions is a simple as:
# From a file
c8y ui plugins create --file "myplugin.zip"
# From a URL
c8y ui plugins create --file "https://github.com/thin-edge/tedge-container-plugin/releases/download/1.2.3/tedge-container-plugin-ui_1.0.2.zip"
Then you can install the plugin the plugin within an existing UI application
c8y ui applications plugins install --application devicemanagement --plugin tedge-container-plugin-ui@latest
Or you can activate existing shared plugins provided by the parent tenant using:
c8y ui applications plugins install --application devicemanagement --plugin "Asset Overview Plugin"
New features
Support piping pretty printed json #345
Finally you don't need to pipe json as minimified (non pretty printed json), both minified or pretty printed json objects are accepted.
Previously the following command would fail as the input was assumed to be json lines, which then resulted in json parsing errors:
echo "{
\"id\": "1"
}" | c8y devices get --dry
But now the input will be parsed correctly as a single json object which spans multiple lines:
What If: Sending [GET] request to [https://example.cumulocity.com/inventory/managedObjects/1]
### GET /inventory/managedObjects/1
| header | value
|-------------------|---------------------------
| Accept | application/json
| Authorization | Bearer {token}
Hide sensitive info by default - #361
By default sensitive information will be obfuscated in the logging and in the dry run output. Previously this setting was disabled by default, however user feedback indicated that it would be better to include default settings which result in less accidental leakage of password when users are presenting something or sharing their screen.
By default the dry run output will look like the following:
% c8y devices list --dry
What If: Sending [GET] request to [https://example.cumulocity.com/inventory/managedObjects?q=%24filter%3D+%24orderby%3Dname]
### GET /inventory/managedObjects?q=$filter= $orderby=name
| header | value
|-------------------|---------------------------
| Accept | application/json
| Authorization | Bearer {token}
As before you can control the setting using:
c8y settings update logger.hideSensitive false
New client side filter operators: includes and notincludes
Arrays of strings, numbers and boolean values can be filtered by checking if the array includes or does not include a value.
array includes a value
c8y template execute --template "{items:['one','two']}" | c8y util show --filter "items includes two"
array does not include a value
c8y template execute --template "{items:['one','two']}" | c8y util show --filter "items notincludes other"
Minor features
-
set-session
: ignore existing token if it is not valid for a minimum duration in #363 -
c8y microservices create
: support updating roles property from a given microservice manifest file in #359 -
c8y application list
: add support fortenant
andhasVersions
filters in #355 -
c8y application list
: add support foravailability
filter -
extensions: support new
formDataFile
type to control setting a file in multiform/data uploads
Fixes
- extensions: correct link to extensions tutorial in #351
Full Changelog: v2.39.3...v2.40.0
Cumulocity CLI 2.39.3
What's Changed
- fix(retry): disable retries by default by @reubenmiller in #344
Full Changelog: v2.39.2...v2.39.3
Cumulocity CLI 2.39.2
What's Changed
Note: This does not contain any user facing features, but is just preliminary work in supporting a new way to package and apply the shell helpers via a new command c8y cli profile
.
- fix(cli profile): avoid exiting from set-session so current session does not exit the whole console session by @reubenmiller in #342
Full Changelog: v2.39.1...v2.39.2
Cumulocity CLI 2.39.1
What's Changed
Fixes
- handle special characters in select flag by @reubenmiller in #341
Full Changelog: v2.39.0...v2.39.1