open-index/open-npm huggingface dataset:
npm package: @hmduc16031996/claude-mb-bridge
Description: Bridge between Claude Code CLI and your mobile app via WebView
Latest version: 2.5.6

# Claude Mobile Bridge 🤖📱

A lightweight bridge between the **Claude Code CLI** and your **mobile app** via a secure Cloudflare Tunnel. This tool allows you to interact with your local development environment directly from your mobile device using the Claude Code CLI.

## ✨ Features

- **Secure Tunneling**: Uses Cloudflare Tunnel (`cloudflared`) to expose your local terminal securely.
- **Terminal Integration**: Full terminal emulation using `node-pty` and `xterm.js`.
- **Session Management**: Pairing via tokens and a central coordination server.
- **Cross-Platform**: Works on macOS, Linux, and Windows.

## 📋 Prerequisites

1.  **Node.js**: Version 18.0.0 or higher.
2.  **Claude Code CLI**: Installed and authenticated (`npm install -g @anthropic-ai/claude-code`).
3.  **Cloudflared**: The Cloudflare Tunnel CLI must be installed and in your PATH.
    - `brew install cloudflared` (macOS)
    - [Download for other platforms](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/)

## 🚀 Installation & Usage

Install the package globally:

```bash
npm install -g @hmduc16031996/claude-mb-bridge
```

Or run it directly using `npx`:

```bash
npx @hmduc16031996/claude-mb-bridge --token YOUR_PAIRING_TOKEN
```

### Options

| Option | Description | Default |
| :--- | :--- | :--- |
| `--token` | **Required**. Pairing token from your mobile app. | |
| `--server` | URL of the central coordination server. | `http://127.0.0.1:3000` |
| `--path` | Working directory for the terminal session. | `process.cwd()` |
| `--port` | Local port for the terminal server. | `38473` |

## 🏗️ How it Works

1.  **Start the Bridge**: Run the CLI with your pairing token.
2.  **Local Server**: The bridge starts a local HTTP/WebSocket server that hosts a terminal interface.
3.  **Cloudflare Tunnel**: It automatically creates a temporary `.trycloudflare.com` tunnel pointing to your local server.
4.  **Connect**: The bridge reports the tunnel URL to the central server, which then allows your mobile app to connect to the terminal via the secure URL.
5.  **Interactive Session**: Use Claude Code directly in your mobile app as if you were in your local terminal.

## 📄 License

MIT © [hmduc16031996](https://github.com/hmduc16031996)