The IRC spec is in RFC 1459. The IRC protocol is suprisingly elegant and simple. For basic operation, there is no need for a dedicated client (although a client makes chatting more enjoyable).

In general, an IRC message looks like:

1
<command> [arg] [arg] ... :[arg with spaces]

or

1
[:prefix] <command> [arg] [arg] ... :[arg with spaces]

This format is the same for both client -> server, and server's replies. The prefix is usually the an identity of the message's originator.

Basic Operations

To connect:

  1. Connect to the server using TLS: openssl s_client -connect <server>:<port>
  2. Set the nick: nick <your_nick>
  3. Set username: user <your_nick> . .

To chat:

  1. Join channel with join <channel_name>
  2. Chat in channel with privmsg <channel_name> :<msg>
  3. Chat with other user with privmsg <user> :<msg>
  4. List channel users with lusers <channel>

To authenticate your nick with NickServ, you need to issue the following command to the user NickServ:

identify <your nick's password>

To do this, issue the following:

privmsg nickserv :identify <nick's password>

Note that channel_name starts with #, while user name doesn't.

An Example Log

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
>>> openssl s_client -connect irc.libera.chat:6697

:platinum.libera.chat NOTICE * :*** Checking Ident
:platinum.libera.chat NOTICE * :*** Looking up your hostname...
:platinum.libera.chat NOTICE * :*** Found your hostname: xxxx
:platinum.libera.chat NOTICE * :*** No Ident response
nick jsbach
user jsbach . . .
:platinum.libera.chat 001 jsbach :Welcome to the Libera.Chat Internet Relay Chat Network jsbach
:platinum.libera.chat 002 jsbach :Your host is platinum.libera.chat[188.240.145.102/6697], running version solanum-1.0-dev
:platinum.libera.chat 003 jsbach :This server was created Sat May 22 2021 at 19:04:12 UTC
:platinum.libera.chat 004 jsbach platinum.libera.chat solanum-1.0-dev
:platinum.libera.chat 005 jsbach SAFELIST ELIST=CTU FNC WHOX CALLERID=g KNOCK MONITOR=100 ETRACE CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQScgimnprstuz :are supported by this server
:platinum.libera.chat 005 jsbach CHANLIMIT=#:250 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=Libera.Chat STATUSMSG=@+ CASEMAPPING=rfc1459 NICKLEN=16 MAXNICKLEN=16 CHANNELLEN=50 TOPICLEN=390 DEAF=D :are supported by this server
:platinum.libera.chat 005 jsbach TARGMAX=NAMES:1,LIST:1,KICK:1,WHOIS:1,PRIVMSG:4,NOTICE:4,ACCEPT:,MONITOR: EXTBAN=$,ajrxz CLIENTVER=3.0 :are supported by this server
:platinum.libera.chat 251 jsbach :There are 42 users and 19058 invisible on 19 servers
:platinum.libera.chat 252 jsbach 32 :IRC Operators online
:platinum.libera.chat 253 jsbach 3 :unknown connection(s)
:platinum.libera.chat 254 jsbach 15309 :channels formed
:platinum.libera.chat 255 jsbach :I have 1914 clients and 1 servers
:platinum.libera.chat 265 jsbach 1914 2025 :Current local users 1914, max 2025
:platinum.libera.chat 266 jsbach 19100 19898 :Current global users 19100, max 19898
:platinum.libera.chat 250 jsbach :Highest connection count: 2026 (2025 clients) (15019 connections received)
:platinum.libera.chat 375 jsbach :- platinum.libera.chat Message of the Day -
:platinum.libera.chat 372 jsbach :- This server provided by NORDUnet/SUNET
:platinum.libera.chat 372 jsbach :- Welcome to libera.chat, the IRC network for free & open-source software
:platinum.libera.chat 372 jsbach :- and peer directed projects.
:platinum.libera.chat 372 jsbach :-
:platinum.libera.chat 372 jsbach :- Please visit us in #libera for questions and support.
:platinum.libera.chat 376 jsbach :End of /MOTD command.
:jsbach MODE jsbach :+RZi
join #test
:jsbach!~jsbach@xxxx JOIN #test
:platinum.libera.chat 353 jsbach = #test :jsbach NightMonkey Daniel071_ python PowaBanga ExEsPi simong maximagui voliborfrey Koragg jstoker
:platinum.libera.chat 366 jsbach #test :End of /NAMES list.
privmsg #test hello!