Skip to content

Instantly share code, notes, and snippets.

@xero
Last active October 29, 2024 15:25
Show Gist options
  • Save xero/2d6e4b061b4ecbeb9f99 to your computer and use it in GitHub Desktop.
Save xero/2d6e4b061b4ecbeb9f99 to your computer and use it in GitHub Desktop.
irc cheat sheet

IRC Reference

by xero updated 10.29.24

Highlights


History

IRC / Internet Relay Chat is a text based chat protocol over TCP using a client-server model. It's design focuses on group communications in channels or rooms. Channel names are always prefaced by a pound sign (e.g. #unix). Servers can be a single node or a network of nodes. Clients range from command line tools, desktop GUI applications, to websites, and mobile apps.

After the first open source version of IRC was published by WiZ in 1998, universities and hobbyists began to join the network. By August 1990, the first major irc drama took place...

According to wumpus: The "A-net" (Anarchy net) included a server named eris.berkeley.edu. It was all open, required no passwords and had no limit on the number of connects. [...] It had a wildcard server line, so people were hooking up servers and nick-colliding everyone".

The formation of the "Eris Free Network" (EFnet), made the eris machine the first to be Q-lined (Q for quarantine) and marked the first network split.

Over the decades, use of larger networks like "the big 4" (efnet, undernet, ircnet, and dalnet) have drastically fallen off in favor of smaller, usually topical or private, instances.


User Commands

Formatting Notes: <values> are required [values] are optional

join

  • /join #channel
  • Joins the specified channel.

part

  • /part #channel [message]
  • Leaves the specified channel with optional message

knock

  • /knock #channel <message>
  • Sends a NOTICE to an invitation-only #channel with an optional message, requesting an invite.

invite

  • /invite <nickname> #channel
  • Invites a user to join a channel.

quit

  • /quit [message]
  • Disconnects from current server with optional message.

server

  • /server <hostname>
  • Connects to the specified server.

list

  • /list
  • Lists all channels on the current network.

links

  • /links
  • Lists all servers on the current network.

nick

  • /nick <new name>
  • Changes your handle.

names

  • /names #channel
  • Shows the nicks of all users on #channel.

msg

  • /msg <nickname> <message>
  • Sends a private message to a user.

privmsg

  • /privmsg <target>:<message>
  • Sends message to target, usually a user or channel.

query

  • /query <nickname> <message>
  • Sends a private message to a user in a new window.

me

  • /me <action>
  • Prints "yourname action", usually in italics

notice

  • /notice <nickname> <message>
  • Sends a notice to the specified user. Similar to /msg, but plays a sound or visual bell.

away

  • /away <message>
  • Automatically sends a reply via privmsg directed at the user, not the channel, when you are highlighted or private messaged.

whois

  • /whois <nickname>
  • Shows information about the specified user. This action is not visible to the specified user.

whowas

  • /whowas <nickname>
  • Shows information about a user who has quit.

dns

  • /dns <nickname>
  • Attempts to resolve the IP address of the specified user. Doesn't work on all networks, doesn't work all the time.

ping

  • /ping <nickname>
  • Pings the specified user. This action is visible to the specified user.

motd

  • /motd [server]
  • Displays the message of the day on a server, or the current if omitted.

rules

  • /rules
  • Requests/displays the server rules. This command is not formally defined in an RFC, but is used by many IRC daemons.

version

  • /version [<server>]
  • Returns the version of a server, or the current server if omitted

Nick Management (NickServ)

Command Preface: All nickserv commands begin with /ns, /nickserv, or /msg NickServ. Depending on your client or network, /ns may not work. Replace /ns with the appropriate command using the same arguments from these examples. For brevity i will use the shorthand.

register

  • /ns register <password> [email]
  • Registers your current nick with NickServ with the chosen password and binds it to an e-mail address (optional).

identify

  • /ns identify <password>
  • Identifies your nick to NickServ using the password you set. If you have a nick that's been registered, and you don't identify in a certain time period, the IRCd will auto-change your nick.

set password

  • /ns set password <yournewpassword>
  • Changes your password to "yournewpassword"

Warning! Under no circumstances should you try and register, or change to, a nick starting with O followed by 8 digits1

recover

  • /ns recover nickname password
  • Kills (forcibly disconnects) someone using your registered nick.

ghost

  • /ns ghost nickname password
  • Terminates a "ghost" IRC session that's squatting your nickname.

Channel Modes

set a mode with: /mode #channel +/-attribute [data]

Attribute Mode Description
+n Disallows external messages.
+t Only op/hops can set the topic.
+p Sets the channel as invisible in /list.
+s Sets the channel as invisible in /list and /whois.
+i Sets the channel as closed unless the person was invited.
+k [pass] Sets a password for the channel which users must enter to join.
+l [num] Sets a limit on the max number of users allowed in the channel.
+m Prevents users who are not opped/hopped/voiced from talking.
+R Sets the channel so only registered nicks are allowed in.
+M Sets the channel so only registered nicks are allowed to talk.
+S Strips formatting from messages, rendering them as plaintext.
+c Blocks messages containing color codes.
+i A user must be invited to join the channel.
+N No nick changes permitted in the channel.

ChanServ Commands

All ChanServ commands begin with /cs, /chanserv, or /msg ChanServ. Depending on your client and network, /cs or /chanserv may not work.

Note: I will use the /cs shorthand in these examples. Update the slash commands to the appropriate name for your server. Options will be the same.

register

  • /cs register #channel <password> [description]
  • Registers the current channel to you with ChanServ and sets its password and description.

drop / unregister ⚠

  • /cs drop #channel [dropcode]
  • Un-registers the current channel to you with ChanServ.

identify

  • /cs identify #channel <password>
  • Identifies you as the channel's founder and gives you founder-level privileges.

founder

  • /cs set #channel founder [nickname]
  • Sets the current channel's founder.

mode lock

  • /cs set #channel mlock <modes>
  • Locks the channel's modes. Just + unlocks all.

secure ops

  • /cs set #channel secureops [on|off]
  • Keeps everyone except aops, sops, and the founder from becoming ops.

keep topic

  • /cs set #channel keeptopic [on|off]
  • Maintains the topic even if everyone leaves.

enforce ops

  • /cs set #channel enforce [on|off]
  • Restores op/halfop/voice if a person with op/halfop/voice gets de-opped/halfopped/voiced.

leave ops

  • /cs set #channel leaveops [on|off]
  • Whether or not to allow the first person who join the channel to get ops.

set password

  • /cs set #channel password [newpass]
  • Changes the current channel's password to newpass.

description

  • /cs set #channel desc [description]
  • Changes the current channel's description.

url

  • /cs set #channel url [address]
  • Associates a URL with the channel.

email

  • /cs set #channel [email@address]
  • Associates an email address with the channel.

Operator Commands

oper

  • /oper <nickname> <pass>
  • Authenticates a user as an IRC operator on that server/network.

userip

  • /userip <nickname>
  • Requests the public IP address of the user with the specified nickname.
    • It is unclear what, if any, privileges are required to execute this command on a server. This command is not formally defined by an RFC.
    • Support is indicated in a RPL_ISUPPORT reply (numeric 005) with the USERIP keyword.

users

  • /users [<server>]
  • Returns a list of users and information about those users in a format similar to the unix who, rusers, and finger commands.

wallops

  • /wallops <message>
  • Sends the "message" to all operators connected to the server, or all users with user mode w set. similar to the unix wall command.

trace

  • /trace [target]
  • Trace a path across the IRC network to a specific server or client, in a similar method to traceroute.

User modes

Mode Description Prefix
+q User is owner of the current channel @ or ~ on UnrealIRCd
+a User is an admin (SOP) on the current channel @ or & on UnrealIRCd
+o User is an operator (AOP) on the current channel @
+h User is a half-op on the current channel %
+v User has voice on the current channel +

Kicking People

kick

  • /kick #channel nickname [reason]
  • temporarily remove user from channel
  • /mode nickname +/-attributes [data]
  • Setting people's modes (for current channel only)

Auto Kicks / AKICKs

People on the channel AKICK list are automatically kicked and banned upon joining the channel.

Bans made as a result of AKICKs must be removed manually.

akick add

  • /cs akick #channel add host [reason]
  • Adds host to #channel's AKICK list for "reason".

akick del

  • /cs akick #channel del host
  • Removes host from the AKICK list.

akick list/view

  • /cs akick #channel list
  • /cs akick #channel view
  • Displays the AKICK list.
    • command name varies between IRCd's

Banning

mode +b

  • /mode #channel +b hosts
  • Hosts take the following form: nickname!userid@hostname
    • Use /whois, /whowas or /who to find the necessary information
    • * is a wildcard and can replace nickname, userid, parts of nickname or userid, hostname or a segment of a hostname.

Examples

Remember, regex is your friend. People love to change their nicks to avoid bans, but often use a standard host, userid, or some other unique identifier.

nickname

  • joe!*@*
  • Prevents anyone with the nick joe from joining.

nick contains

  • *myg0t*!*
  • Prevents anyone whose nick contains myg0t from joining.

nick and userid

  • mark!*elc@*
  • Prevents anyone with the nick mark and the userid elc from joining.

hostname

  • *!*@c-123-24-76-213.ga.isp.net
  • Prevents anyone with the host c-123-24-76-213.ga.isp.net from joining.

rip

  • *!*@*
  • Bans everyone. Don't do that.

Access Lists

access add

  • /cs access #channel add [nickname] [level]
  • Adds nickname to the channel's access list at the specified level.

access del

  • /cs access channel del [nickname]
  • Removes nickname from the channel's access list.

access list

  • /cs access #channel list
  • Displays the channel's access list.

access count

  • /cs access #channel count
  • Displays how many entries are in the channel's access list.

Access Levels

Important Note: These may vary from network to network. For example, some networks do not go by tens and use 3, 4, 5, 10, etc.

Mode Description
Founder Full access to ChanServ functions, automatic opping upon entering channel.
100+ Makes the person an SOP, automatic opping upon entering channel.
50 Makes the parson an AOP, automatic opping upon entering channel.
40 Automatic half-opping.
30 Automatic voicing.
0 No special privileges.
-1 May not be opped.
-100 May not join the channel.

Default Value: Any nick not on the access list has an access level of 0.

AOPs and SOPs

AOP / Auto Operators

  • Are automatically ops and can give themselves ops.
  • Can give/take op/halfop/voice to/from other channel members.
  • Can unban themselves.
  • Receive memos sent to the whole channel.
  • Can invite themselves to the channel.

SOP / Super Operators

  • Can do everything AOPs can.
  • Can give and take AOP privileges.
  • Receive memos sent to the channel's SOPs.
  • Can add (but not remove) AKICKs.

Viewing/Setting Privileges

list

  • /cs aop #channel list
  • /cs sop #channel list
  • Viewing AOP and SOP lists

managing

  • /cs [AOP|SOP] channel [ADD|DEL|LIST|CLEAR] [nick | entry-list]
  • Modifies access privileges

Formatting

Even though IRC is a plain text protocol, it supports the use of color codes. Clients convert these codes to the appropriate terminal escape characters before rendering the message to the user.

ANSI Support

IRC has been around for a long time. Back in those days we used CP347 and ANSI. Even back then, IRC supported bold and color formatting via escape codes.

Limitations

If an IRC client cannot display a specified type of formatting, the client will do one of the following:

  • Display the message without the formatting (best case imho)
  • Display the formatting character in an obvious way, so users are aware that it was used. (e.g. uppercase U for underlining)
  • A bunch of junk will be printed to the screen

Types

Name HEX Support
Bold 0x02 Most (since ANSI)
Italics 0x1D Less common
Underline 0x1F Most
Strikethrough 0x1E Limited: Textual, HexChat, IRCCloud, TheLounge
Monospace 0x11 Very Limited: IRCCloud, TheLounge, Textual
Color 0x03 Most (since ANSI)

Colors

In most clients you can press control+c (^c) then foreground,background (background is optional).

Examples

  • ^c4 red text
  • ^c1,2 black text on a blue background

Color Codes

Here's the full list of color codes

Number Name
00 white
01 black
02 blue
03 green
04 red
05 brown
06 purple
07 orange
08 yellow
09 lime green
10 cyan
11 aqua
12 royal blue
13 pink
14 grey
15 light grey (silver)

Spoilers

This idea was created by the netizens of irc, not client developers

The effect is created by setting both the background and foreground color the same for a section of text, usually black on black. Readers can reveal the message by selecting or "hovering over" the block.


Misc

Clients

client platform applications
halloy desktop linux, mac windows
konversation desktop linux (kde)
kvirc desktop windows, mac
quassel desktop linux, mac, windows
irssi terminal linux, mac, windows, bsd
weechat terminal linux, mac, windows, bsd, android
sempai terminal linux, mac, windows, bsd
glirc terminal mac, linux
goguma mobile ios, android
irccloud web desktop browsers, ios, android

IRCd

IRC daemon code basis language released license
Bahamut IRCD-Hybrid C 1999 GPL
bIRCd DreamForge C 1999 GPL
Charybdis ircd-ratbox C 2005 BSD
ConferenceRoom Custom C++ 1996 Proprietary
csircd Custom C 1998 GPL
InspIRCd Custom C++ 2002 GPL
IRCd Custom C 1988 GPL
ircd-hybrid irc2.8 C 1997 GPL
ircd-ratbox Hybrid C 2002 GPL
ircu irc2.7 C 1991 GPL
ithildin Custom C 2006 BSD
Nefarious IRCu ircu2 C 2004 GPL
ngIRCd Custom C 2001 GPL
OfficeIRC Custom VB.NET 2006 Proprietary
PleXusIRCd Hybrid C 2005 GPL
pureIRCd Custom C 2002 GPL
ShadowIRCd Charybdis C 2008 GPL
solid-ircd Bahamut C ? GPL
Synchronet IRCd Custom Javascript 2003 GPL
UnrealIRCd DreamForge C 1999 GPL
WeIRCd Custom C 2007 GPL

Suggested Servers/Networks

Network Website Server
Rizon https://rizon.net irc://rizon
Cyberia https://cyberia.is irc://cyberia.is
UnixChat https://unix.chat irc://unix.chat
IRCLand https://irc.land irc://irc.land
QuakeNet http://quakenet.org irc://quakenet
SwiftIRC http://swiftirc.net irc://swiftirc
Libera http://libera.chat irc://libera.chat
Snoonet http://snoonet.org irc://snoonet
h4x0red https://h4x0.red irc://h4x0.red
~ town https://tilde.town hidden service
IRC Cloud https://irccloud.com multiple endpoints
theLounge https://thelounge.chat self hosted

Glossary

  • IRC - Acronym for Internet Relay Chat, a text based chat protocol.
  • IRCd - IRC Daemon, the technical name for IRC server software.
  • channel - IRC's equivalent term for a "chat room", or group chat. Names are prefaced with a pound sign (e.g. #channel_name), and are unique to a server.
  • msg or priv msg - An abbreviation for "Message" or "Private Message". Any messages given across IRC are private between two people rather than to a channel where anyone in the channel can see.
  • op - Someone with Operator status. They are marked by a @ or ~ symbol next to their name and it means they have some degree of power in a channel to change settings, kick people out and so on.
  • afk - acronym for "Away From Keyboard". Often used in /away messages, it indicates that a connected use is unavailable to chat for a period of time.
  • bot - An IRC bot or Chat Bot, is software that runs on a remove computer and connects into an IRC server like a normal user and read the logs looking for actionable events. They can perform various automated or manual tasks, such as user commands, managing user privileges, combining messages, providing detailed link information, or hosting games.

Sauces

Footnotes

  1. In accordance with the irc spec, no IRCd will allow a user to use a nick beginning with a number. This is a security mitigation to prevent accidental misinterpretation of a nick as a valid UID or SIP.

    Examples: 0SOMENICK is a valid UID. 0AA is a valid SID, which could be used by middleware.

    Valid nick format: nickname = ( letter / special ) *8( letter / digit / special / "-" )

@Makhdoom625
Copy link

can we broke the +i ?????

@Cvar1984
Copy link

I make irc bot using fsocket, that command is not working

@xero
Copy link
Author

xero commented Jun 24, 2020

There needs to be a space after # for the parser correctly parse the headings. :)

that was a change to gh md after i made this gist. i fixed that and added a note about the shorthand syntax support.

i think it funny ppl still use this cheatsheet xD
@neeasade even mirrored it on his blog <3 https://notes.neeasade.net/xeros-irc-ref.html

@bor8
Copy link

bor8 commented Jun 30, 2020

What about /j #channel to join a channel?

@deathstalkr
Copy link

How do I remove all nick registered to my email address?

@jfudally
Copy link

jfudally commented Jan 4, 2021

Who else is here because of the Slack outage 😂 ?

@abrantesasf
Copy link

Thank you very much! This information is pure gold!

@Padraig369
Copy link

How do I find the channel operator ip address and what server they are connected to?

@bor8
Copy link

bor8 commented Apr 18, 2021

Use /whois <NICKNAME>, /whowas <NICKNAME> or /who <NICKNAME>.

@Padraig369
Copy link

Thanks Bor8. Just to confirm, I am new at IRC. I've logged onto an IRC page which I did not set up but I am down as @. What little I know about IRC it would mean I am the page operator, which I am not. Is it just the case that the first logon to the page is the operator?

@bor8
Copy link

bor8 commented Apr 18, 2021

Yes. You mean channel (and not page).

@Woolton
Copy link

Woolton commented Sep 12, 2021

So how do you SET the topic?

@xero
Copy link
Author

xero commented Sep 14, 2021

So how do you SET the topic?

/topic this is the new channel topic

only works if you have permission to do so

@keven-mate
Copy link

How to mention a user?

@xero
Copy link
Author

xero commented Oct 12, 2021

@keven-mate there's nothing in the itc spec about mentions. most clients just highlight on the user's handle. but that's client implementation specific. convention is to start with the username then some separator. eg username: whatever - an underlined colon was very popular in the late nineteen hundreds irc servers i frequented.

@keven-mate
Copy link

@xero I use Hexchat, I guess I will have to manually add colors, thanks a lot.

@zneix
Copy link

zneix commented May 22, 2022

Nice gist with quite some reference. I suggest you can expand the user modes list with some extra ones, like +x or +r which I find to be quite common. Reference: https://irc-nerds.com/wiki/index.php/User_Modes

@MPC7500
Copy link

MPC7500 commented Sep 22, 2023

You could/ should also add the command for changing the email ;-)

@sean-who
Copy link

it looks like part of your explanation of /ns identify password was deleted by mistake while updating the markdown:

"Identifies your nick to NickServ using the password you set. If you have a nick that's been registered, and you don't i"

here is the complete explanation as it appears in a previous revision:

"Identifies your nick to NickServ using the password you set. If you have a nick that's been registered, and you don't identify or change it, NickServ will forcibly change it after a short time, usually a minute or two."

@xero
Copy link
Author

xero commented Oct 29, 2024

What about /j #channel to join a channel?

@bor8 that's actually a client alias for /join, it's not in the spec, though most clients do support that shorthand and others.

Under no circumstances should you change your nick to the letter O followed by 8 digit

What is this about?

@vercruyce i added a footnote for ya

https://gist.github.com/xero/2d6e4b061b4ecbeb9f99#user-content-fn-nickformat-8920ccd72db6fdd4dd066c9fef66a647

In accordance with the irc spec, no IRCd will allow a user to use a nick beginning with a number. This is a security mitigation to prevent accidental misinterpretation of a nick as a valid UID or SIP.
Examples: 0SOMENICK is a valid UID. 0AA is a valid SID, which could be used by middleware.
Valid nick format: ( letter / special ) *8( letter / digit / special / "-" )

it's been almost a decade since i 1st wrote this document. it was originally designed as a opper cheatsheet. but it's now one the of the top google results for "irc reference". so i've taken the time to rerwite this document from both sides. there's now a brief history lesson, glossary, user commands, nickserv, chanserv, operserv, popular clients and ircd's, and other reference materials in this document. please let me know other "good" active servers to add to the list at the bottom. i just added my personal favs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment