Skip to content
Dialova

IRC Documentation · Advanced

CAP Command: List and Negotiate Extensions

CAP is the IRC extension negotiation command. It allows a client to enable mechanisms it understands. The IRCv3 CAP guide details the state machine; this sheet gives the syntax to recognize in a log.

Dialova Team · Verified on

Syntax and Parameters #

Protocol syntax, without the client's '/'
CAP <LS [302] | LIST | REQ :<capacités> | END>
ParameterMeaning
LS 302Requests the list with the modern announcement mechanism, including values and potentially fragmented responses.
REQRequests activation of selected capabilities; ACK or NAK responds to the request.
LIST / ENDLIST describes active capabilities; END terminates registration suspension.

Commented Example #

IRC Exchange: C = client, S = server
C: CAP LS 302
C: NICK Alice
C: USER alice 0 * :Alice
S: :irc.example CAP * LS :message-tags server-time
C: CAP REQ :server-time
S: :irc.example CAP Alice ACK :server-time
C: CAP END

Nicknames, hosts, and text in this exchange are fictional. The client may display responses in a more readable format than the presented frames.

Possible Responses and Errors #

ResponseUnderstanding
CAP LSProposed list; the intermediate * marker indicates continuation.
CAP ACK / NAKActivation accepted or request rejected.
CAP LISTList of active capabilities.
ErrorTypical Cause
410Invalid CAP subcommand according to the implementation.
421Historical server not recognizing CAP.

Rights, Compatibility, and Precautions #

An LS announcement activates nothing. The client should only use a capability after its activation. CAP END does not send a message to a channel: it is a connection step.

CAP can also function after registration. However, subcommands, the announced version, and NEW/DEL notifications must be interpreted according to the specification. The value of a capability, for example sasl=PLAIN, is not its name.

Frequently Asked Questions #

Why does CAP appear without /? This refers to the protocol; the interface handles this command internally.

Do CAP and 005 ISUPPORT do the same thing? No: ISUPPORT describes properties and limits; CAP activates negotiated extensions.

Sources & Verification

Examples use pseudonyms and fictional domains, except for explicitly documented connection points. Network-specific extensions and settings are noted in the text.