Skip to main content

lui-bridge

Connect AI agents to LUI Android devices. 106 phone tools (including health ring + wellness mode), MCP protocol, bidirectional communication.

Install

pip install lui-bridge

CLI

# Connect as an agent (interactive — receives instructions from phone)
lui bridge connect --url ws://PHONE_IP:8765 --token TOKEN --agent my-bot --mode echo

# Connect with Hermes as the backend
lui bridge connect --url ws://PHONE_IP:8765 --token TOKEN --agent hermes --mode hermes

# Connect with Claude Code as the backend
lui bridge connect --url ws://PHONE_IP:8765 --token TOKEN --agent claude-code --mode claude-code

# List all available tools on the phone
lui bridge tools --url ws://PHONE_IP:8765 --token TOKEN

# Call a single tool
lui bridge call --url ws://PHONE_IP:8765 --token TOKEN --tool battery
lui bridge call --url ws://PHONE_IP:8765 --token TOKEN --tool get_location
lui bridge call --url ws://PHONE_IP:8765 --token TOKEN --tool toggle_flashlight --args '{"state":"on"}'

# Check device status
lui bridge status --url ws://PHONE_IP:8765 --token TOKEN

# Start a relay server (for remote access beyond LAN)
lui relay start --port 9000

Python API

from lui import LuiBridge

# Connect to phone
bridge = LuiBridge("ws://PHONE_IP:8765", "YOUR_TOKEN")
bridge.connect()  # returns tool count

# Call tools
print(bridge.call_tool("battery"))           # "Battery is at 73%, not charging."
print(bridge.call_tool("get_location"))       # "You're at 123 Main St..."
print(bridge.call_tool("get_time"))           # "It's 3:42 PM."
print(bridge.call_tool("read_notifications")) # "Slack: new message..."
print(bridge.call_tool("wifi_info"))          # "Connected to MyWifi (5GHz, 702 Mbps)"

# Control the phone
bridge.call_tool("toggle_flashlight", {"state": "on"})
bridge.call_tool("set_volume", {"direction": "up"})
bridge.call_tool("send_sms", {"number": "Mom", "message": "On my way"})
bridge.call_tool("navigate", {"destination": "the airport"})
bridge.call_tool("open_app_search", {"app": "Spotify", "query": "Despacito"})

# Vision — trigger camera or gallery remotely
bridge.call_tool("take_photo")                # captures photo via Camera2 API
bridge.call_tool("pick_image")                # opens gallery picker on phone
bridge.call_tool("analyze_image")             # describe what's in the last captured/selected image

# Health ring (Colmi R09) — requires ring connected via Connection Hub
bridge.call_tool("get_heart_rate")            # live heart rate from ring
bridge.call_tool("get_spo2")                  # blood oxygen level
bridge.call_tool("get_stress")                # stress level (0-100)
bridge.call_tool("get_health_summary")        # all vitals in one call
bridge.call_tool("get_health_trend", {"metric": "stress", "hours": "24"})  # 24h trend

# Wellness — ambient sounds + wellness mode
bridge.call_tool("play_relaxing_sound", {"type": "rain"})   # rain, ocean, forest, piano, etc.
bridge.call_tool("start_wellness_mode")       # sound + DND + dim (auto-picks by time/stress)
bridge.call_tool("stop_wellness_mode")        # restores prior state

# Get device state
print(bridge.get_device_state())
# Time: 3:42 PM
# Battery: 73%
# Network: Wi-Fi
# ...

# List tools
for name in bridge.list_tools():
    print(name)

bridge.disconnect()

Bidirectional Agent

Register as a named agent so the phone user can send you instructions:

from lui import LuiBridge

def handle_instruction(instruction):
    """Called when user says 'tell my-bot to ...' on the phone."""
    print(f"Got: {instruction}")
    # Process the instruction with your agent logic
    return "Done!"

def handle_event(event_type, data):
    """Called for phone events (notifications, calls, 2FA codes)."""
    if event_type == "notification_2fa":
        print(f"2FA code: {data['code']}")
    elif event_type == "notification":
        print(f"Notification: {data['title']}")

bridge = LuiBridge(
    url="ws://PHONE_IP:8765",
    token="YOUR_TOKEN",
    agent_name="my-bot",
    on_instruction=handle_instruction,
    on_event=handle_event
)

bridge.connect()
print("Listening...")

# On the phone, user can say:
#   "patch me to my-bot"  → enters direct chat mode
#   "@my-bot deploy"      → sends one-off instruction
#   "tell my-bot to run tests" → LLM forwards instruction

while bridge.connected:
    time.sleep(1)

Relay Server

For access beyond the local network:

# Start relay
lui relay start --port 9000

# Phone connects to relay (configure in LUI Connection Hub)
# Agent connects via relay
lui bridge connect --url wss://RELAY_HOST/agent --token TOKEN --agent my-bot

Requirements

  • Python 3.9+
  • A phone running LUI with the BYOS bridge enabled
  • Phone and agent on the same Wi-Fi (or use relay for remote)

Metadata

Release files for lui-bridge 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lui-bridge 0.4.0
File Size Uploaded Provenance Actions
lui_bridge-0.4.0.tar.gz 12.9 kB Without provenance Details for lui_bridge-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lui-bridge 0.4.0
File Interpreter ABI Platform Actions
lui_bridge-0.4.0-py3-none-any.whl Python 3 none any Details for lui_bridge-0.4.0-py3-none-any.whl

Total release size: 24.9 kB

Release files / lui_bridge-0.4.0.tar.gz

Download URL lui_bridge-0.4.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
538285bbd4f0e04ead9d9a43e7f773c2123c6bc1439518aff0584ed913c79039
BLAKE2b-256 checksum
How to use checksums
99c6e3b6c1dd38383856aaa86b43933b3fd3ec861d4a5ff97b376b7b11562e7b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / lui_bridge-0.4.0-py3-none-any.whl

Download URL lui_bridge-0.4.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd534726e9c11c10df23c6bd248ec5b58de385d128f28c7321e27c84046c03ef
BLAKE2b-256 checksum
How to use checksums
6ad36694542855ffcfec3d173045d0d16f84f2c6ea1e2732b858fb42921dcfc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for lui-bridge 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page