GithubHelp home page GithubHelp logo

jpbruinsslot / slack-term Goto Github PK

View Code? Open in Web Editor NEW
6.4K 76.0 227.0 50.11 MB

Slack client for your terminal

License: MIT License

Makefile 1.11% Go 98.52% Dockerfile 0.37%
go golang slack terminal tui cli

slack-term's Introduction

slack-term

A Slack client for your terminal.

Screenshot

Installation

Binary installation

Download a compatible binary for your system. For convenience, place slack-term in a directory where you can access it from the command line. Usually this is /usr/local/bin.

$ mv slack-term /usr/local/bin

Via Go

If you want, you can also get slack-term via Go:

$ go get -u github.com/erroneousboat/slack-term
$ cd $GOPATH/src/github.com/erroneousboat/slack-term
$ go install .

Via docker

You can also run it with docker, make sure you have a valid config file on your host system.

docker run -it -v [config-file]:/config erroneousboat/slack-term

Setup

  1. Get a slack token, click here

  2. Running slack-term for the first time, will create a default config file at ~/.config/slack-term/config.

$ slack-term
  1. Update the config file and update your slack_token For more configuration options of the config file, see the wiki.
{
    "slack_token": "yourslacktokenhere"
}

Usage

When everything is setup correctly you can run slack-term with the following command:

$ slack-term

Default Key Mapping

Below are the default key-mappings for slack-term, you can change them in your config file.

mode key action
command i insert mode
command / search mode
command k move channel cursor up
command j move channel cursor down
command g move channel cursor top
command G move channel cursor bottom
command K thread up
command J thread down
command G move channel cursor bottom
command pg-up scroll chat pane up
command ctrl-b scroll chat pane up
command ctrl-u scroll chat pane up
command pg-down scroll chat pane down
command ctrl-f scroll chat pane down
command ctrl-d scroll chat pane down
command n next search match
command N previous search match
command , jump to next notification
command q quit
command f1 help
insert left move input cursor left
insert right move input cursor right
insert enter send message
insert esc command mode
search esc command mode
search enter command mode

slack-term's People

Contributors

codegoalie avatar jpbruinsslot avatar lhanson avatar mfcochauxlaberge avatar mtpereira avatar popey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slack-term's Issues

White background support

The theme that is used from termui is almost not visible with a white background. See if changing the termui theme can help. Take note that the background and foreground of the cursor of channels is fixed on a specific color, so this has to be changed according to the selected theme.

Don't load messages immediately when switching channels

If you keep pressing j or k it's really slow at the moment because before stepping to the next channel it'll load all the messages of the current one. If you'd wait a little before loading them that would speed up the channel switching cause the app wouldn't load all and every message for the channels you've skipped.

Cursor move bug

When typing Chinese or Japanese characters in insert mode, the cursor only moves half of the space of character(the space of an English letter).

Mute channels

A user should be able to mute channels so that notifications will be suppressed.

Hide channels and private messages

It doesn't seem like there is a way to archive or leave a direct message or group message. It would be great if there was a hot key + confirmation to remove a channel from the sidebar list.

invalid character 'j' looking for beginning of value

I got the token for slack and applied it to slack-term.json, but when I try to initiate the app I get the msg: ERROR: not able to load config file (~/slack-term.json): invalid character 'j' looking for beginning of value

any thoughts on what might be wrong?

thanks

Make slack-term.json a dotfile

No need to clutter the home directory. At least make it optional to have it as ~/.slack-term.json instead to live with all other config files.

Crashes on launch using default configuration

When I install slack-term and launch it using the default configuration in the README, replacing the token with one I have generated for myself, it crashes with the following error.

2017/03/09 15:17:18 ERROR: not able to load config file (/Users/xxx/slack-term.json): invalid character '/' looking for beginning of object key string

Removing the comments from the config file returns a different error.
017/03/09 15:26:33 ERROR: not able to load config file (/Users/xxx/slack-term.json): invalid character '}' looking for beginning of object key string

Removing the closing comma from the following line fixes the issue:
"<space>": "space",

It appears that there is no handler for slash based comments in the slack-term default config and the default config in the README has a typo with the extra comma.

panic runtime error

Getting random panics while typing, mostly when using backspace:

panic: runtime error: slice bounds out of range 
goroutine 19 [running]:
github.com/erroneousboat/slack-term/vendor/github.com/nsf/termbox-go.PollEvent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/kalbasit/code/profiles/opensource/src/github.com/erroneousboat/slack-term/vendor/github.com/nsf/termbox-go/api.go:330 +0x44f
github.com/erroneousboat/slack-term/handlers.eventHandler.func1(0xc420433600)
	/home/kalbasit/code/profiles/opensource/src/github.com/erroneousboat/slack-term/handlers/event.go:50 +0x30
created by github.com/erroneousboat/slack-term/handlers.eventHandler
	/home/kalbasit/code/profiles/opensource/src/github.com/erroneousboat/slack-term/handlers/event.go:52 +0x3f

Need to reload messages after editing

Chat view from slack-term client.

[18:57] <offclient> some string                                                                                                                           [18:57] <unknown> 
[18:57] <unknown> 
[18:57] <unknown> 
[18:57] <unknown> 

Case: user from official client send message to channel. [18:57] <offclient> some string, than start edit sent message. On each edit term client shows [18:57] <unknown>.

Crash on first launch

On the first launch on macOS Sierra, I got this:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x161603]

goroutine 16 [running]:
panic(0x291780, 0xc42000a0b0)
    /usr/local/go/src/runtime/panic.go:500 +0x1a1
golang.org/x/net/websocket.(*Conn).SetWriteDeadline(0x0, 0xecf9b4673, 0x329892cc, 0x431b60, 0xc420168380, 0x0)
    /home/jp/go/src/golang.org/x/net/websocket/websocket.go:269 +0x43
github.com/nlopes/slack.(*RTM).connect(0xc42008fc20, 0x1, 0x0, 0x0, 0x0, 0x0)
    /home/jp/go/src/github.com/nlopes/slack/websocket_managed_conn.go:94 +0x266
github.com/nlopes/slack.(*RTM).ManageConnection(0xc42008fc20)
    /home/jp/go/src/github.com/nlopes/slack/websocket_managed_conn.go:32 +0x44
created by github.com/erroneousboat/slack-term/src/service.NewSlackService
    /home/jp/go/src/github.com/erroneousboat/slack-term/src/service/slack.go:36 +0x42d

I just thought I'd report the crash. On second launch all is well, and I cannot currently reproduce this.

ability to show only subscribed groups/chats

When signing in to slack-term I see all the chats I've ever been on, not just the current ones. I also see all 200 members of staff in my org, as well as all the different project and talk groups. I only want to see the ones I'm subscribed to.

Is there any way to show just those ones?
Also, I seem unable to get search with / working - the mode does not change. Using the example keybindings

Slack integrations not rendered correctly

Some integrations are not rendered correctly and shown as "unknown". This happens for instance with the git slack integration. It could be that the submessage has info in it.

Input overflow

When typing in input and reaching the end of the input it would be nice to have an overflow.

Choose between:

  • Scrollable input: can create multi line messages
  • Left/Right overflow

Attachments / multi line messages

Create some sort of support for attachment / multi line messages. Now it's just and empty message and the sender will be rendered as "unknown".

Windows Support

I know that windows support isn't planned, but it actually works, besides a bug

Environment

  • Windows 10
  • Cmder

Report

  • Need to do a double stroke to send commands and write text.

Implement other keys

  • chat pane; scrolling, vim style
  • channels; scrolling, arrow keys
  • channels; scrolling, vim style gg, G
  • input; delete
  • input; other keys

Can't open configuration file

Hi.

I created a configuration file in my home folder under .config/slack.

I'm trying to load it, but it keeps saying this:

2016/10/18 16:36:53 ERROR: not able to load config file: /Users/<user>/.config/slack/slack-term.json

And then hangs my terminal. The terminal is no longer accessible.

It's because your example JSON file has a syntax error. :P It's missing a , after the first token.

Adjust sidebar width

It would be great to have a way to make the sidebar wider or narrower. Perhaps a preference in the .json file?

slack-term does not seem to be installed after running the go get command (OS X Sierra)

Hello, I'm experimenting with your Slack CLI client and I've ran the command go get to fetch the package like told in the README. However, after installing I don't seem to have the slack-term command. I've also tried to look into my bin directories but couldn't find anything.

Maybe I'm using the go command in a wrong way, or maybe OS X is not supported?

Tell me if you need any further info

Thanks

Parameter name checking before running the applicaton

Hey,

So I've just started to play around with your app and it seems really nice but I faced an error first time. When I created my slack-term.json I've added the following:

{
  "slack-token": "xoxp-2556615108-5147013174-92782145299-56cc3a2c975da5e13007cff414b66364"
}

It segfaulted and I needed a couple of runs to figure out that I've used slack-token instead of slack_token because it only said the following:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x161243]

goroutine 26 [running]:
panic(0x291360, 0xc42000a1a0)
    /usr/local/Cellar/go/1.7.1/libexec/src/runtime/panic.go:500 +0x1a1
golang.org/x/net/websocket.(*Conn).SetWriteDeadline(0x0, 0xecf982a53, 0x329afff5, 0x433b80, 0xc420350500, 0x0)
    /Users/gabortakacs/dev/go/src/golang.org/x/net/websocket/websocket.go:279 +0x43
github.com/nlopes/slack.(*RTM).connect(0xc420182000, 0x1, 0x0, 0x0, 0x0, 0x0)
    /Users/gabortakacs/dev/go/src/github.com/nlopes/slack/websocket_managed_conn.go:94 +0x266
github.com/nlopes/slack.(*RTM).ManageConnection(0xc420182000)
    /Users/gabortakacs/dev/go/src/github.com/nlopes/slack/websocket_managed_conn.go:32 +0x44
created by github.com/erroneousboat/slack-term/src/service.NewSlackService
    /Users/gabortakacs/dev/go/src/github.com/erroneousboat/slack-term/src/service/slack.go:36 +0x42d

A check for the presence of slack_token parameter would be nice.

Snap slack-term

slack-term is amazing. The fat slack client eats about 25% of my laptop RAM, and most of the CPU which makes slack-term a fantastic alternative. My laptop CPU fan thanks you!

I took the liberty of making a snap [1] package to make it easy for Linux users to install and use.

"snap install slack-term" will get them the latest stable release, adding "--edge" will get a daily build from git master. It's in the snap store under my name, but I'd love to hand it over to you, so you can manage it and view stats etc.

[1] http://snapcraft.io/

Random runtime errors

Hi, great app, however I noticed that randomly (and quite often) slack-term crashes with following runtime err:

goroutine 8 [running]: 
github.com/erroneousboat/slack-term/vendor/github.com/nsf/termbox-go.PollEvent(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/konrad/.go/src/github.com/erroneousboat/slack-term/vendor/github.com/nsf/termbox-go/api.go:330 +0x68a
github.com/erroneousboat/slack-term/vendor/github.com/gizak/termui.hookTermboxEvt()                                                                                                                        
/Users/konrad/.go/src/github.com/erroneousboat/slackterm/vendor/github.com/gizak/termui/events.go:126 +0xa3                                                                                       │
created by github.com/erroneousboat/slack-term/vendor/github.com/gizak/termui.Init                                                                                                                         /Users/konrad/.go/src/github.com/erroneousboat/slack-term/vendor/github.com/gizak/termui/render.go:38 +0xa4

I'm using version 0.2.2 on zsh running tmux (or rather tmux running zsh).

Quoted text appears with &gt;

││[14:25] <X> &gt; FYI: You can't create a CF stack right now
││is this still a thing

image

I think the easiest solution would be to apply a html.UnescapeString to all messages before printing them.

"go get github.com/erroneouboat/slack-term" throws error "fatal: could not read Username for 'https://github.com': terminal prompts disabled"

Problem

The command to install this package in README go get github.com/erroneouboat/slack-term throws the following error:

github.com/erroneouboat/slack-term (download)
# cd .; git clone https://github.com/erroneouboat/slack-term /Users/pbenjamin/golang/src/github.com/erroneouboat/slack-term
Cloning into '/Users/pbenjamin/golang/src/github.com/erroneouboat/slack-term'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
package github.com/erroneouboat/slack-term: exit status 128

Solution

This is due to a mis-spelling in the URL.
This is the correct command: go get -u -v github.com/erroneousboat/slack-term

PR #39 fixes this problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.