2018-02-24 17:15:45 +01:00
|
|
|
# gomuks
|
2018-03-23 00:21:43 +01:00
|
|
|
![Languages](https://img.shields.io/github/languages/top/tulir/gomuks.svg)
|
2020-02-18 20:31:28 +01:00
|
|
|
[![License](https://img.shields.io/github/license/tulir/gomuks.svg)](LICENSE)<!--
|
|
|
|
[![Release](https://img.shields.io/github/release/tulir/gomuks/all.svg)](https://github.com/tulir/gomuks/releases)-->
|
2019-07-26 00:17:01 +02:00
|
|
|
[![GitLab CI](https://mau.dev/tulir/gomuks/badges/master/pipeline.svg)](https://mau.dev/tulir/gomuks/pipelines)
|
2018-04-22 19:23:33 +02:00
|
|
|
[![Maintainability](https://img.shields.io/codeclimate/maintainability/tulir/gomuks.svg)](https://codeclimate.com/github/tulir/gomuks)
|
2018-03-23 00:21:43 +01:00
|
|
|
|
2018-04-17 16:29:12 +02:00
|
|
|
![Chat Preview](chat-preview.png)
|
2018-03-16 15:33:33 +01:00
|
|
|
|
2019-06-15 00:05:21 +02:00
|
|
|
A terminal Matrix client written in Go using [mautrix](https://github.com/tulir/mautrix-go) and [mauview](https://github.com/tulir/mauview).
|
2018-03-13 22:02:19 +01:00
|
|
|
|
2018-03-20 11:16:32 +01:00
|
|
|
Basic usage is possible, but expect bugs and missing features.
|
2018-03-15 20:53:50 +01:00
|
|
|
|
2018-03-16 15:46:05 +01:00
|
|
|
## Discussion
|
|
|
|
Matrix room: [#gomuks:maunium.net](https://matrix.to/#/#gomuks:maunium.net)
|
|
|
|
|
2018-03-15 20:53:50 +01:00
|
|
|
## Installation
|
|
|
|
Once the client becomes actually usable, I'll start making GitHub releases with
|
2020-02-18 20:31:28 +01:00
|
|
|
precompiled executables. For now, you can either download a CI build from
|
|
|
|
[GitLab CI](https://mau.dev/tulir/gomuks/pipelines) or compile from source:
|
2018-03-15 20:53:50 +01:00
|
|
|
|
2019-04-27 14:02:21 +02:00
|
|
|
0. Install [Go](https://golang.org/) 1.12 or higher
|
2019-02-04 18:13:24 +01:00
|
|
|
1. Clone the repo: `git clone https://github.com/tulir/gomuks.git && cd gomuks`
|
|
|
|
2. Build: `go build`
|
2018-03-16 15:35:52 +01:00
|
|
|
|
2019-02-04 18:13:24 +01:00
|
|
|
Simply pull changes (`git pull`) and run `go build` again to update.
|
2018-10-18 14:55:17 +02:00
|
|
|
|
2020-02-25 19:46:24 +01:00
|
|
|
## Debugging
|
|
|
|
If something doesn't work but it doesn't crash, check the `/tmp/gomuks/debug.log` file for any errors.
|
|
|
|
|
2019-02-04 18:13:24 +01:00
|
|
|
## Developing
|
2019-04-27 14:44:11 +02:00
|
|
|
Set `DEBUG=1` to enable partial deadlock detection and to write panics to stdout instead of a file.
|
|
|
|
|
|
|
|
To build and run with [race detection](https://golang.org/doc/articles/race_detector.html),
|
|
|
|
use `go install -race` and set `GORACE='history_size=7 log_path=/tmp/gomuks/race.log'`
|
|
|
|
when starting gomuks, then check `/tmp/gomuks/race.log.<pid>`. Note that race detection
|
|
|
|
will use a lot of extra resources.
|
|
|
|
|
2020-02-25 19:46:24 +01:00
|
|
|
Proper debuggers are too fancy, but normal prints won't work in a TUI application. To write to the
|
|
|
|
debug log mentioned previously, use the `maunium.net/go/gomuks/debug` package:
|
|
|
|
|
2018-10-18 14:55:17 +02:00
|
|
|
```go
|
2019-04-27 14:44:11 +02:00
|
|
|
package foo
|
|
|
|
|
2018-10-18 14:55:17 +02:00
|
|
|
import (
|
|
|
|
"maunium.net/go/gomuks/debug"
|
|
|
|
)
|
2019-04-27 14:44:11 +02:00
|
|
|
|
2018-10-18 14:55:17 +02:00
|
|
|
func Foo() {
|
|
|
|
debug.Print("WHY ISN'T IT WORKING?!?!?")
|
2019-04-27 14:44:11 +02:00
|
|
|
debug.PrintStack()
|
2018-10-18 14:55:17 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2018-03-16 15:35:52 +01:00
|
|
|
## Usage
|
2018-05-20 23:39:20 +02:00
|
|
|
- switch rooms - `Ctrl + ↑` `Ctrl + ↓` `Alt + ↑` `Alt + ↓`
|
2019-04-27 14:44:11 +02:00
|
|
|
- ~~scroll chat (line) - `↑` `↓`~~
|
2018-05-20 23:39:20 +02:00
|
|
|
- scroll chat (page) - `PgUp` `PgDown`
|
|
|
|
- jump to room - `Alt + Enter`, then `Tab` and `Enter` to navigate and select room
|
2018-03-16 15:35:52 +01:00
|
|
|
|
|
|
|
### Commands
|
2020-02-25 19:46:24 +01:00
|
|
|
#### General
|
|
|
|
* `/help` - View command list.
|
|
|
|
* `/quit` - Close gomuks.
|
|
|
|
* `/clearcache` - Clear room state and close gomuks.
|
|
|
|
* `/logout` - Log out, clear caches and go back to the login view.
|
|
|
|
* `/toggle <rooms/users/baremessages/images/typingnotif>` - Change user preferences.
|
|
|
|
|
|
|
|
#### Sending special messages
|
|
|
|
* `/me <text>` - Send an emote.
|
|
|
|
* `/notice <text>` - Send a notice (generally used for bot messages).
|
|
|
|
* `/rainbow <text>` - Send rainbow text (markdown not supported).
|
|
|
|
* `/rainbowme <text>` - Send rainbow text in an emote.
|
2020-02-29 23:33:37 +01:00
|
|
|
* `/reply [text]` - Reply to the selected message. If text is not specified, the next message will be used.
|
|
|
|
* `/react <reaction>` - React to the selected message.
|
|
|
|
* `/redact` - Redact the selected message.
|
2020-02-25 19:46:24 +01:00
|
|
|
|
|
|
|
#### Rooms
|
|
|
|
##### Creating
|
|
|
|
* `/pm <user id> [...]` - Start a private chat with the given user(s).
|
|
|
|
* `/create [room name]` - Create a new room.
|
|
|
|
##### Joining
|
|
|
|
* `/join <room> [server]` - Join the room with the given room ID or alias, optionally through the given server.
|
|
|
|
* `/accept` (in a room you're invited to) - Accept the invite.
|
|
|
|
* `/reject` (in a room you're invited to) - Reject the invite.
|
|
|
|
##### Existing
|
|
|
|
* `/invite <user id>` - Invite the given user ID to the room.
|
|
|
|
* `/roomnick <name>` - Change your per-room displayname.
|
|
|
|
* `/tag <tag> <priority>` - Add the room to `<tag>`. `<tag>` should start with `u.` and `<priority>`
|
|
|
|
should be a float between 0 and 1. Rooms are sorted in ascending priority order.
|
|
|
|
* `/untag <tag>` - Remove the room from `<tag>`.
|
|
|
|
* `/tags` - List the tags the room is in.
|
|
|
|
##### Leaving
|
|
|
|
* `/leave` - Leave the current room.
|
|
|
|
* `/kick <user id> [reason]` - Kick a user.
|
|
|
|
* `/ban <user id> [reason]` - Ban a user.
|
|
|
|
* `/unban <user id>` - Unban a user.
|
|
|
|
|
|
|
|
#### Raw events
|
|
|
|
* `/send <room id> <event type> <content>` - Send a custom event.
|
|
|
|
* `/setstate <room id> <event type> <state key/-> <content>` - Change room state.
|
|
|
|
* `/msend <event type> <content>` - Send a custom event to the current room.
|
|
|
|
* `/msetstate <event type> <state key/-> <content>` - Change room state in the current room.
|
|
|
|
* `/id` - Get the current room ID.
|
|
|
|
|
|
|
|
#### Debugging
|
|
|
|
* `/hprof` - Create a heap profile and write it to `gomuks.heap.prof` in the current directory.
|
|
|
|
* `/pprof <seconds>` - Profile the CPU usage for the given number of seconds and write it to `gomuks.cpu.prof`.
|
|
|
|
* `/trace <seconds>` - Trace calls for the given number of seconds and write traces to `gomuks.trace`.
|