Skip to main content

A simple RocketChat command line client

Project description

rchat

build License: GPL v3

A simple RocketChat command line client

rchat --to #team "Hello World!"

Usage

rchat comes with a command line interface that allows you to send messages either to groups or direct people:

rchat --to @rita.cantaora "Hi Rita!"

The message can also be piped into the program via stdin:

echo "Hi!" | rchat --to #team

See help for more information:

See rchat --help.

Configuration

rchat needs to know at least the server url and user credentials to use the API. Those parameters can be given via command line option, set using an envvar or by setting them in a config file.

Base configuration options can be taken from the command line. Arguments given in the command line will override any other configuration.

--user TEXT      Username in RocketChat
--user-id TEXT   User id associated to a Token
--token TEXT     Personal Acces Token Name
--password TEXT  Password for user in RocketChat
--url TEXT       Url to the RocketChat server

They can also be set as a environment variable by prefixing them such as RCHAT_URL. Arguments set this way will take precedence over the ones in the config file.

To configure via file, place your parameters in toml format at ~/.config/rchat/config.toml:

[rchat]
user_id = 'a1d3f4dd..'
token = 'fjXkkf..'
url = 'https://rocketchat.myserver.net'

A specific config file can be given by passing the --config option or setting the RCHAT_CONFIG envvar.

Extra config files can be placed in the conf.d directory and all of them will be merged together using confight. Last values found in these files will override the previous ones, so the complete list of places to be searched, in the order that will be read are:

  • /etc/rchat/config.toml
  • /etc/rchat/conf.d/*
  • ~/.config/rchat/config.toml
  • ~/.config/rchat/conf.d

Meaning that the keys in files placed at ~/.config/rchat/conf.d will override the rest.

Development

From the root of the application directory, create a python environment, install the application in development mode along with its dependencies and run it locally:

virtualenv env
. env/bin/activate
pip install --upgrade pip
pip install -e . -r requirements.txt -r dev-requirements.txt

Tests can be run using tox (recommended):

pip install tox
tox

Or directly by calling py.test:

python -m pytest

TODO

  • Send private messages
  • Send message from stdin
  • Send message from files
  • Upload files
  • Upload images
  • Read messages
  • Listen to new messages
  • Autocomplete emojis
  • Autocomplete users
  • Autocomplete channels
  • Config file
  • Logging and debug
  • Debian Packaging
  • Bundled Packaging
  • Pypi version
  • Versioning script
  • Improve startup time
  • Define groups of users
  • Allow to get reactions
  • Allow for threads
  • Implement (pre|post) message hooks
  • Implement (pre|post) reaction hooks
  • Autocomplete names
  • Autocomplete channels
  • Open editor to compose message
  • Preview message in markdown viewer
  • Autoformat input as verbatim

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rchat-0.0.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

rchat-0.0.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file rchat-0.0.2.tar.gz.

File metadata

  • Download URL: rchat-0.0.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.3 Linux/4.4.0-133-generic

File hashes

Hashes for rchat-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d11b628dd0365b8cd4c86e7fe70f873533d8319af56cbca2bd234523bc95fc94
MD5 02dcebef4ce1563b56be4e3974833c22
BLAKE2b-256 a7fa0cc09949617af5eb979ac14ea540359f38dd427b70730aa718405ca93bc5

See more details on using hashes here.

File details

Details for the file rchat-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rchat-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.3 Linux/4.4.0-133-generic

File hashes

Hashes for rchat-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 06071656a8bb8e956a27df54e8f5e977528e9b9ff9fa1070fa393a0f6eb60d3d
MD5 f343642b15061a96376e0cf5d4e21bbe
BLAKE2b-256 f6a05079d687b5427f79ec67e6e5e1d1f47e95fbb877a217ec45c7b9735acefc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page