Skip to content

Conversation

@lrhodin
Copy link

@lrhodin lrhodin commented Feb 7, 2026

Adds support for the community-built iMessage bridge at github.com/lrhodin/imessage which uses rustpush for native iMessage integration on macOS with the bridgev2 framework.

Changes (+40 lines across 4 files)

  • bridgeconfig/imessage-v2.tpl.yaml — bridgev2 config template with iMessage-specific network settings
  • cmd/bbctl/bridgeutil.go — register imessage-v2 as an official bridge type with websocket support
  • cmd/bbctl/config.go — add askParams stub (no interactive params needed), startup command, install link
  • cmd/bbctl/run.go — handle imessage-v2 in compile/run (binary name mautrix-imessage, git repo URL)

Usage

bbctl config --type imessage-v2 -o config.yaml sh-imessage

Or via the bridge repo's automated installer:

git clone https://github.com/lrhodin/imessage.git
cd imessage
make install-beeper

The make install-beeper target builds bbctl from source, handles login, generates config, creates a LaunchAgent, and starts the bridge.

Tested end-to-end on a fresh macOS Sequoia VM.

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added iMessage v2 bridge with configurable display-name templates, SMS portal toggle, caption display, HEIF/TIFF conversion, and initial-sync duration; includes sensible defaults for command prefix, database name, icon, encryption key, and message limits.
  • Chores / CLI

    • Management CLI now recognizes iMessage v2, provides tailored setup/install instructions, handles repository selection and prebuilt-binary messaging, and maps v2 to the existing iMessage display name for UI reporting.

Walkthrough

Adds support for an iMessage v2 bridge: new YAML template plus bbctl integration for registration, parameter/config generation, repo mapping, startup/install metadata, and websocket marking for imessage-v2.

Changes

