> termcourse: 터미널에서 Discourse 인스턴스를 읽고 게시하기

이것은 터미널 앱(TUI)으로, 그저 재미로 만든 것이자 현재로서는 다소 실험적인 단계입니다!

:information_source: 요약 토픽 목록, 전체 토픽 보기, 답글, 좋아요, 검색 및 내장된 작성기를 갖춘 Discourse 포럼을 탐색하고 게시하기 위한 터미널 UI입니다.
:hammer_and_wrench: 저장소 링크 GitHub - merefield/termcourse: A terminal based client to access Discourse instances, supporting API keys, username/password (and with MFA token) · GitHub
:open_book: 설치 가이드 저장소의 README.md (Quickstart 섹션)
:heart: 스폰서십 이 프로젝트가 마땅히 받아야 할 유지보수를 받고 미래에도 여러분의 사이트에서 계속 작동할 수 있도록, 여러분의 자원과 필요에 맞는 수준으로 제 오픈소스 작업의 지속적 스폰서가 되어 주십시오 (Sponsor @merefield on GitHub Sponsors · GitHub).

termcourse를 즐기고 계신가요? GitHub에서 :star: 해주세요.

개요

termcourse는 단일 Go 실행 파일로 재구성된 터미널 기반 Discourse 클라이언트입니다. 사용자명/이메일과 비밀번호를 사용한 경량 브라우저 스타일 쿠키 세션을 사용할 수 있으며, TOTP 및 백업 코드 MFA를 포함합니다. 인터랙티브 로그인이 적합하지 않은 사이트에는 API 키 인증이 가능합니다.

인터페이스는 현재 Charm 스택을 사용하며 키보드와 마우스 모두로 작동합니다. 폴더 스타일 내비게이션, 컨텍스트 필터, 반응형 패널, 테마화된 컨트롤, 마크다운 렌더링 및 인라인 이미지는 터미널을 벗어나지 않고도 포럼을 편안하게 탐색할 수 있도록 설계되었습니다.

기능

  • 최신, 인기, 새 글, 안 읽음, 최고, 개인 메시지 토픽 목록을 탐색하며, 최고 기간을 순환 선택할 수 있습니다.
  • 영구적인 토픽, 검색, 알림, 작성 폴더를 탐색하며, 컨텍스트 기반 2차 필터를 사용할 수 있습니다.
  • 전체적으로 키보드를 사용하거나 탭, 토픽 행, 푸터 컨트롤 및 호버 하이라이트된 버튼을 클릭할 수 있습니다.
  • Enter 키 또는 숫자 키 1~0으로 표시된 토픽을 엽니다.
  • 지연 게시 로드, 컴팩트 발췌문, 확장된 선택 게시글 및 반응형 스크롤링을 통해 완전한 토픽을 읽습니다.
  • 토픽의 진행 트랙을 클릭하여 게시글 스트림의 해당 위치로 직접 이동합니다.
  • 토픽을 생성하고, 카테고리를 선택하며, 토픽이나 개별 게시글에 답글을 달고, 게시글에 좋아요를 누르거나 취소합니다.
  • 게시글을 검색하고 해당 토픽 컨텍스트 내에서 일치하는 게시글로 직접 이동합니다.
  • 안 읽음 및 개인 메시지 배지를 포함한 알림을 탐색하고 필터링합니다.
  • 커서 이동, 삽입, 줄바꿈, 붙여넣기 지원 및 실시간 검증을 사용하여 여러 줄의 내용을 작성합니다.
  • 링크, 목록, 인용, 코드, 작업 목록 및 테이블을 포함한 GFM 마크다운을 렌더링합니다.
  • Kitty 그래픽 프로토콜을 사용하여 고품질 인라인 및 전체 화면 이미지를 표시하며, 포터블 폴백으로 색상 chafa 심볼 또는 viu를 사용합니다.
  • 쿠키 세션을 사용할 때 실시간 토픽 목록, 토픽, 알림 및 개인 메시지 업데이트를 수신합니다.
  • 환경 변수 또는 credentials.yml에서 사이트별 자격 증명을 사용하며, 누락된 로그인 필드에 대해 프롬프트를 표시합니다.
  • default, slate, fairground, rust, hacker 테마에서 선택하고, YAML 테마를 추가하며, 앱 실행 중 테마를 순환 선택할 수 있습니다.
  • 터미널 기능 자동 감지를 통해 truecolor, 256색 또는 16색 출력을 사용합니다.
  • 인터페이스를 영어, 프랑스어, 독일어 또는 스페인어로 실행합니다.
  • 터미널을 자유롭게 리사이즈할 수 있습니다: 레이아웃, 색상, 토픽 목록 및 Kitty 이미지가 사용 가능한 공간에 반응합니다.
  • Discourse가 작업을 레이트 리밋할 때 서버가 제공하는 재시도 타이밍을 확인하며, 선택적 HTTP, UI 및 이미지 진단 기능을 제공합니다.

설치 및 실행

Linux 또는 macOS에서 권장되는 설치 프로그램은 현재 운영 체제와 아키텍처에 맞는 사전 구축된 릴리스를 다운로드하고, SHA-256 체크섬과 보고된 버전을 검증한 후 설치합니다:

curl -fsSL https://raw.githubusercontent.com/merefield/termcourse/master/install-release.sh | sh
termcourse your.discourse.host

Termcourse는 자격 증명이 아직 구성되지 않은 경우 사용자명과 비밀번호를 프롬프트로 요청합니다. 비밀번호 입력은 숨겨집니다.

termcourse --version을 사용하여 설치된 시맨틱 버전을 표시합니다. 동일한 버전은 넓은 터미널 마스트헤드에도 표시됩니다.

sudo가 필요 없는 사용자 로컬 설정의 경우:

curl -fsSL https://raw.githubusercontent.com/merefield/termcourse/master/install-release.sh |
  TERMCOURSE_BIN_DIR="$HOME/.local/bin" sh

GitHub 릴리스는 AMD64 및 ARM64에서 Linux, macOS, Windows용 SHA-256 체크섬과 사전 구축된 아카이브를 제공합니다. Linux/macOS는 .tar.gz를, Windows는 .zip을 사용합니다. 사전 구축된 릴리스에는 Go가 필요하지 않습니다.

Windows에서는 설치 프로그램을 다운로드하고 검사한 후, 기계 전체 실행 정책을 변경하지 않고 실행합니다:

Invoke-WebRequest https://raw.githubusercontent.com/merefield/termcourse/master/install-release.ps1 -OutFile install-release.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File .\install-release.ps1

기본적으로 %LOCALAPPDATA%\Programs\termcourse\bin에 설치되며 동일한 체크섬 및 버전 검증을 수행합니다. 설치 프로그램은 --version 또는 -Version을 사용하여 릴리스를 고정할 수도 있습니다. 소스에서 설치할 때만 Go 1.26.6 이상이 필요합니다.

대신 체크아웃에서 로컬 실행 파일을 빌드하려면:

git clone https://github.com/merefield/termcourse.git
cd termcourse
make build
./termcourse your.discourse.host

반복 사용을 위해 로그인 정보를 로컬 .env에 넣거나 README에 설명된 호스트별 credentials.yml을 사용하십시오.

사용자명/비밀번호 로그인 (권장)

사용자명/비밀번호 로그인은 실시간 업데이트를 활성화합니다:

DISCOURSE_USERNAME="you@example.com" \
DISCOURSE_PASSWORD="your_password" \
termcourse your.discourse.host

API 키 폴백

DISCOURSE_API_KEY="your_key" \
DISCOURSE_API_USERNAME="your_username" \
termcourse your.discourse.host

구성, 테마, 컨트롤, 이미지 백엔드 및 문제 해결에 대해서는 최신 README를 참조하십시오.

