Skip to content

Added Keybase support#1628

Open
caronc wants to merge 5 commits into
masterfrom
keybase-support
Open

Added Keybase support#1628
caronc wants to merge 5 commits into
masterfrom
keybase-support

Conversation

@caronc

@caronc caronc commented May 28, 2026

Copy link
Copy Markdown
Owner

Description

Related issue (if applicable): N/A

Keybase Notifications

  • Source: https://keybase.io/
  • Image Support: No
  • Attachment Support: Yes
  • Message Format: Plain Text
  • Message Limit: 10,000 characters

Adds a new Keybase Chat notification plugin that communicates directly with the locally running Keybase service over a Unix domain socket (default) or a local HTTP endpoint (TCP mode).

Two target types are supported in any combination within a single URL: @username for direct messages and teamname#channel for team channels (default channel general when no channel is specified). Multiple targets are packed into the URL path: keybase://_/@alice/@bob/myteam#dev.

An optional Saltpack v2.0 message-signing feature is available via ?sigkey= when the PyNaCl package is installed. Signed messages can be verified with keybase verify or any Saltpack client.

Account Setup

  1. Download and install Keybase from https://keybase.io/download.
  2. Log in with keybase login or through the Keybase desktop application.
  3. Keep the Keybase service running in the background when sending notifications (the desktop app or keybase service keeps it alive automatically).

Syntax

Valid syntax is as follows:

  • keybase://_/@{username} -- direct message (socket mode)
  • keybase://_/{teamname} -- team message, default channel general
  • keybase://_/{teamname}#{channel} -- specific team channel
  • keybase://_/@{user1}/@{user2}/{teamname}#{channel} -- multiple targets
  • keybase://localhost:{port}/@{username} -- TCP mode

Parameter Breakdown

Variable Required Description
@username *Yes (at least one target) Keybase username for a direct message. Prefix with @.
teamname *Yes (at least one target) Keybase team name. Append #channel for a specific channel.
channel No Team channel. Defaults to general.
mode No Connection mode: socket (default) or tcp.
socket No Override the Unix domain socket path (must contain keybase).
port No Port for the local Keybase HTTP service (TCP mode).
sigkey No 64-char hex Ed25519 seed for Saltpack signing (requires PyNaCl).

Examples

Send a direct message (socket mode):

apprise -vv -t "Title" -b "Message" \
    keybase://_/@alice

Send to a team channel:

apprise -vv -t "Title" -b "Message" \
    "keybase://_/myteam#dev"

Send via TCP mode:

apprise -vv -t "Title" -b "Message" \
    keybase://localhost:3000/@alice

Send a Saltpack-signed message:

apprise -vv -t "Title" -b "Message" \
    "keybase://_/@alice?sigkey=aabbccdd11223344aabbccdd11223344aabbccdd11223344aabbccdd11223344"

New Service Completion Status

  • apprise/plugins/keybase/
  • pyproject.toml
  • README.md
  • packaging/redhat/python-apprise.spec

Checklist

  • Documentation ticket created (if applicable): apprise-docs/77
  • The change is tested and works locally.
  • No commented-out code in this PR.
  • No lint errors (use tox -e lint and optionally tox -e format).
  • Test coverage added or updated (use tox -e qa).

Testing

Anyone can help test as follows:

# Create a virtual environment
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@keybase-support

# Socket mode -- direct message
tox -e apprise -- -t "Test Title" -b "Test Message" \
    keybase://_/@yourusername

# TCP mode
tox -e apprise -- -t "Test Title" -b "Test Message" \
    keybase://localhost:3000/@yourusername

# With attachment
tox -e apprise -- -t "Test Title" -b "Test Message" \
    --attach=/path/to/file.png \
    "keybase://_/yourteam#general"

# With Saltpack signing (requires PyNaCl)
pip install PyNaCl
tox -e apprise -- -t "Test Title" -b "Test Message" \
    "keybase://_/@yourusername?sigkey=<64-char-hex-seed>"

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new native keybase:// notification plugin that talks directly to the locally running Keybase service, plus a new apprise/utils/saltpack.py utility implementing inline msgpack, Saltpack v2.0 base62 armor, and Ed25519/Curve25519 helpers (with PyNaCl as an optional dependency).

Changes:

  • New plugin package apprise/plugins/keybase/ supporting Unix-socket and TCP modes, @user DMs and team#channel targets, attachments, and optional Saltpack signing.
  • New apprise/utils/saltpack.py providing pure-Python msgpack/base62 + PyNaCl-backed signing, box encryption, and Keybase public-key lookup.
  • Packaging/docs updates (pyproject.toml, all-plugin-requirements.txt, RedHat spec, README) to register PyNaCl as a recommended dependency and list Keybase among supported services.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apprise/plugins/keybase/init.py Exports NotifyKeybase and shared Keybase constants for package-style plugin discovery.
apprise/plugins/keybase/common.py Shared regexes, mode/channel/host defaults, and keybase_default_socket() platform path helper.
apprise/plugins/keybase/base.py Main NotifyKeybase implementation: target parsing, socket/TCP send, attachments, sigkey, URL build/parse.
apprise/utils/saltpack.py Pure-Python msgpack + base62 armor + PyNaCl-backed Saltpack v2 signing, box encryption, Keybase key lookup.
tests/test_plugin_keybase.py Extensive unit + integration coverage for the Keybase plugin.
tests/utils/test_saltpack.py Coverage for msgpack/base62 helpers and PyNaCl-gated controller methods.
tests/utils/init.py Empty package marker for the new tests/utils/ directory.
pyproject.toml Adds Keybase keyword and PyNaCl to all-plugins optional deps.
all-plugin-requirements.txt Adds PyNaCl for backwards-compatible install tooling.
packaging/redhat/python-apprise.spec Adds Keybase to the service summary and recommends python3dist(pynacl).
README.md Inserts a Keybase entry into the alphabetical service table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.11111% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.98%. Comparing base (e17fe9d) to head (57dd384).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
apprise/plugins/keybase/base.py 98.29% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master    #1628      +/-   ##
===========================================
- Coverage   100.00%   99.98%   -0.02%     
===========================================
  Files          211      215       +4     
  Lines        29881    30331     +450     
  Branches      4972     5041      +69     
===========================================
+ Hits         29881    30327     +446     
- Misses           0        3       +3     
- Partials         0        1       +1     
Files with missing lines Coverage Δ
apprise/plugins/keybase/__init__.py 100.00% <100.00%> (ø)
apprise/plugins/keybase/common.py 100.00% <100.00%> (ø)
apprise/utils/saltpack.py 100.00% <100.00%> (ø)
apprise/plugins/keybase/base.py 98.29% <98.29%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caronc caronc force-pushed the keybase-support branch from 016bd59 to 9333087 Compare May 29, 2026 01:56
@caronc caronc force-pushed the keybase-support branch from 9333087 to 57dd384 Compare May 29, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants