Skip to content

Repository files navigation

ChatIRC — IRC-style CLI ChatGPT frontend

ChatIRC is a small curses-based IRC-like client that uses OpenAI chat models as the assistant backend. It aims for a keyboard-first, compact UX inspired by classic IRC clients like BitchX and iirc.

Highlights

  • Per-room chat logs and message history
  • Slash commands: /room, /rooms, /save, /load, /nick, /topic, /help, /quit, /getkey, /invite
  • Tab-completion for commands/rooms and persistent input history
  • Unicode-aware wrapping and optional wcwidth dependency for accurate layout
  • Background API calls so the UI stays responsive

Quick start

  1. Create and activate a virtualenv (recommended):
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

echo "sk-..." > openapi_key 2. Provide your OpenAI API key. Recommended: create a per-user hidden file under ~/.chatirc/openapi_key (preferred), or put openapi_key in the project directory:

Preferred (per-user):

mkdir -p ~/.chatirc
echo "sk-..." > ~/.chatirc/openapi_key
chmod 600 ~/.chatirc/openapi_key

Fallback (project-local):

echo "sk-..." > openapi_key
chmod 600 openapi_key

You can also set OPENAI_API_KEY as an environment variable.

  1. Run the client:
python3 chatirc.py

Useful commands

  • /getkey — opens the OpenAI API keys page in your browser
  • /invite <email> — opens your mail client with a templated invite (replace the placeholder link with your GitHub release URL)
  • /help — lists commands

Packaging

  • To build a single-file binary using PyInstaller:
./build.sh
  • A Makefile target make build runs the script. The resulting binary will appear under dist/.

Security & privacy

  • Do NOT commit your openapi_key file into version control. It's ignored via .gitignore.
  • Consider storing the key under ~/.chatirc/openapi_key for multi-project installs; the current default matches the working directory file openapi_key.

Contributing

Pull requests welcome. See TODO.md for in-progress ideas.

License

MIT

Assets and packaging notes

  • The assets/ directory contains appicon.png and theme images. When building with PyInstaller the workflow bundles these files with --add-data so the runtime can access them. At runtime the helper get_asset_path(name) resolves the correct absolute path whether running from source or from a PyInstaller one-file bundle (via sys._MEIPASS).

  • Windows: the CI attempts to convert assets/appicon.png to a .ico using ImageMagick if available and passes it to PyInstaller via --icon.

  • If you want guaranteed OS-native icons ensure .ico (for Windows) and .icns (for macOS) files are present in assets/ and update the workflow to use them.

Testing

  • Tests are run with pytest in CI. Locally you can run:
python3 -m pip install -r requirements.txt
pytest -q

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages