https://github.com/synw/centcli
Terminal client for Centrifugo
https://github.com/synw/centcli
centrifugo
Last synced: 6 months ago
JSON representation
Terminal client for Centrifugo
- Host: GitHub
- URL: https://github.com/synw/centcli
- Owner: synw
- License: mit
- Created: 2017-03-16T10:52:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-02T10:48:03.000Z (over 8 years ago)
- Last Synced: 2025-04-14T19:08:08.792Z (6 months ago)
- Topics: centrifugo
- Language: Go
- Size: 1.05 MB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Centcli
Terminal client for the [Centrifugo](https://github.com/centrifugal/centrifugo/) websockets server.
## Configuration
Create a `config.json` with your Centrifugo nodes. This file should be located in the same directory as the binary or
in a `~/.centcli` directory:```javascript
{
"nodes": [
{
"name": "local",
"addr":"localhost:8001",
"secret":"secret_key"
},
{
"name": "local2",
"addr":"localhost:8002",
"secret":"secret_key"
}
]
}
```## Available commands
### Initialization
Server to use (must be set in config): start the program with the flag `-s=server_name` will initialize a connection
**`USE`**: `use server_name`
Server actually in use:
**`USING`**: `using`
To set the client's Centrifugo username use the flag `-u=clientusername`.
### Statistics
Get stats about Centrifugo:
**`STATS`**: options:
- `stats all`
- `stats node`
- `stats client`
- `stats http`Get a particular statistic:
**`STAT`**: `stat node_num_channels`
All the Centrifugo statistics are available:
[check the complete list](https://fzambia.gitbooks.io/centrifugal/content/server/stats.html)### Actions
**`PUBLISH`**: `publish channel_name {"foo":"bar"}
Note: do not use spaces in your payload
**`LISTEN`**: `listen channel_name`
**`STOP`**: `stop listen channel_name`
### Channels
**`COUNT`**: `count chans`
Get all channels on server:
**`CHANS`**: `chans`
List of users in a channel:
**`PRESENCE`**: `presence channel_name`
Channel history:
**`HISTORY`**: `history channel_name`