> termcourse: read & post on Discourse instances from the terminal

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
2 Likes