Skip to main content

Cross-device clipboard tool via cloud

Project description

Beam Logo

Beam

Cross-device clipboard.

PyPI version License: MIT

中文文档

Command-line tool for cross-device text sharing via cloud API.

Just 2 commands: bm c (copy) and bm p (paste)

Quick Start

# Install (basic)
pip install beam-clipboard -i https://pypi.org/simple

# Install with clipboard support (recommended)
pip install 'beam-clipboard[clipboard]' -i https://pypi.org/simple

# First time: set your personal key
bm c "hello world"
# Prompt: No key configured. Please enter your personal key:
# Enter your key (recommend 20+ characters)

# Daily use
bm c "copy this"    # copy to cloud
bm p                # paste from cloud

Features

  • Minimalist - Just bm c and bm p
  • 🚀 Zero config - Auto setup on first use
  • 🔄 Cross-device - Mac, Linux, Windows, iPhone browser
  • 📦 Pure Python - No external dependencies
  • 🔐 Encrypted - Content encrypted before upload
  • 🗜️ Compressed - Reduce transfer size (~60% for code)
  • 🔓 Open source - MIT License

Usage

Copy & Paste

# Copy text directly
bm c "hello world"

# Copy from stdin (all platforms)
echo "hello" | bm c
cat file.txt | bm c

# Copy from system clipboard (requires pyperclip)
bm c

# Platform-specific clipboard commands (alternative without pyperclip)
pbpaste | bm c           # macOS
xclip -o | bm c          # Linux X11
wl-paste | bm c          # Linux Wayland
Get-Clipboard | bm c     # Windows PowerShell

# Plain text mode (for browser viewing on mobile devices)
bm c --plain "hello world"

# Paste text
bm p

Edit Key & Password

# Interactive edit (server + key + password)
bm e

# Set new key directly
bm e mynewkey

# Set custom server URL
bm e -s https://your-domain.com

# Set encryption password
bm e -p mypassword

Alternative Usage

python -m beam c "hello world"
python -m beam p

Use Cases

💻 Computer Sync

# computer A
bm c "some data"

# computer B
bm p

📱 Computer & Mobile

Computer to Mobile (view in browser)

# on computer
bm c --plain "hello world"

# on mobile browser
# visit: https://textdb.online/yourkey

Mobile to Computer (input in browser)

# on mobile browser
# visit: https://textdb.online/yourkey
# input your text directly

# on computer
bm p

API Details

Based on TextDB.online free service:

  • Create/Update: https://api.textdb.online/update/?key={key}&value={text}
  • Read: https://textdb.online/{key}
  • Delete: https://api.textdb.online/update/?key={key}&value=

Key requirements:

  • Length: 6-60 characters
  • No slashes (/)
  • Recommend 20+ chars for security

Service Limitations

TextDB.online is a free public service with the following characteristics:

  • Free to use - No registration required
  • Unlimited reads - No limit on data retrieval
  • ⚠️ 500 writes/day/IP - Combined create/update/delete operations
  • ⚠️ Testing recommended - Not guaranteed for production use
  • ⚠️ 1-year retention - Data auto-deleted after 1 year of inactivity
  • ⚠️ No password protection - Use long keys (20+ chars) to avoid collisions

Important: This tool is designed for convenient text sharing between your own devices, not for storing critical or highly sensitive data. The encryption provides basic privacy protection but should not be relied upon for confidential information.

Private Deployment

For production use or higher reliability, you can deploy your own TextDB server:

  1. Get the offline version: TextDB.online offers a private deployment version
  2. Configure Beam to use your server:
    bm e -s https://your-domain.com
    
  3. Benefits of private deployment:
    • Higher stability and performance
    • No rate limits
    • Full data control
    • Better security

For custom API server implementations, ensure they follow the TextDB API format:

  • Write endpoint: {api_base}/update/?key={key}&value={text}
  • Read endpoint: {read_base}/{key}

Configuration

Config file location: ~/.config/beam/config.json

{
  "api_base": "https://api.textdb.online",
  "read_base": "https://textdb.online",
  "key": "your_personal_key",
  "password": "your_encryption_password"
}
  • api_base: API server URL for write operations (default: https://api.textdb.online)
  • read_base: Server URL for read operations (default: https://textdb.online)
  • key: Your personal key for TextDB API
  • password: Encryption password (default: 123456)

Using Private Deployment

If you deploy your own TextDB server, configure it with:

bm e -s https://your-domain.com

Or edit the config file directly to set api_base and read_base.

Security

All content is compressed (zlib) and encrypted (XOR + SHA256) before upload:

Your text → Compress → Encrypt → Base64 → Upload

The server only sees encrypted data like BM2:xxxxx..., unable to read your content.

Use --plain option to skip compression and encryption for non-sensitive content that needs to be viewed in a browser on mobile devices.

⚠️ This is lightweight encryption for convenience, not for highly sensitive data.

Requirements

  • Python 3.6+
  • pyperclip (optional, for clipboard support)

To install with clipboard support:

pip install 'beam-clipboard[clipboard]'

Contributing

Contributions are welcome! Feel free to:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests

License

MIT License

Author

vw2x


Star ⭐ this repo if you find it useful!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beam_clipboard-0.2.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beam_clipboard-0.2.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file beam_clipboard-0.2.1.tar.gz.

File metadata

  • Download URL: beam_clipboard-0.2.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for beam_clipboard-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f6b05f0863dda997864fc6ac9fdc91383f406d2b478924079c290523b1c7a20c
MD5 8fba9bea4257d3acb7ae546f3181d6ce
BLAKE2b-256 6bf577cc2bc42a62b51a80b846e9ca73d780ae96f361411dab004195fdd467cb

See more details on using hashes here.

File details

Details for the file beam_clipboard-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: beam_clipboard-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for beam_clipboard-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f17b4ad24326b22c6163cf455a0e46be4fa470b1185a4d70b46760067d3ea1a
MD5 f9b557e8e0e2492272901c24f9f0ee64
BLAKE2b-256 7558b142d1a1a0c74b073aae2ffe5cdbe844d9f5d1dc35ffcd63d4ab72ae2731

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page