aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: b0ad871fd8ea735b98f84969bebf7eaeddad4c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Rocket CLI client

This is a collection of tools to interact with rocket chat.

## Content

- [Dependencies](#dependencies)
- [Manual installation](#manual-installation)
- [Configuration](#configuration)
- [Usage](#usage)

## Dependencies

This project has the following hard dependencies :
- the libconfig from http://www.hyperrealm.com/libconfig/libconfig.html
- the libcurl from https://curl.haxx.se/libcurl/
- the openssl libraries : libcrypto and libssl
- the libev event loop for websockets handling with libuwsc : http://software.schmorp.de/pkg/libev.html

The following dependencies are included as submodules :
- uthash from http://troydhanson.github.io/uthash/

The following dependency is automaticaly downloaded and built from github :
- libuwsc from https://github.com/zhaojh329/libuwsc

## Manual Installation

This project is built using cmake :
```
git submodule update --init
mkdir build
cd build
cmake ..
make
make install
```

You can customise the build with the following cmake flags :

- `CMAKE_BUILD_TYPE` : Debug|Release|RelWithDebInfo|MinSizeRel, defaults to Release if using a tarball, and Debug if using the git tree
- `CMAKE_INSTALL_PREFIX` : path, defaults to `/usr/local`
- `DEBUG_WEBSOCKETS` : ON|OFF, defaults to OFF

For example this activates websocket debugging for a debug build and installs the tools for your current user :

`cmake .. -DCMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=$HOME/.local -DDEBUG_WEBSOCKETS=ON`

## Configuration

Here is the default configuration :
```
web_url = "http://hurricane:3000";
wss_url = "ws://hurricane:3000/websocket";
login = "test";
password = "test";
```

Only the web and websocket urls are mandatory. If the login and password are omitted you will be prompted for those.

## Usage

### rocket_close_direct_conversations

This tools lists your active direct conversations and allows you to specify conversations to close from the cli. It is equivalent of the "Hide Room" feature in the gui, it will not make you
really leave a channel. I use it to quickly remove clutter. An empty line will exit the program.

Example use :
```
julien@hurricane ~/git/rocket-cli-client/build (master *%) $ close_direct_conversations/rocket_close_direct_conversations
Active direct conversations :
        foo.bar
        mr.somebody
Direct conversation to close: foo.bar
{"success":true}
Direct conversation to close:
julien@hurricane ~/git/rocket-cli-client/build (master *%) $
```

### rocket_maar

This tools marks all active subscriptions as read, not channels or groups at the moment. It is usefull when returning from a holliday.

Example use :
```
julien@hurricane ~/git/rocket-cli-client/build (master *%) $ maar/rocket_maar
The following active subscriptions are marked as read :
foo.bar
mr.somebody
julien@hurricane ~/git/rocket-cli-client/build (master *%) $
```