- Notifications
You must be signed in to change notification settings - Fork2
Action Cable command-line client
License
palkan/acli
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ACLI is an Action Cable command-line interface written inmRuby.
It's a standalone binary which can be used:
In development for playing with Action Cable channels (instead of struggling with browsers)
For monitoring and benchmarking.
Currently only MacOS (x86_64 and ARM) and Linux (x86_64) are supported.PRs are welcomed for other platforms support.
See GitHubreleases. You can download the latest release by using cURL:
curl -L https://github.com/palkan/acli/releases/latest/download/acli-`uname -s`-`uname -m`> /usr/local/bin/aclichmod +x /usr/local/bin/acli
You can also find edge (master) builds inActions.
Coming soon
ACLI is an interactive tool by design, i.e., it is asking you for input if necessary.Just run it without any arguments:
$ acliEnter URL:# After successful connection you receive a message:Connected to Action Cable at http://example.com/cable
Then you can run Action Cable commands:
# Subscribe to channel (without parameters)\s channel_name# Subscribe to channel with params\s+ channel_name id:1# or interactively\s+Enter channel ID:...# Generate params object by providing keys and values one by oneEnter key (or press ENTER to finish):...Enter value:# After successful subscription you receive a messageSubscribed to channel_name# Performing actions\p speak message:Hello!# or interactively (the same way as \s+)\p+# Retrieving the channel's history since the specified time# Relative, for example, 10 minutes ago ("h" and "s" modifiers are also supported)\h since:10m# Absolute since the UTC time (seconds)\h since:1650634535
You can also provide URL and channel info using CLI options:
acli -u http://example.com/cable -c channel_name# or using full option namesacli --url=http://example.com/cable --channel=channel_name# you can omit scheme and even path (/cable is used by default)acli -u example.com
To pass channel params use--channel-params
option:
acli -u http://example.com/cable -c ChatChannel --channel-params=id:1,name:"Jack"
You can pass additional request headers:
acli -u example.com --headers="x-api-token:secret,cookie:username=john"
Other commands:
# Print help\?# Quit\q
Other command-line options:
# Print usageacli -h# Print versionacli -v# Quit after M incoming messages (excluding pings and system messages)acli -u http://example.com/cable -c channel_name --quit-after=M# Enabling PONG commands in response to PINGsacli -u http://example.com/cable --pong
We have Docker &Dip configuration for development:
# initial provisiondip provision# run rake tasksdip raketest# or open a console within a containerdip bash
You can also build the projectlocally (on MacOS or Linux):rake compile
orrake test
.
Ruby Next (
gem install ruby-next
)libressl (
brew install libressl
)wslay (
brew install libressl
)childprocess gem for testing (
gem install childprocess
)
Bug reports and pull requests are welcome onGitHub.
The gem is available as open-source under the terms of theMIT License.
About
Action Cable command-line client