인증 참고 사항

  • 사용자명/비밀번호 로그인은 Discourse의 CSRF 및 쿠키 플로우를 따르며 실시간 MessageBus 업데이트를 활성화합니다.
  • TOTP 및 백업 코드 MFA를 지원합니다.
  • API 키 인증은 HTTP 기능을 유지하지만 실시간 브라우저 세션을 확립하지는 않습니다.
  • 일부 사이트는 스크립트 기반 사용자명/비밀번호 로그인을 비활성화하거나 제한합니다. 이러한 사이트의 폴백은 API 자격 증명입니다.

보안

  • Termcourse는 프롬프트로 입력된 자격 증명이나 세션 쿠키를 디스크에 기록하지 않으며, 세션 쿠키는 메모리에 유지됩니다.
  • 비밀번호 프롬프트는 비밀번호가 셸 히스토리에 남지 않도록 합니다.
  • 영구 자격 증명은 선택 사항이며, 환경 변수 또는 YAML 파일 내에서 사용자의 통제 하에 유지됩니다.
  • 진단 로깅은 옵트인 방식이며 기본값은 비활성화되어 있고, 자격 증명이나 응답 본문을 기록하지 않습니다.

제한 사항

  • 원격 로그인 플로우를 금지하는 사이트에서는 API 키 인증이 필요할 수 있습니다.
  • 실시간 업데이트에는 사용자명/비밀번호 쿠키 인증이 필요합니다.
  • 네이티브 인라인 이미지 품질은 터미널 지원에 따라 다르며, Kitty가 권장되고 다른 곳에서는 심볼 렌더링이 가능합니다.
  • 터미널 안에서 작동합니다. :slight_smile:

크레딧

Dumbcourse: old browser friendly UI at dumb/d-pad/small screens에서 부분적으로 영감을 받았습니다. :clap:

27개의 좋아요

So you can quickly login to multiple sites (obviously one session at a time per tab) I’ve made the following improvements:

termcourse auth and config improvements

  • Username/password is now the default login path.
  • You don’t need to include https:// anymore - this is optional
  • Missing login fields are prompted interactively (for example: username known, password missing).
  • CLI help includes core env vars and debug log file locations.

Credentials and ENV behavior

  • Supports host-mapped credentials file with lookup order:
    1. TERMCOURSE_CREDENTIALS_FILE (if set)
    2. ./credentials.yml
    3. ~/.config/termcourse/credentials.yml
  • Auth precedence:
    1. CLI flags
    2. Host credentials from YAML
    3. Generic DISCOURSE_* env vars
    4. Interactive prompt
  • For auth: login, missing username/password values are prompted.
  • For API auth, both API username and key must resolve to non-empty values.

Debugging

  • HTTP/auth debug: TERMCOURSE_HTTP_DEBUG=1 → /tmp/termcourse_http_debug.txt
  • UI render debug: TERMCOURSE_DEBUG=1 → /tmp/termcourse_debug.txt

Repo hygiene

  • Added credentials.example.yml and .env.example with aligned examples.
  • Added .gitignore entries for local secret files:
    • .env
    • credentials.yml
3개의 좋아요

This is pretty low-fi but it works.

You need to have viu or chafa installed - and that can be a project itself :slight_smile:

In high quality mode on chafa or with viu, Windows Terminal is superior to MacOS terminal because it supports many more colours (thanks Microsoft!)

Release Notes: Image Rendering (in the terminal!)

