martinbjeldbak / twitch-chat-cli

Chat on Twitch.tv from your CLI
MIT License
16 stars 2 forks source link
bubbletea cli go golang tui twitch

Twitch Chat CLI

A Twitch.tv chat client in your terminal

Still in early development and missing many core features

Demo

asciicast

Features

Goal is to be simmiler to Chatterino, but in the CLI

Built With

Installation

Binaries for most platforms can be downloaded from this project's GitHub release page

Docker images are also built and deployed. See the Docker section below on how to run it.

How to use

This CLI can be started without any arguments and will launch in anonymous mode, meaning you won't be able to chat.

If you wish to chat, you must auth first with the auth command and add the credentials to the --accounts flag or the config file.

Unauthenticated Example

You can connect to one or multiple channels using the --channels flag

$ twitch-chat-cli --channels "ThePrimeagen,blastpremier"

Authenticated Example

Below is an example sequence of commands to authenticte and connect to some channels, where all arguments are passed in via flags

$ twitch-chat-cli auth # get the arguments passed in to --accounts
$ twitch-chat-cli --channels "blastpremier,jakenbakelive" --accounts "username=qcx;user_id=1234;client_id=123;oauth_token=456"

This tool is completely self-sufficient and does not rely on any other services than the Twitch.tv APIs.

A help menu can be found using the --help flag.

Docker

You can also run this CLI through Docker. If you wish to authenticate with your user, you will need to expose port 8090 to your host so that you can run the local authentication server to receive your OAuth tokens from Twitch.

Anonymous / Unauthenticated

Simply run the docker image

$ docker run -it ghcr.io/martinbjeldbak/twitch-chat-cli --channels "ThePrimeagen"

Authenticated

To authenticate with Twitch and be able to write in chat, follow the below commands. Authentication happens client-side, and your username and password are only ever entered on Twitch.tv.

The first command will prompt you to authenticate with Twitch, and will then present you with an OAuth string at http://localhost:8090 which needs to be set in the --accounts flag. See below for example:

$ docker run -it -p 8090:8090 ghcr.io/martinbjeldbak/twitch-chat-cli auth
$ docker run -it ghcr.io/martinbjeldbak/twitch-chat-cli --channels "ThePrimeagen" --accounts "PASTE HERE"

Help

$ twitch-chat-cli --help
A Twitch chat client in the terminal.

Allows chatting in multiple Twitch channels from the comfort of your terminal.
Supports connecting anonymously or as an authenticated user.

This application pairs nicely with Streamlink <https://streamlink.github.io/> for
a complete website-free viewing experience!

Usage:
  twitch-chat-cli [flags]
  twitch-chat-cli [command]

Available Commands:
  auth        Authenticate with Twitch
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Print the version number of twitch-chat-cli

Flags:
      --accounts auth      accounts and their oauth tokens to use, for example see example.yaml. Fetched via the auth command
      --channels strings   channels to join (default [pokimane])
      --config string      config file (default is $HOME/.twitch-chat-cli.yaml)
  -h, --help               help for twitch-chat-cli
  -t, --toggle             Help message for toggle

Command: auth

$ twitch-chat-cli auth

This command spins up a local server which will act as the callback URL for the Twitch OIDC implicit grant flow dance.

You will be asked to sign in to the Twitch account you wish to use this CLI with.

Once authenticated, you will be redirected to the local web server will display a web page with auth string that needs to be passed to the --accounts flag, or pasted into your config.

Inspiration

Docs

Contributing

.github/workflows/ci.yml CodeQL release

TODO

License

This application is released under the MIT license. See LICENSE