ngchat-cli

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT

README

ngchat

Newgrounds Chat in your terminal. A minimalist Go client: one static binary for macOS, Linux, and Windows.

Status: scaffold. Connects, chats in one channel, renders formatted messages, survives the hourly token bounce. Images (Kitty graphics protocol), channel switching, and presence are on the roadmap.

Install

Grab a binary from Releases, or:

go install github.com/newgrounds-inc/ngchat-cli/cmd/ngchat@latest

Use

ngchat                    # join #general
ngchat -channel random    # join another channel

Login today (while the site's CLI login endpoints are in the works):

  • Allowlisted bot accounts get a username/password prompt.
  • Everyone else: log into newgrounds.com in a browser, then run ngchat set-cookie and paste your cookie header. It's stored in your OS keyring (or a 0600 file if no keyring is available) and used to mint short-lived chat tokens. ngchat logout clears it.

Your NG password is never written to disk.

Terminal niceties

  • ctrl+s reveals spoilers, pgup/pgdn scrolls, ctrl+c quits.
  • Slash commands (/me, /slap, /dm, /roll, ...) work — the server parses them.

Development

Against the NG dev/staging stack:

export NGCHAT_WS_URL=wss://chat.newgrounds-d.com/ws
export NGCHAT_JWT_URL=https://www.newgrounds-d.com/ngapps/jwt.php
export NGCHAT_ROUTING_COOKIE='serverid=...'   # dev proxy routing

Design notes live in CONTEXT.md and docs/adr/.

License

MIT

Directories

Path Synopsis
cmd
ngchat command
Command ngchat is a minimalist terminal client for Newgrounds Chat.
Command ngchat is a minimalist terminal client for Newgrounds Chat.
smoke command
Command smoke is a headless harness for verifying the client stack against a live stack: mint → connect → authenticate → subscribe → send.
Command smoke is a headless harness for verifying the client stack against a live stack: mint → connect → authenticate → subscribe → send.
internal
auth
Package auth handles credential storage and chat-JWT minting.
Package auth handles credential storage and chat-JWT minting.
client
Package client maintains the NG Chat WebSocket session: mint → dial → authenticate → resolve channel → subscribe, plus the heartbeat the server requires and the reconnect/dedupe logic that makes the hourly JWT-expiry disconnect invisible to the UI.
Package client maintains the NG Chat WebSocket session: mint → dial → authenticate → resolve channel → subscribe, plus the heartbeat the server requires and the reconnect/dedupe logic that makes the hourly JWT-expiry disconnect invisible to the UI.
protocol
Package protocol hand-ports the NG Chat wire types from the server's Zod schemas (ngchat repo, src/shared/protocol).
Package protocol hand-ports the NG Chat wire types from the server's Zod schemas (ngchat repo, src/shared/protocol).
render
Package render converts NG Chat's server-rendered message HTML into ANSI-styled terminal text.
Package render converts NG Chat's server-rendered message HTML into ANSI-styled terminal text.
ui
Package ui is the fullscreen Bubble Tea interface: status bar, message viewport, input line.
Package ui is the fullscreen Bubble Tea interface: status bar, message viewport, input line.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL