• Stars
    star
    230
  • Rank 174,053 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Action Cable command-line client

Build

Action Cable CLI

ACLI is an Action Cable command-line interface written in mRuby.

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.

Sponsored by Evil Martians

Installation

Currently only MacOS (x86_64 and ARM) and Linux (x86_64) are supported. PRs are welcomed for other platforms support.

Precompiled binaries

See GitHub releases. 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/acli
chmod +x /usr/local/bin/acli

You can also find edge (master) builds in Actions.

Homebrew

Coming soon

Usage

ACLI is an interactive tool by design, i.e., it is asking you for input if necessary. Just run it without any arguments:

$ acli

Enter 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 one
Enter key (or press ENTER to finish):
...
Enter value:
# After successful subscription you receive a message
Subscribed 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 names
acli --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 usage
acli -h

# Print version
acli -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 PINGs
acli -u http://example.com/cable --pong

Development

We have Docker & Dip configuration for development:

# initial provision
dip provision

# run rake tasks
dip rake test

# or open a console within a container
dip bash

You can also build the project locally (on MacOS or Linux): rake compile or rake test.

Requirements

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open-source under the terms of the MIT License.

More Repositories

1

logidze

Database changes log for Rails
Ruby
1,596
star
2

action_policy

Authorization framework for Ruby/Rails applications
Ruby
1,404
star
3

isolator

Detect non-atomic interactions within DB transactions
Ruby
850
star
4

anyway_config

Configuration library for Ruby gems and applications
Ruby
735
star
5

active_delivery

Ruby framework for keeping all types of notifications (mailers, push notifications, whatever) in one place
Ruby
595
star
6

n_plus_one_control

RSpec and Minitest matchers to prevent N+1 queries problem
Ruby
556
star
7

store_attribute

ActiveRecord extension which adds typecasting to store accessors
Ruby
376
star
8

view_component-contrib

A collection of extension and developer tools for ViewComponent
Ruby
345
star
9

litecable

Lightweight Action Cable implementation (Rails-free)
Ruby
298
star
10

action-cable-testing

Action Cable testing utils
Ruby
212
star
11

rubanok

Parameters-based transformation DSL
Ruby
205
star
12

active_event_store

Rails Event Store in a more Rails way
Ruby
180
star
13

action_policy-graphql

Action Policy integration for GraphQL
Ruby
151
star
14

engems

Rails component-based architecture on top of engines and gems (showroom)
Ruby
136
star
15

influxer

InfluxDB ActiveRecord-style
Ruby
118
star
16

abstract_notifier

ActionMailer-like interface for any type of notifications
Ruby
116
star
17

turbo-music-drive

Exploring Turbo future features while building a music library app
Ruby
102
star
18

wsdirector

All the world's a server, and all the men and women merely clients
Ruby
102
star
19

gem-check

GemCheck: Writing Better Ruby Gems Checklist
CSS
95
star
20

pgrel

ActiveRecord extension for querying hstore and jsonb
Ruby
93
star
21

rbytes

Ruby Bytes helps you build, deploy and install Ruby and Rails application templates
Ruby
68
star
22

faqueue

Researching background jobs fairness
Ruby
66
star
23

downstream

Straightforward way to implement communication between Rails Engines using the Publish-Subscribe pattern.
Ruby
51
star
24

newgem

Custom script to generate new gems
Ruby
35
star
25

turbo-view-transitions

View Transitions API for Turbo
TypeScript
33
star
26

influx_udp

Erlang InfluxDB UDP writer
Erlang
31
star
27

ruby-dip

Docker-based development environment for hacking Ruby MRI
Dockerfile
30
star
28

erlgrpc

GRPC client for Erlang
Erlang
25
star
29

as3_p2plocal

as3 lib for local p2p connections (serverless rtmfp)
ActionScript
25
star
30

rails-intest-views

Generate view templates dynamically in Rails tests
Ruby
21
star
31

docsify-namespaced

Docsify plugin to work with namespaces
JavaScript
12
star
32

sharelatex-vagrant-ansible

Vagrant + Ansible configuration for ShareLatex
Shell
12
star
33

slog-spy

Slog handler to temporary deliver formatted verbose logs to an arbitrary target
Go
12
star
34

docs-example

Playground for dealing with documentation engines
7
star
35

ruby-russia-2020

RubyRussia 2020 "Frontendless Rails" workshop demo app
Ruby
6
star
36

engine-cable-app

Experimenting with Action Cable and engines
Ruby
6
star
37

rails-on-wasm-playground

A minimal Rails app to showcase Rails on Wasm features
Ruby
5
star
38

palkan

It's me
4
star
39

ruby-compatibility-examples

Collections of reproduction cases for TruffleRuby vs. MRI (in)compatibility
Ruby
3
star
40

erffmpeg

Erlang wrapper for some ffmpeg
C
3
star
41

th-dummy

TH Dummy
Ruby
2
star
42

ulitos

Erlang utils modules
Erlang
2
star
43

meetings

Good old Teachbase Meetings client
ActionScript
2
star
44

rebar_templates

Custom rebar templates
Erlang
1
star
45

macos-setup

Shell
1
star
46

bitrix-orm

Bitrix kinda ORM for IBlockElements and CUser.
PHP
1
star
47

anycable-elements

Web Components for AnyCable console
JavaScript
1
star
48

adventofcode2018

https://adventofcode.com
Rust
1
star
49

tb_utils

ActionScript 3 library
ActionScript
1
star