Image Rendering

  • Added inline post image previews with backend selection:
    • auto tries chafa first, then viu.
    • TERMCOURSE_CHAFA_MODE=stable|quality
    • stable: conservative output for terminal stability.
    • quality: higher-detail/color symbol rendering.
  • Added preview height control:
    • TERMCOURSE_IMAGE_LINES (default: 14)
    • Applies to preview line height; useful for tuning visual density.
  • Improved viu aspect behavior:
    • Switched to line-targeted rendering (-h) to preserve aspect ratio better.
  • Added preview quality filter controls:
    • TERMCOURSE_IMAGE_QUALITY_FILTER=1 filters noisy block-only previews.
    • Set to 0 to always show renderer output.
  • Added image download safety limit:
    • TERMCOURSE_IMAGE_MAX_BYTES (default: 5242880)
    • Prevents oversized image downloads from impacting performance.
  • Added support for Discourse upload://… image links:
    • Automatically resolves to /uploads/short-url/…
  • Improved terminal sanitization/stability:
    • Keeps valid SGR color codes where needed.
    • Strips destabilizing control/graphics sequences.
    • Prevents ANSI escape fragments from being displayed as raw text.

A note: I’ve found one site that blocks remote username/password so this client will not work in that situation (unless you own it and can set an API key!)- suggestions welcome, but currently no support in those instances.

I’m not sure I’ll use this in the real world, I don’t see the use for me, but I’ve tried it and it’s delightful. I love being able to interact with a next-gen forum platform from a bare-metal, primitive interface.

In some way, it is very aesthetically pleasing.

1개의 좋아요

Thank you!

Yeah, I’m thinking it might be useful when:

  • you are on a low fi platform
  • mucking around on a raspberry pi (not yet tested FYI)
  • from a server to check you are up …
  • … or if the front end code is crashing! :smiley:
  • for a Discourse site that is very text based …
  • … and as a technical curiosity :nerd_face:

I’ve been meaning to test it on my phone with Terminus …

3개의 좋아요

OK probably last update for today:

  • interface is now responsive to window resize :tada:
  • improvements to content in top bar instructions
  • keys 1 to (1)0 now open that number topic on the topic list

Remember to git pull to get updates.

3개의 좋아요

Man, now I gotta get to work on my ASCII artwork!!
¯(ツ)

3개의 좋아요

I’ve added a fully customisable theming system, this is “fairground”:

… and this is “slate”:

… and this is “rust”:

details in the README :graduation_cap:

5개의 좋아요

ok here we go guys, some juicy :tangerine: updates:

  • add support for Private Messages - tap f twice :tada: (just list, view and reply at this stage no compose new PM)
  • add additional columns for Category, Users, Views, progressively when width expanded
  • tweak theming for vertical separators
  • updated README

2개의 좋아요

I merged this yesterday:

  • If you make the effort to install chafa or viu, you will now be rewarded with a new feature: “full window” toggle for post images. On Windows this is particularly good because of the generous colour depth support in Windows Terminal app

termcourse now has an unread PM status pop-up in the topic list status bar and just like the browser client will post back read notifications post by post as you move the cursor

2개의 좋아요

I’ve merged fixes for themes on macos

2개의 좋아요

Nice… Does it run on a Pip-Boy?

3개의 좋아요

feel free to PR that or share the colour codes and I’ll add to the example themes yml :slight_smile:

2개의 좋아요

Love it! Merged, thank you!

https://github.com/merefield/termcourse/pull/1

2개의 좋아요

https://github.com/merefield/termcourse/pull/2

So the rendering wasn’t great … so I’ve fixed it … the UI now has “diff rendering” so it’s much faster and smoother … it no longer paints the whole screen with every cursor movement. :sweat_smile:

I’ve only tested this under windows so far so please feed back any issues - but it should help slower systems significantly.

I’ve also added some tests and GitHub CI! (and it’s super fast because it uses minitest)

Now has a realtime notification system based on MessageBus to notify you in status bar when the topic list has new updates (so you can hit g to refresh):

https://github.com/merefield/termcourse/pull/3

Will probably work on topic read badges next …

That’s great!

Why not use the same keyboard shortcuts as Discourse? So the experience would be more seamless :slight_smile:

1개의 좋아요

Not a bad idea … that’s definitely worth a pass at some stage to see if things can be sensibly brought closer together :+1: … but there are of course some significant differences in medium so some things might remain different.

1개의 좋아요