aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 838a74f9cefff44b0ba8243d037f6317506547ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<h3 align="center"><img src="https://raw.githubusercontent.com/mcpcpc/kirc/master/.github/kirc.png" alt="logo" height="170px"></h3>
<p align="center">KISS for IRC, a tiny IRC client written in POSIX C99.</p>
<p align="center">
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
<a href="https://github.com/mcpcpc/kirc/releases"><img src="https://img.shields.io/github/v/release/mcpcpc/kirc.svg"></a>
<a href="https://repology.org/metapackage/kirc"><img src="https://repology.org/badge/tiny-repos/kirc.svg" alt="Packaging status"></a>
</p>

## Objectives

_"Do one thing and do it well"_  —  Emphasis was placed on building simple, short, clear, modular, and extensible code that can be easily maintained and repurposed (per the [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy)).

_Portability_ — [POSIX](https://en.wikipedia.org/wiki/POSIX) compliance ensures seamless compatibility and interoperability between variants of Unix and other operating systems.

_Usability_ — Commands and shortcuts should feel "natural" when using a [standard 104-key US keyboard layout](https://en.wikipedia.org/wiki/Keyboard_layout).  Where possible, the number of keystrokes have been minimized.

## Usage

```shell
usage: kirc [-s hostname] [-p port] [-c channel] [-n nick] [-r real name] [-u username] [-k password] [-x init command] [-w columns] [-W columns] [-o path] [-h|v|V]
-s     server address (default: 'irc.freenode.org')
-p     server port (default: '6667')
-c     channel name (default: 'kirc')
-n     nickname (required)
-u     server username (optional)
-k     server password (optional)
-a     SASL PLAIN authentication token (optional)
-r     real name (optional)
-v     version information
-V     verbose output (e.g. raw stream)
-o     output path to log irc stream
-x     send command to irc server after inital connection
-w     maximum width of the printed left column (default: '10')
-W     maximum width of the entire printed stream (default '80')
-h     basic usage information
```

## Features

* No dependencies other than a [C99 compiler](https://gcc.gnu.org/).
* Complies with [RFC 2812](https://tools.ietf.org/html/rfc2812) standard.
* Ability to log the entire chat history  (see _Usage_ section for more information).
* Simple command structure:

```shell
<message>                   Send a message to the current channel.
/m <nick|channel> <message> Send a message to a specified channel or nick.
/M <message>                Send a message to NickServ.
/Q <message>                Send a message and close the host connection.
/x <message>                Send a message directly to the server.
/j <channel>                Join a specified channel.
/p <channel>                Leave (part) a specified channel.
/u <channel>                Assign new default message channel.
/n                          List all users on the current channel.
/q                          Close the host connection.
/h                          Print a list of available kirc commands.
```

* Color scheme definition via [ANSI 8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code). Therefore, one could theoretically achieve uniform color definition across all shell applications and tools.

## Screenshots

![Screenshot 1](/.github/example.png)

## Installation

Building and installing on **KISS Linux** using the Community repository:

```shell
kiss b kirc
kiss i kirc
```

Building and installing on **Arch** and **Arch-based** distros using the AUR:

```shell
git clone https://aur.archlinux.org/kirc-git.git
cd kirc
makepkg -si
```

Building and installing from source (works on **Raspbian**, **Debian**, **Ubuntu** and many other Unix distributions):

```shell
git clone https://github.com/mcpcpc/kirc.git
cd kirc
make
make install
```

## Transport Layer Security (TLS)  Support

There is no native [TLS/SSL](https://en.m.wikipedia.org/wiki/Transport_Layer_Security) support.  Instead, users can achieve this functionality by using third-party tools (e.g. stunnel, socat, ghosttunnel).

* _socat_ example:

```shell
socat tcp-listen:6667,reuseaddr,fork,bind=127.0.0.1 ssl:<irc-server>:6697
kirc -s 127.0.0.1 -c 'channel' -n 'name' -r 'realname'
```

## SASL Support

In order to connect using SASL PLAIN authentication, the user must provide the required token during the initial connection. If the authentication token is base64 encoded and, therefore, can be generated a number of ways.  For example, using Python, one could use the following:

```shell
python -c 'import base64; print(base64.encodebytes(b"nick\x00nick\x00password"))'
```

For example, lets assume an authentication identity of `jilles` and password `sesame`:

```shell
$ python -c 'import base64; print(base64.encodebytes(b"jilles\x00jilles\x00sesame"))'
b 'amlsbGVzAGppbGxlcwBzZXNhbWU=\n'
$ kirc -n jilles -a amlsbGVzAGppbGxlcwBzZXNhbWU=
```

## Contact

For any further questions or concerns, feel free to reach out to me on `#kirc`
or `#kisslinux` channels of the _irc.freenode.org_ server.