_          
 _ __(_)_ __ ___ 
| '__| | '__/ __|
| |  | | | | (__ 
|_|  |_|_|  \___|

...is a lightweight, open source terminal IRC client written in C by rcr, and a monument to the questionable practice of BDD (Beer Driven Development).

rirc is a multi-server IRC client with support for CTCP and IRCv3 and comes with TLS 1.2 enabled by default. rirc also comes with all of the features you would expect of a terminal chat client, like chat and input history, line editing, etc. Source code:

Talk to me on Libera:

user rcr or channel #rirc

Send bug reports, patches, etc, to:

mail [@] rcr.io

Send bitcoin to:

3MdzncjD6ZS8CqdgtPZar1iYx1jHGvBtmN

Installing


Building rirc from source requires a c11 compiler and GNU make. The toolchain and install paths can be configured via standard environment variables, i.e.:

$CC, $CFLAGS, $LDFLAGS, $DESTDIR, $PREFIX
Default install paths:
/usr/local/bin
/usr/local/share/man/man1
Fetch:
$ curl -s https://git.sr.ht/~rcr/rirc/archive/v0.1.7.tar.gz | tar xz
Install:
$ cd rirc-v0.1.7
$ make
$ make install
Configure:
Edit config.h and repeat the install step

Usage


rirc is controlled by a combination of CLI arguments, commands and keybinds. Commands beginning with ':' control the behaviour of rirc itself, while commands beginning with '/' are commands for the remote server.

rirc can connect to one or more servers on the command line, e.g.:

$ rirc -s hostname1 -n "nick1" \
       -s hostname2 -n "nick2" --tls-disable \
       -s hostname3 -n "nick2" --port 1234 --pass password

Default values for nicks, username and realname can be configured at compile time, or otherwise default to the system username.

The complete list of command line arguments:

-s, --server=HOST         Set connection hostname
-p, --port=PORT           Set connection port
-w, --pass=PASS           Set IRC password
-u, --username=USERNAME   Set IRC username
-r, --realname=REALNAME   Set IRC realname
-m, --mode=MODE           Set IRC user modes
-n, --nicks=NICKS         Set comma separated list of nicks to use
-c, --chans=CHANNELS      Set comma separated list of channels to join
    --tls-cert=PATH       Set TLS client certificate file path
    --tls-ca-file=PATH    Set TLS peer certificate file path
    --tls-ca-path=PATH    Set TLS peer certificate directory path
    --tls-verify=MODE     Set TLS peer certificate verification mode
    --tls-disable         Set TLS disabled
    --sasl=MECHANISM      Authenticate with SASL mechanism
    --sasl-user=USER      Authenticate with SASL username
    --sasl-pass=PASS      Authenticate with SASL password
    --ipv4                Use IPv4 addresses only
    --ipv6                Use IPv6 addresses only

TLS


By default all connections are TLS enabled over port 6697.

--tls-cert=PATH
File containing x509 client cert
--tls-ca-file=PATH
File containing one or more x509 peer certificates.
--tls-ca-path=PATH
Path containing one or more x509 peer certificates.
--tls-verify=MODE
Set the TLS x509 peer certificate verification mode, MODE must be one of:
  • disabled - cert is not verified
  • optional - cert is verified, handshake continues on error
  • required - cert is verified, handshake is aborted on error
The default mode is required.
--tls-disable
Disables TLS for this connection and sets the default port to 6667.

SASL


rirc supports user authentication at connection time via SASL.

--sasl=MECHANISM
Authenticate with the given SASL mechanism. MECHANISM must be one of:
  • external - Authenticate with client cert
  • plain - Authenticate with cleartext username and password
--sasl-user=USER
Set the SASL username for mechanism PLAIN.
--sasl-pass=PASS
Set the SASL password for mechanism PLAIN.

Keys


^N : go to next channel
^P : go to previous channel
^L : clear current channel
^X : close current channel
^C : cancel current input/action
^U : scroll current buffer back
^D : scroll current buffer down
PgUp : scroll current buffer up
PgDn : scroll current buffer down
Home : scroll current buffer to top
End : scroll current buffer to bottom
 ← : input cursor back
 → : input cursor forward
 ↑ : input history back
 ↓ : input history forward

Commands


:clear
Clear the current channel buffer.
:close
Close the current channel buffer.
:connect [hostname [options]]
Connect to the current buffer's server, or connect to a new server. This command supports all of the command line options for server connection.
:disconnect
Disconnect from the current buffer's server.
:quit
Quit rirc.

IRC


All commands beginning with a forward slash result in some command being sent to the server associated with the current buffer.

Commands not explicitly listed here can be sent verbatim, e.g.:

/mycommand target :foo bar baz
/away [message]
/join [channels [keys]]
/notice <target> <message>
/part [message]
/privmsg <target> <message>
/quit [message]
/topic [message]
/topic-unset

IRCv3


rirc supports a number of IRCv3.2 extensions, enabled by default. If a server also supports these extensions they will be requested during connection registration. The supported extensions are:

/cap-ls
List the IRCv3 capabilities supported by the server.
/cap-list
List the IRCv3 capabilities currently enabled.

CTCP


CTCP (Client to Client Protocol) is a common extension that allows clients to query meta data about one another through automated responses. It's also used to implement emotes or actions. Clients may choose not to implement CTCP, and users may have some or all common CTCP types disabled for privacy reasons. Some CTCP message types, such as FINGER and USERINFO, are largely obsolete.

CTCP commands with an optional [target] parameter will be sent to the current privmesg buffer when one is not given.

/ctcp-action <target> <text>
Send <text> to <target> as an action or emote. This command can be used to send an /emote to a specific target. Clients typically display the received action text in the third-person, e.g.:
* rcr goes to bed
This message type has no response.
/ctcp-clientinfo [target]
Query a client for it's CTCP capabilities.
/ctcp-finger [target]
Query a client for miscellaneous info, typically the target's realname.
/ctcp-ping [target]
Query a client for reachability and latency.
/ctcp-source [target]
Query a client for the location of it's source code.
/ctcp-time [target]
Query a client for it's local time in human-readable form.
/ctcp-userinfo [target]
Query a client for user info, typically the target's realname.
/ctcp-version [target]
Query a client for it's name and version.