readme.txt (8240B)
1 sirc - simple irc 2 ================= 3 4 A simple multi-server terminal IRC client written in C. Single source file, no runtime 5 dependencies beyond ncurses, OpenSSL, and pthreads. 6 7 8 LAYOUT 9 ------ 10 11 +------------------+--------------------------------------------------+----------------+ 12 | CHANNELS | Don't paste spam. Use a pastebin. Be excellent. | USERS (42) | 13 | +--------------------------------------------------+ | 14 | irc.libera.chat | 12:34 -> alice joined | @ChanServ | 15 | *status* | 12:34 <kky> hello everyone | @alice | 16 | > #python | 12:34 <alice> hey! | +bob | 17 | + #linux | | charlie | 18 | | | | 19 | irc.oftc.net | | | 20 | *status* | | | 21 | #debian | > _ | | 22 +------------------+--------------------------------------------------+----------------+ 23 24 Header bar -- topic of the active channel. Blank if no topic is set. 25 Starts from the left, truncated on the right if too long. 26 27 Channel list -- grouped by server hostname. A ~ prefix on the server name 28 means disconnected. Channel indicators: 29 > active channel 30 + unread messages 31 ! unread mention of your nick 32 *status* appears under each server for system/server messages. 33 Reachable via Ctrl+N/P like any other buffer. 34 35 Chat area -- colour scheme: 36 <nick> per-nick hashed colour (bold) 37 message body plain white 38 own messages yellow bold 39 mentions red bold 40 actions (/me) magenta italic 41 join/part gray 42 URLs blue underline 43 IRC formatting codes (^B bold, ^C colour, etc.) are stripped 44 before display. 45 46 User list -- sorted by privilege then alphabetically within each group: 47 ~ founder/owner (red bold) 48 & protected op (red bold) 49 @ op (red bold) 50 % halfop (yellow bold) 51 + voice (yellow bold) 52 regular (white) 53 54 Input -- prompt shows "> " with a blinking cursor as you type. 55 56 57 BUILD 58 ----- 59 60 Dependencies: 61 62 Library Arch Debian/Ubuntu 63 ------- ---- ------------- 64 ncurses ncurses libncurses-dev 65 OpenSSL openssl libssl-dev 66 pthreads (glibc) (glibc) 67 68 Build: 69 70 make 71 72 Install to ~/.local/bin/irc: 73 74 make install 75 76 System-wide: 77 78 PREFIX=/usr/local make install 79 80 81 USAGE 82 ----- 83 84 ./irc [options] 85 86 CLI options configure a single server. For multiple servers use a config file. 87 88 --host HOST server hostname (default: irc.libera.chat) 89 --port PORT server port (default: 6697) 90 --nick NICK nickname (default: circ_user) 91 --channel CHAN channel(s) to join, comma-separated 92 --tls enable TLS (default: on) 93 --no-tls disable TLS (plain, typically port 6667) 94 --sasl-user USER SASL username 95 --sasl-pass PASS SASL password 96 --config FILE path to config file 97 98 Examples: 99 100 # TLS with SASL 101 ./irc --host irc.libera.chat --nick kky --sasl-user kky --sasl-pass hunter2 102 103 # Plain text 104 ./irc --host irc.libera.chat --port 6667 --no-tls --nick kky 105 106 # Join multiple channels 107 ./irc --host irc.libera.chat --nick kky --channel '#python,#linux' 108 109 110 CONFIG FILE 111 ----------- 112 113 Loaded from ~/.ircrc or ~/.config/irc/ircrc (first found wins). 114 CLI flags override the first server in the config. 115 116 Use [server] blocks for multiple servers. Each block is an independent 117 connection with its own nick, channels, and credentials. All servers 118 connect simultaneously on startup. 119 120 # Global defaults (before any [server] block) 121 nick = kky 122 ignore = badbot,spammer 123 124 [server] 125 host = irc.libera.chat 126 port = 6697 127 tls = true 128 channel = #python,#linux 129 sasl_user = kky 130 sasl_pass = hunter2 131 132 [server] 133 host = irc.oftc.net 134 port = 6697 135 tls = true 136 channel = #debian,#tor 137 138 [server] 139 host = irc.rizon.net 140 port = 6667 141 tls = false 142 nick = kky_rizon 143 channel = #rice 144 145 Per [server] keys: 146 147 host server hostname 148 port port number 149 nick nickname for this server 150 channel comma-separated channels to auto-join 151 tls true / false 152 sasl_user SASL PLAIN username 153 sasl_pass SASL PLAIN password 154 155 Global keys (before any [server] block): 156 157 nick default nick inherited by all servers 158 ignore comma-separated nicks to ignore globally 159 160 161 COMMANDS 162 -------- 163 164 All commands act on the current server (server of the active channel). 165 166 Messaging: 167 /msg <nick> <text> open a private message window 168 /notice <target> <text> send a NOTICE 169 /me <text> CTCP ACTION (* nick text) 170 /ctcp <nick> <cmd> send a raw CTCP request 171 172 Channels: 173 /join [#chan] join a channel 174 /part [#chan] leave a channel (defaults to current) 175 /cycle [#chan] part and immediately rejoin 176 /names [#chan] list users in a channel 177 /topic [text] get the current topic, or set a new one 178 /invite <nick> [#chan] invite someone to a channel 179 /kick <nick> [reason] kick a user from the current channel 180 /mode [target] [modes] get or set channel/user modes 181 182 Users: 183 /nick show your current nickname 184 /nick <n> change your nickname 185 /whois <nick> full whois lookup 186 /who [target] WHO query on a channel or nick 187 /away [message] set an away message 188 /back clear away status 189 /ignore [nick] ignore a nick (no arg = list ignored nicks) 190 /unignore <nick> stop ignoring a nick 191 192 Server: 193 /list [pattern] list channels on the current server 194 /raw <line> send a raw IRC line (alias: /quote) 195 /server <host> [port] connect to an additional server at runtime 196 /connect reconnect the current server 197 /quit [message] disconnect all servers and exit 198 199 UI: 200 /clear clear the current channel's scrollback 201 /help show command reference in *status* 202 203 204 KEYS 205 ---- 206 207 Tab nick completion -- cycle through matches 208 colon suffix (nick: ) added at start of line 209 Ctrl+N next channel 210 Ctrl+P previous channel 211 PgUp scroll chat up 212 PgDn scroll chat down 213 Ctrl+W delete word left 214 Up / Down step through input history 215 Left / Right move cursor 216 Home / End jump to start/end of input 217 Delete delete character under cursor 218 219 220 FEATURES 221 -------- 222 223 - Multiple simultaneous servers, each with its own thread, nick, channels 224 - TLS via OpenSSL with certificate verification (SSL_VERIFY_PEER) 225 - SASL PLAIN authentication per server, before registration 226 - Auto-reconnect with 5-second backoff, rejoins all open channels 227 - Per-nick colours: djb2 hash -> 8 colours, consistent in chat and user list 228 - IRC formatting stripped: bold, colour, italic, underline, reset, etc. 229 - Topic shown in header bar, updated live on TOPIC messages 230 - URLs (http://, https://, www.) rendered with blue underline 231 - Nick tab-completion with cycling 232 - Ring buffer scrollback: 500 lines per channel, O(1) insert 233 - Global ignore list, loadable from config 234 235 236 LIMITS 237 ------ 238 239 Max servers 8 240 Max channels (total) 128 241 Users per channel 512 242 Scrollback per channel 500 lines 243 Input line length 480 chars 244 Input history 256 lines 245 Ignore list 64 nicks 246 Auto-join channels/server 16 247 248 249 LICENSE 250 ------- 251 252 MIT