Andrew Mercer
on this page

IRC Command Reference

Commands are shown in the form you type into a client (irssi syntax where clients differ). Arguments in <angle brackets> are required, [square brackets] are optional.

See the IRC guide for background on modes, hostmasks, and services.


Connecting and Identity

Task Command
Connect (TLS) /connect -tls irc.libera.chat 6697
Change nickname /nick <new_nick>
Set away / back /away <reason> · /away
Who is someone /whois <nick> · /whowas <nick>
Private message /msg <nick> <text> · /query <nick> (opens a window)
Action ("* amercer waves") /me waves
Disconnect /quit [message]

Channels (any user)

Task Command
Join /join #channel [key]
Leave /part #channel [reason]
List users /names #channel · /who #channel
List channels /list (can be huge — /list *rust* on servers that support it)
View topic /topic

Nickname Registration (NickServ)

Anope and Atheme (Libera.Chat) share the core syntax.

/msg NickServ REGISTER <password> <email>
/msg NickServ VERIFY REGISTER <nick> <code>     # if the network emails a code
/msg NickServ IDENTIFY <password>               # manual login (prefer SASL)
/msg NickServ GROUP                              # add current nick to your account
/msg NickServ GHOST <nick>                       # kill a stale session (RECOVER/REGAIN on some networks)
/msg NickServ SET PASSWORD <new_password>
/msg NickServ INFO <nick>

Use SASL instead of IDENTIFY. SASL logs you in during connection, before you join channels, so your cloak is applied before your real host is ever shown. irssi setup: irssi → SASL.


Channel Registration and Persistent Settings (ChanServ)

A channel normally disappears (with all its modes and topic) when the last user leaves. Registering it with ChanServ makes settings persist.

/msg ChanServ REGISTER #channel [description]
/msg ChanServ INFO #channel

Set a topic

/topic #channel Welcome to #channel — docs: https://www.andrewmercer.net

Make the topic permanent

This was the long-standing "to be determined" in my notes. It's a ChanServ setting:

/msg ChanServ SET #channel KEEPTOPIC ON    # restore last topic when channel is recreated
/msg ChanServ SET #channel TOPICLOCK ON    # only ChanServ-authorized users can change it

Pair with channel mode +t so only ops can change the topic in the first place:

/mode #channel +t

Persistent ops/voice (access lists)

# Anope (and newer Atheme): role- or level-based
/msg ChanServ ACCESS #channel ADD <nick> <level>
/msg ChanServ OP #channel [nick]
/msg ChanServ VOICE #channel [nick]

# Atheme (Libera.Chat) flags system
/msg ChanServ FLAGS #channel <account> +AOiortv

Persistent modes

/msg ChanServ SET #channel MLOCK +nt-k

Channel Operator Commands

You need channel operator status (@) in the channel. You do not need to be an IRC operator for any of these — that was a mistake in my old notes.

Give / take op, half-op, voice

/mode #channel +o <nick>
/mode #channel -o <nick>
/mode #channel +v <nick>
/mode #channel +oo <nick1> <nick2>     # several at once

irssi shortcuts: /op <nick>, /deop <nick>, /voice <nick>, /devoice <nick>.

Common channel modes

/mode #channel +nt          # sensible defaults: no outside messages, ops-only topic
/mode #channel +i           # invite-only
/mode #channel +k <key>     # password
/mode #channel +l 50        # user limit
/mode #channel +m           # moderated
/invite <nick> #channel

Kick a user

/kick #channel <nick> [reason]
/kick #andrewmercer CGI222 testing

In irssi the leading : before the reason is optional — irssi adds it for you. In raw protocol it's KICK #channel nick :reason.


Ban a User

Bans match hostmasks (nick!user@host). Getting the mask right is the whole game.

What went wrong in my old test

/ban #andrewmercer CGI842
12:04 -!- mode/#andrewmercer [+b *!*d810ef42@*.cpe.teksavvy.com] by andrew

irssi's /ban <nick> builds the mask from the user's hostmask according to the ban_type setting. The default, normal, produces *!*user@*.domain — it keeps the username and wildcards the first part of the host.

The username here, d810ef42, is the hex-encoded IP address (d8.10.ef.42 → 216.16.239.66) that web-chat gateways like CGI:IRC use as the ident. Every webchat user coming from that IP has the same ident, so the ban caught all of them — including my other test client. It wasn't really "everyone from TekSavvy", it was everyone from that one IP via the gateway.

Choose the ban type deliberately

/set ban_type normal   # *!*user@*.domain.net   (default)
/set ban_type host     # *!*@host.domain.net    (one host/IP — usually what you want)
/set ban_type user     # *!*user@*
/set ban_type domain   # *!*@*.domain.net       (whole ISP — very broad)

Or skip the guessing and write the mask yourself:

/whois CGI842                                    # look at the actual user@host first
/mode #andrewmercer +b *!*@umoswg-D6F9202F.cpe.teksavvy.com

On UnrealIRCd, bans on a user's cloaked host also match their real host and IP, so banning the cloak you see is safe and effective.

Better: ban the account, not the host

If the user is logged in to services, ban their account — it survives IP changes and doesn't hit innocent people on shared IPs.

# UnrealIRCd 6 (named extended bans)
/mode #channel +b ~account:<accountname>
/mode #channel +b ~quiet:*!*@bad.host       # mute instead of ban

# Solanum / Libera.Chat
/mode #channel +b $a:<accountname>
/mode #channel +q *!*@bad.host              # quiet

Kick + ban together

/kickban #channel <nick> [reason]            # irssi: /kb
/knockout 300 <nick> [reason]                # irssi: kickban, auto-unban after 300s (/kn)

List and remove bans

/mode #channel +b                            # list bans (irssi: /bans)
/mode #channel -b *!*d810ef42@*.cpe.teksavvy.com
/unban *!*d810ef42@*.cpe.teksavvy.com        # irssi
/unban *                                     # irssi: remove all bans in current channel (/mub)

Always include the channel name in /mode unless you're sure the active window is that channel — /mode -b <mask> in my old notes only works from inside the channel window.

Ban exceptions

/mode #channel +e *!*@trusted.host           # exempt from bans
/mode #channel +I *!*@trusted.host           # may join while +i

IRC Operator Commands (server staff)

Become an operator

/oper <name> <password>

<name> and the password hash are defined in an oper { } block in unrealircd.conf — see UnrealIRCd → Operators.

Operator overrides (UnrealIRCd 6)

IRC operators with the right operclass permissions can act on channels they aren't opped in:

/samode #channel +o <nick>          # set modes as the server
/sajoin <nick> #channel             # force-join a user
/sapart <nick> #channel

Network bans

/kline *@bad.host 1d Spamming       # ban from this server
/gline *@bad.host 1d Spamming       # ban network-wide
/zline 203.0.113.0/24 7d Abuse      # IP-level, before DNS/ident
/kill <nick> <reason>
/rehash                             # reload server config
/stats                              # list stats letters (e.g. /stats G for glines)

Services administration (Anope OperServ)

/msg OperServ AKILL ADD +7d *@bad.host Spamming
/msg OperServ STATS
/msg OperServ GLOBAL <message>      # message every user