Giter VIP home page Giter VIP logo

acli's Introduction

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.

acli's People

Contributors

palkan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

acli's Issues

Download links are invalid

Clicking on the download links on DOWNLOADS.md returns an S3 error.

<Error>
    <Code>PermanentRedirect</Code>
    <Message>
        The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
    </Message>
    <Bucket>acli</Bucket>
    <Endpoint>acli.s3.amazonaws.com</Endpoint>
    <RequestId>A28838E0626152BD</RequestId>
    <HostId>
        Dc2NyatZ7QV05F/xO8ve1wMOlog0s4vz1NpPXdT8ng311npkmolInUnPlg900fyfKLMGCjZszsw=
    </HostId>
</Error>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.