Cohort / File(s) Summary
Bridge Configuration Template
bridgeconfig/imessage-v2.tpl.yaml
New template adding network options (displayname_template, disable_sms_portals, caption_in_message, convert_heif, convert_tiff, initial_sync_days) and top-level setfield assignments (CommandPrefix, DatabaseFileName, BridgeTypeName, BridgeTypeIcon, DefaultPickleKey, MaxInitialMessages, MaxBackwardMessages). Includes bridgev2.tpl.yaml.
Bridge Type Registration
cmd/bbctl/bridgeutil.go
Adds "imessage-v2" to officialBridges and marks it as websocket-capable in websocketBridges.
Parameter & Config Logic
cmd/bbctl/config.go
Adds askParams entry for imessage-v2 (no interactive prompts). Extends imessage connector options with rustpush (default) and maps imessage+rustpush -> imessage-v2 template. Generation uses configTemplate and sets BridgeType in output to that template. Adds startup command and install URL metadata for imessage-v2 (mautrix-imessage-v2 -c <outputPath>, https://github.com/lrhodin/imessage).
Runtime / Clone / Binary Mapping
cmd/bbctl/run.go
Includes imessage-v2 in supported bridge types and maps it to https://github.com/lrhodin/imessage.git. For prebuilt-binary flow, emits a UserError directing to local build or repo when no prebuilt binaries are available for imessage-v2.
Registration Display Mapping
cmd/bbctl/register.go
Maps internal imessage-v2 to display value imessage when reporting state to Beeper (uses displayBridgeType instead of raw bridge type).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and specifically describes the main change: adding support for the imessage-v2 bridge type that uses rustpush and bridgev2 framework.
Description check ✅ Passed The pull request description is comprehensive and directly related to the changeset, providing context, listing all affected files, and including usage examples.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 529bd01 and 581e96e.

📒 Files selected for processing (1)
  • cmd/bbctl/config.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/bbctl/config.go

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/bbctl/run.go (1)

313-326: ⚠️ Potential issue | 🟡 Minor

Add imessage-v2 to getRefFromBridge or remove CI download path for this community bridge.

When neither --compile nor --local-dev is specified, updateGoBridge calls DownloadMautrixBridgeBinary with ciBridgeType = "imessage-v2". However, imessage-v2 is not listed in the getRefFromBridge function (api/gitlab/build.go:68-78), causing it to return an "unknown bridge" error. Since imessage-v2 is a community bridge (from https://github.com/lrhodin/imessage.git), not built in Mautrix CI, the download will fail.

Either:

  1. Add imessage-v2 to getRefFromBridge if CI artifacts are available, or
  2. Remap ciBridgeType to an existing bridge (e.g., "imessage"), or
  3. Return an error that requires --compile for this bridge.
🤖 Fix all issues with AI agents
In `@cmd/bbctl/config.go`:
- Around line 353-358: The imessage-v2 case currently sets startupCommand to
"mautrix-imessage", colliding with the imessage bridge (the base logic in
fmt.Sprintf("mautrix-%s", cfg.BridgeType) already yields "mautrix-imessage" for
imessage), so change the override to a distinct binary name (e.g., set
startupCommand = "mautrix-imessage-v2") and update installInstructions
accordingly; ensure any code that relies on the binary name (the startupCommand
variable and any binary path resolution) uses the new unique name so imessage
and imessage-v2 do not share dataDir/binaries/mautrix-imessage.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5207472 and 63bfa29.

📒 Files selected for processing (4)
  • bridgeconfig/imessage-v2.tpl.yaml
  • cmd/bbctl/bridgeutil.go
  • cmd/bbctl/config.go
  • cmd/bbctl/run.go
🧰 Additional context used
🪛 YAMLlint (1.38.0)
bridgeconfig/imessage-v2.tpl.yaml

[error] 17-17: syntax error: could not find expected ':'

(syntax)

🔇 Additional comments (4)
cmd/bbctl/bridgeutil.go (1)

27-27: LGTM!

The new imessage-v2 entry is correctly added to both officialBridges and websocketBridges, consistent with other bridge type registrations.

Also applies to: 50-50

bridgeconfig/imessage-v2.tpl.yaml (1)

1-23: LGTM!

The template follows the established pattern for bridgev2 config templates. The YAMLlint error on line 17 is a false positive — {{ setfield ... }} directives are Go template syntax processed before YAML parsing.

cmd/bbctl/config.go (1)

121-124: LGTM!

No interactive parameters needed for this bridge type; the stub is consistent with the pattern.

cmd/bbctl/run.go (1)

137-139: LGTM on the clone URL override.

Correctly routes imessage-v2 to the community repo for local compilation.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@cmd/bbctl/run.go`:
- Around line 324-326: binaryName is incorrectly set to "mautrix-imessage-v2"
causing bridgeCmd (used in --local-dev) to point to a non-existent binary;
mirror the compile-path override by computing the same compiledName fallback
before constructing bridgeCmd: if binaryName == "mautrix-imessage-v2" set
compiledName = "mautrix-imessage" (or otherwise apply the compile-path logic),
then use compiledName when creating bridgeCmd instead of binaryName so
--local-dev looks for the actual built binary; update references to
binaryName/compiledName in the local-dev branch (the code that builds bridgeCmd)
and ensure compiledName is used consistently.
🧹 Nitpick comments (2)
cmd/bbctl/run.go (2)

137-139: Clone URL points to a personal fork — ensure long-term availability.

The repository https://github.com/lrhodin/imessage.git is a personal GitHub account. If this account is deleted/renamed or the repo is transferred, the clone will break for all users. Consider whether this should be hosted under a more durable org (e.g., beeper or mautrix), or at minimum document this dependency.


338-342: The compiledName override is needed because the repo builds mautrix-imessage, not mautrix-imessage-v2.

This works but is fragile — if the upstream repo ever changes its build output name, this silently breaks. Consider adding a comment explaining why the override exists.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 63bfa29 and 3f22497.

📒 Files selected for processing (4)
  • bridgeconfig/imessage-v2.tpl.yaml
  • cmd/bbctl/bridgeutil.go
  • cmd/bbctl/config.go
  • cmd/bbctl/run.go
🧰 Additional context used
🧬 Code graph analysis (1)
cmd/bbctl/run.go (1)
cmd/bbctl/main.go (1)
  • UserError (19-21)
🪛 YAMLlint (1.38.0)
bridgeconfig/imessage-v2.tpl.yaml

[error] 17-17: syntax error: could not find expected ':'

(syntax)

🔇 Additional comments (5)
bridgeconfig/imessage-v2.tpl.yaml (1)

1-23: LGTM!

The template follows the same structure as other bridgev2 templates. The YAMLlint error on line 17 is a false positive — this is a Go template file, and {{ setfield ... }} directives are not valid YAML but are processed before YAML parsing.

cmd/bbctl/config.go (1)

121-124: LGTM!

No interactive parameters are needed for this bridge type; the stub is consistent with the pattern used by other simple bridge types.

cmd/bbctl/run.go (1)

348-350: LGTM!

Good guard — clearly communicates that prebuilt binaries aren't available and directs the user to alternatives.

cmd/bbctl/bridgeutil.go (2)

27-27: LGTM!

The ordering is correct — "imessage-v2" is listed before "imessage" in officialBridges, ensuring that guessOrAskBridgeType's strings.Contains check matches the more specific type first.


50-50: LGTM!

Registering imessage-v2 as a websocket bridge is consistent with the bridgev2 template configuration.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Add support for the community-built iMessage bridge at github.com/lrhodin/imessage
which uses rustpush for native iMessage integration on macOS with the bridgev2 framework.

Changes:
- Add imessage-v2.tpl.yaml: bridgev2 config template with iMessage network settings
- Register imessage-v2 as an official bridge type with websocket support
- Add askParams stub (no interactive params needed)
- Handle imessage-v2 in config generation (startup command, install link)
- Handle imessage-v2 in run/compile (binary name, git repo URL)
lrhodin and others added 2 commits February 7, 2026 12:53
- register.go: Map imessage-v2 bridge type to 'imessage' when posting
  bridge state so Beeper's UI recognizes it correctly.
- config.go: Add 'rustpush' as a connector option (default) under the
  existing imessage type, with proper config template and websocket
  routing.

Co-authored-by: David Brustein <david@Davids-MacBook-Pro.local>
…ered

The CLI --type flag should take precedence over the server-reported
bridgeType. Previously, if the server already had a bridge registered,
its BridgeState.BridgeType was always used, making the --type flag
a no-op. This caused config generation to pick the wrong bridge type
(e.g. "imessage" instead of "imessage-v2").

Fix: check ctx.String("type") first before falling back to the
server-reported type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant