-
Notifications
You must be signed in to change notification settings - Fork 0
[DX-974] Fix commands params validation, --help documentation and json logging #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sacOO7
wants to merge
3
commits into
main
Choose a base branch
from
fix/cli-command-helpers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -868,7 +868,7 @@ FLAGS | |
| --json Output in JSON format | ||
| --pretty-json Output in colorized JSON format | ||
| --token-only Output only the token string without any formatting or additional information | ||
| --ttl=<value> [default: 3600] Time to live in seconds (default: 3600, 1 hour) | ||
| --ttl=<value> [default: 3600] Time to live in seconds | ||
|
|
||
| DESCRIPTION | ||
| Create an Ably Token with capabilities | ||
|
|
@@ -913,7 +913,7 @@ FLAGS | |
| --json Output in JSON format | ||
| --pretty-json Output in colorized JSON format | ||
| --token-only Output only the token string without any formatting or additional information | ||
| --ttl=<value> [default: 3600] Time to live in seconds (default: 3600, 1 hour) | ||
| --ttl=<value> [default: 3600] Time to live in seconds | ||
|
|
||
| DESCRIPTION | ||
| Create an Ably JWT token with capabilities | ||
|
|
@@ -1404,11 +1404,15 @@ DESCRIPTION | |
| Manage annotations on Ably Pub/Sub channel messages | ||
|
|
||
| EXAMPLES | ||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:flag.v1" --name thumbsup | ||
| $ ably channels annotations publish my-channel "01234567890:0" "metrics:total.v1" | ||
|
|
||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:unique.v1" --name thumbsup | ||
|
|
||
| $ ably channels annotations subscribe my-channel | ||
|
|
||
| $ ably channels annotations get my-channel "01234567890:0" | ||
|
|
||
| $ ably channels annotations delete my-channel "01234567890:0" "receipts:flag.v1" | ||
| ``` | ||
|
|
||
| _See code: [src/commands/channels/annotations/index.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/annotations/index.ts)_ | ||
|
|
@@ -1439,13 +1443,15 @@ DESCRIPTION | |
| Delete an annotation from a channel message | ||
|
|
||
| EXAMPLES | ||
| $ ably channels annotations delete my-channel "01234567890:0" "reactions:flag.v1" --name thumbsup | ||
| $ ably channels annotations delete my-channel "01234567890:0" "receipts:flag.v1" | ||
|
|
||
| $ ably channels annotations delete my-channel "01234567890:0" "categories:distinct.v1" --name important | ||
|
|
||
| $ ably channels annotations delete my-channel "01234567890:0" "reactions:multiple.v1" --name thumbsup | ||
| $ ably channels annotations delete my-channel "01234567890:0" "reactions:unique.v1" --name thumbsup | ||
|
|
||
| $ ably channels annotations delete my-channel "01234567890:0" "reactions:flag.v1" --json | ||
| $ ably channels annotations delete my-channel "01234567890:0" "rating:multiple.v1" --name stars | ||
|
|
||
| $ ably channels annotations delete my-channel "01234567890:0" "reactions:flag.v1" --pretty-json | ||
| $ ably channels annotations delete my-channel "01234567890:0" "receipts:flag.v1" --json | ||
| ``` | ||
|
|
||
| _See code: [src/commands/channels/annotations/delete.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/annotations/delete.ts)_ | ||
|
|
@@ -1512,15 +1518,17 @@ DESCRIPTION | |
| Publish an annotation on a channel message | ||
|
|
||
| EXAMPLES | ||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:flag.v1" --name thumbsup | ||
| $ ably channels annotations publish my-channel "01234567890:0" "metrics:total.v1" | ||
|
|
||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:multiple.v1" --name thumbsup --count 3 | ||
| $ ably channels annotations publish my-channel "01234567890:0" "receipts:flag.v1" | ||
|
|
||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:flag.v1" --data '{"key":"value"}' | ||
| $ ably channels annotations publish my-channel "01234567890:0" "categories:distinct.v1" --name important | ||
|
|
||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:flag.v1" --json | ||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:unique.v1" --name thumbsup | ||
|
|
||
| $ ably channels annotations publish my-channel "01234567890:0" "reactions:flag.v1" --pretty-json | ||
| $ ably channels annotations publish my-channel "01234567890:0" "rating:multiple.v1" --name stars --count 4 | ||
|
|
||
| $ ably channels annotations publish my-channel "01234567890:0" "metrics:total.v1" --json | ||
| ``` | ||
|
|
||
| _See code: [src/commands/channels/annotations/publish.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/annotations/publish.ts)_ | ||
|
|
@@ -1555,11 +1563,11 @@ EXAMPLES | |
|
|
||
| $ ably channels annotations subscribe my-channel --type "reactions:flag.v1" | ||
|
|
||
| $ ably channels annotations subscribe my-channel --json | ||
|
|
||
| $ ably channels annotations subscribe my-channel --pretty-json | ||
| $ ably channels annotations subscribe my-channel --type "metrics:total.v1" | ||
|
|
||
| $ ably channels annotations subscribe my-channel --duration 30 | ||
|
|
||
| $ ably channels annotations subscribe my-channel --json | ||
| ``` | ||
|
|
||
| _See code: [src/commands/channels/annotations/subscribe.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/annotations/subscribe.ts)_ | ||
|
|
@@ -1701,8 +1709,8 @@ ARGUMENTS | |
|
|
||
| FLAGS | ||
| -v, --verbose Output verbose logs | ||
| --cipher=<value> Decryption key for encrypted messages (AES-128) | ||
| --direction=<option> [default: backwards] Direction of message retrieval (default: backwards) | ||
| --cipher=<value> Decryption key for encrypted messages, uses AES-256 by default | ||
| --direction=<option> [default: backwards] Direction of message retrieval | ||
| <options: backwards|forwards> | ||
| --end=<value> End time as ISO 8601, Unix ms, or relative (e.g., "1h", "30m", "2d") | ||
| --json Output in JSON format | ||
|
|
@@ -1726,7 +1734,7 @@ EXAMPLES | |
|
|
||
| $ ably channels history my-channel --limit 100 | ||
|
|
||
| $ ably channels history my-channel --direction forward | ||
| $ ably channels history my-channel --direction forwards | ||
| ``` | ||
|
|
||
| _See code: [src/commands/channels/history.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/channels/history.ts)_ | ||
|
|
@@ -2037,6 +2045,8 @@ EXAMPLES | |
|
|
||
| $ ably channels presence update my-channel --data '{"status":"busy"}' --json | ||
|
|
||
| $ ably channels presence update my-channel --data '{"status":"busy"}' --pretty-json | ||
|
|
||
| $ ably channels presence update my-channel --data '{"status":"online"}' --duration 60 | ||
| ``` | ||
|
|
||
|
|
@@ -2056,8 +2066,8 @@ ARGUMENTS | |
| MESSAGE The message to publish (JSON format or plain text) | ||
|
|
||
| FLAGS | ||
| -c, --count=<value> [default: 1] Number of messages to publish (default: 1) | ||
| -d, --delay=<value> [default: 40] Delay between messages in milliseconds (default: 40ms, max 25 msgs/sec) | ||
| -c, --count=<value> [default: 1] Number of messages to publish | ||
| -d, --delay=<value> [default: 40] Delay between messages in milliseconds (max 25 msgs/sec) | ||
| -e, --encoding=<value> The encoding for the message | ||
| -n, --name=<value> The event name (if not specified in the message JSON) | ||
| -v, --verbose Output verbose logs | ||
|
|
@@ -2113,13 +2123,13 @@ ARGUMENTS | |
| FLAGS | ||
| -D, --duration=<value> Automatically exit after N seconds | ||
| -v, --verbose Output verbose logs | ||
| --cipher-algorithm=<value> [default: aes] Encryption algorithm to use (default: aes) | ||
| --cipher-key=<value> Encryption key for decrypting messages (hex-encoded) | ||
| --cipher-key-length=<value> [default: 256] Length of encryption key in bits (default: 256) | ||
| --cipher-mode=<value> [default: cbc] Cipher mode to use (default: cbc) | ||
| --cipher-algorithm=<value> [default: aes] Encryption algorithm to use | ||
| --cipher-key=<value> Encryption key for decrypting messages (base64-encoded or hex-encoded) | ||
| --cipher-key-length=<value> [default: 256] Length of encryption key in bits | ||
| --cipher-mode=<value> [default: cbc] Cipher mode to use | ||
| --client-id=<value> Overrides any default client ID when using API authentication. Use "none" to | ||
| explicitly set no client ID. Not applicable when using token authentication. | ||
| --delta Enable delta compression for messages | ||
| --delta Enable delta compression (VCDIFF) to reduce message payload sizes | ||
| --json Output in JSON format | ||
| --pretty-json Output in colorized JSON format | ||
| --rewind=<value> Number of messages to rewind when subscribing (default: 0) | ||
|
|
@@ -2393,13 +2403,13 @@ FLAGS | |
| --channel-filter=<value> Channel filter pattern | ||
| --json Output in JSON format | ||
| --pretty-json Output in colorized JSON format | ||
| --request-mode=<option> [default: single] Request mode for the integration (default: single) | ||
| --request-mode=<option> [default: single] Request mode for the integration | ||
| <options: single|batch> | ||
| --rule-type=<option> (required) Type of integration (http, amqp, etc.) | ||
| <options: http|amqp|kinesis|firehose|pulsar|kafka|azure|azure-functions|mqtt|cloudmqtt> | ||
| --source-type=<option> (required) The event source type | ||
| <options: channel.message|channel.presence|channel.lifecycle|presence.message> | ||
| --status=<option> [default: enabled] Initial status of the integration (default: enabled) | ||
| --status=<option> [default: enabled] Initial status of the integration | ||
| <options: enabled|disabled> | ||
| --target-url=<value> Target URL for HTTP integrations | ||
|
|
||
|
|
@@ -3589,19 +3599,19 @@ FLAGS | |
| -v, --verbose Output verbose logs | ||
| --app=<value> The app ID or name (defaults to current app) | ||
| --json Output in JSON format | ||
| --max-length=<value> [default: 10000] Maximum number of messages in the queue (default: 10000) | ||
| --max-length=<value> [default: 10000] Maximum number of messages in the queue (max: 10000) | ||
| --name=<value> (required) Name of the queue | ||
| --pretty-json Output in colorized JSON format | ||
| --region=<value> [default: us-east-1-a] Region for the queue (default: us-east-1-a) | ||
| --ttl=<value> [default: 60] Time to live for messages in seconds (default: 60) | ||
| --region=<value> [default: us-east-1-a] Region for the queue (e.g., us-east-1-a, eu-west-1-a) | ||
| --ttl=<value> [default: 60] Time to live for messages in seconds (max: 3600) | ||
|
|
||
| DESCRIPTION | ||
| Create a queue | ||
|
|
||
| EXAMPLES | ||
| $ ably queues create --name "my-queue" | ||
|
|
||
| $ ably queues create --name "my-queue" --ttl 3600 --max-length 100000 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are showing |
||
| $ ably queues create --name "my-queue" --ttl 300 --max-length 5000 | ||
|
|
||
| $ ably queues create --name "my-queue" --region "eu-west-1-a" --app "My App" | ||
|
|
||
|
|
@@ -3807,7 +3817,7 @@ FLAGS | |
| -v, --verbose Output verbose logs | ||
| --end=<value> End time as ISO 8601, Unix ms, or relative (e.g., "1h", "30m", "2d") | ||
| --json Output in JSON format | ||
| --order=<option> [default: newestFirst] Query direction: oldestFirst or newestFirst (default: newestFirst) | ||
| --order=<option> [default: newestFirst] Order of results: oldestFirst or newestFirst | ||
| <options: oldestFirst|newestFirst> | ||
| --pretty-json Output in colorized JSON format | ||
| --show-metadata Display message metadata if available | ||
|
|
@@ -3988,8 +3998,8 @@ ARGUMENTS | |
| TEXT The message text to send | ||
|
|
||
| FLAGS | ||
| -c, --count=<value> [default: 1] Number of messages to send (default: 1) | ||
| -d, --delay=<value> [default: 40] Delay between messages in milliseconds (default: 40ms, max 25 msgs/sec) | ||
| -c, --count=<value> [default: 1] Number of messages to send | ||
| -d, --delay=<value> [default: 40] Delay between messages in milliseconds (max 25 msgs/sec) | ||
| -v, --verbose Output verbose logs | ||
| --client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly set | ||
| no client ID. Not applicable when using token authentication. | ||
|
|
@@ -4127,17 +4137,15 @@ Get current occupancy metrics for a room | |
|
|
||
| ``` | ||
| USAGE | ||
| $ ably rooms occupancy get ROOM [-v] [--json | --pretty-json] [--client-id <value>] | ||
| $ ably rooms occupancy get ROOM [-v] [--json | --pretty-json] | ||
|
|
||
| ARGUMENTS | ||
| ROOM Room to get occupancy for | ||
|
|
||
| FLAGS | ||
| -v, --verbose Output verbose logs | ||
| --client-id=<value> Overrides any default client ID when using API authentication. Use "none" to explicitly set | ||
| no client ID. Not applicable when using token authentication. | ||
| --json Output in JSON format | ||
| --pretty-json Output in colorized JSON format | ||
| -v, --verbose Output verbose logs | ||
| --json Output in JSON format | ||
| --pretty-json Output in colorized JSON format | ||
|
|
||
| DESCRIPTION | ||
| Get current occupancy metrics for a room | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to show
defaulttwice in help methods