Hey there, these are some of my notes about IRC in general, and the CLI client irssi.

IRC Primer

Internet Relay Chat (IRC) is an open protocol that uses TCP and optionally TLS. IRC was born in August 1988, by Jarkko Oikarinen at the University of Oulu in Finland. Years later, in 1993, was standardised as RFC 1459. Assigned port 194/TCP by IANA, however in practice most use 6667/TCP, and nearby ports (6660-6669, 7000).

Each client session is assigned a unique identifier called a hostmask, which takes the form nick!user@host. Some networks (such as freenode) offer cloaks to show affiliation with a project, by altering the hostmask. For example alex@123.45.67.89 could become alex@gnu.org/AlexZ. They’re basically a badge of pride and legimaticy of who you say you are.

  1. Install a client (e.g. irssi).
  2. Register networks our your pleasing e.g. /NETWORK ADD -sasl_username bm4cs -sasl_password <password> -sasl_mechanism PLAIN freenode
  3. Register a server (e.g. freenode) /SERVER ADD freenode chat.freenode.net/6697 -ssl -sslverify -autoconnect or /SERVER ADD oftc irc.oftc.net/6697 -ssl -autoconnect
  4. Connect /CONNECT oftc or alternatvely not with SASL but with a general server PASS, /SERVER ADD bm4csarchbox 6697 MYPASSWORD (useful for first logging into own ircd, to start setting things up).
  5. Set your nick /NICK snazzybeard or use a pre-registered nick (see below) with the IDENTIFY command /msg NickServ IDENTIFY snazzybeard <password>
  6. Join a channel /JOIN ##C or /JOIN #cjeopardy

Register nick

  1. Register nick with NickServ /msg NickServ REGISTER password user@domain.com
  2. You’ll receive an email from NickServ, with a one off verification code.
  3. Verify with NickServ /msg NickServ VERIFY REGISTER vimjock abcdefg
  4. Group other nicks you want to the same account. /nick myothercoolnick then /msg NickServ IDENTIFY vimjock password then /msg NickServ GROUP

Channels

The means of communicating with a group of users. Basic channel operations include joining /join #channel, leaving /part #channel, and listing /list. Channel prefixes encode the following meanings:

  • # channel that is available across the entire IRC net
  • ## or more hashes, indicates its off topic
  • & channel local to a server
  • + modeless
  • ! timestamped channel

List registered channels with /LIST. Another effective way to find a channel is by asking the alis bot. Alis supports these options:

  • min <n>: show only channels with at least users
  • max <n>: show only channels with at most users
  • skip <n>: skip first matches
  • show [m][t]: show modes/topicsetter
  • mode <+|-|=><modes>: modes set/unset/equal
  • topic <pattern>: topic matches pattern
  • showsecret: show secret channels (requires chan:auspex)

Examples:

/msg alis LIST searchterm
/msg alis LIST * -topic multiple*ordered*search*terms
/msg alis LIST * -min 50
/msg alis LIST #foo*
/msg alis LIST #foo* -mode =n
/msg alis LIST *freetopic* -mode -t -show mt
/msg alis LIST ##nocolors* -mode +c -show t

ChanServ is the bot responsible for channel management, and doesn’t mind when you ask for help /msg ChanServ help:

FLAGS           Manipulates specific permissions on a channel.
INVITE          Invites you to a channel.
OP              Gives channel ops to a user.
RECOVER         Regain control of your channel.
REGISTER        Registers a channel.
SET             Sets various control flags.
UNBAN           Unbans you on a channel.

Other commands: ACCESS, AKICK, CLEAR, COUNT, DEOP, DEVOICE,
                DROP, GETKEY, HELP, INFO, QUIET, STATUS,
                SYNC, TAXONOMY, TEMPLATE, TOPIC, TOPICAPPEND,
                TOPICPREPEND, TOPICSWAP, UNQUIET, VOICE,
                WHY

Be aware not all ChanServs are equal, with some offering more (or less) functionality. For exapmle, the ChanServ that ships with the oragono ircd:

AMODE modifies persistent mode settings for channel members.
HELP shows in-depth information about commands.
OP makes the given user (or yourself) a channel admin.
REGISTER lets you own a given channel.
UNREGISTER deletes a channel registration.

Channel Modes

Mode Name Description
b channel ban +b nick!user@host (wildcards * and ? supported)
c colour filter Strip colour and formatting codes from channel messages.
C block CTCPs Blocks client-to-client protocol commands.
e ban exemption Overrides +b and +q bans. Example: /mode #channel +bee *!*@*.example.com *!*someuser@host3.example.com $a:JohnDoe would block all users from example.com, while still allowing someuser from host3 and JohnDoe to join.
f forward Users who cannot join the channel (because of +i, +j, +r, see below) are instead sent to the given channel.
F enable forwarding Allow operators in other channels to forward clients to this channel, without requiring ops.
g free invite Anybody in the channel may invite others.
i invite only Users are unable to join invite-only channels unless they are invited or match a +I entry.
I invite exemption Takes a ban parameter.
j join throttle Takes one parameter of the form n:t. Only n users may join in each period of t seconds, so with e.g. 3:10 only 3 users could join within 10 seconds. Invited users can join regardless of +j, but are counted as normal. You can use this mode to prevent bot attacks. This mode can be combined with +f to forward throttled users to an overflow channel.
k password To enter the channel, you must specify the password on your /join command.
l join limit Limits the number of users who can be in the channel at the same time.
m moderated Only opped and voiced users can send to the channel.
n prevent external send Users outside the channel may not send messages to it. Keep in mind that bans and quiets will not apply to external users.
p private The KNOCK command cannot be used on the channel, and users will not be shown the channel in whois output unless they share the channel with the requestor. The channel will still appear in channel lists and WHO output (set channel mode +s if this is not desired).
q quiet Works like +b (ban user), but allows matching users to join the channel.
Q block forwarded users Users cannot be forwarded (see +f above) to a channel with +Q.
r block unidentified Prevents users who are not identified to services from joining the channel.
s secret This channel will not appear on channel lists or WHO or WHOIS output unless you are on it.
S SSL-only Only users connected via SSL may join the channel while this mode is set. Users already in the channel are not affected. Keep in mind that this also blocks all webchat users, as they are not marked as connected via SSL.
t ops topic Only channel operators may set the channel topic.
z reduced moderation The effects of +b, +q, and +m are relaxed. For each message, if that message would normally be blocked by one of these modes, it is instead sent to channel operators (+o).

Channel Flags

Flags are how channel privileges are granted and removed, /msg ChanServ help flags:

***** ChanServ Help *****
Help for FLAGS:

The FLAGS command allows for the granting/removal of channel
privileges on a more specific, non-generalized level. It
supports nicknames, groups and hostmasks as targets.

When only the channel argument is given, a listing of
permissions granted to users will be displayed.

Syntax: FLAGS <#channel>

Otherwise, an access entry is modified. A modification may be
specified by a template name (changes the access to the
template) or a flags change (starts with + or -). See the
TEMPLATE help entry for more information about templates.

Syntax: FLAGS <#channel> [nickname|hostmask|group template]
Syntax: FLAGS <#channel> [nickname|hostmask|group flag_changes]

Permissions:
    +v - Enables use of the voice/devoice commands.
    +V - Enables automatic voice.
    +o - Enables use of the op/deop commands.
    +O - Enables automatic op.
    +s - Enables use of the set command.
    +i - Enables use of the invite and getkey commands.
    +r - Enables use of the unban command.
    +R - Enables use of the recover, sync and clear commands.
    +f - Enables modification of channel access lists.
    +t - Enables use of the topic and topicappend commands.
    +A - Enables viewing of channel access lists.
    +S - Marks the user as a successor.
    +F - Grants full founder access.
    +b - Enables automatic kickban.
    +e - Exempts from +b and enables unbanning self.

The special permission +* adds all permissions except +b, +S, and +F.
The special permission -* removes all permissions including +b and +F.

Examples:
    /msg ChanServ FLAGS #foo
    /msg ChanServ FLAGS #foo foo!*@bar.com VOP
    /msg ChanServ FLAGS #foo foo!*@bar.com -V+oO
    /msg ChanServ FLAGS #foo foo!*@bar.com -*
    /msg ChanServ FLAGS #foo foo +oOtsi
    /msg ChanServ FLAGS #foo TroubleUser!*@*.troubleisp.net +b
    /msg ChanServ FLAGS #foo !baz +*

Window management

On the client is how a channel, private message, or service notification, is presented. As you will typically have multple of these at once, some useful commands to juggle them:

  • /win list listing of all windows
  • /win num to move to window (ex. /win 3)
  • alt + #
  • /join #channel
  • ctrl + n same as /window next
  • ctrl + p same as /window previous
  • /wc same as /window close

Buffers can be merged. For example you might want particular messages to go to a specific buffer.

Logging

TODO

Useful Features

highlight

TODO

ctrl+n, ctrl+p vs alt+n, alt+p

For quickly cycling buffers.

usermode +g == callerid

TODO

moving windows

/window move # or /buffer move #

  • autolog
  • searching ^r to search, and enter to stop

Peace and Quiet

/ignore a client side filter (e.g. user@host) /silence a server side filter which given a regex, will prevent spamming of the client. /mode <username> +g (callerid)

smartfilter or /filter to filter out pollution

With smart filter (keep join/part/quit from users who spoke recently):

/set irc.look.smart_filter on
/filter add irc_smart * irc_smart_filter *

With a global filter (hide all join/part/quit):

/filter add joinquit * irc_join,irc_part,irc_quit *

For more help /help filter and /help irc.look.smart_filter

Connections

/connect -ssl run over SSL (usually port 6697, versus cleartext on 6667). sasl (cap_sasl.pl) if disconnected, do the nickserv tango, put on any cloaks, before auto re-adding to channels.

Resources