Skip to main content

Snippbot device agent - connect any machine to Snippbot

Project description

Snippbot Device Agent

Connect any machine to Snippbot as a remote execution node.

What It Does

The device agent runs on a remote machine and connects back to your Snippbot daemon via WebSocket. Once paired, the AI agent can route tool calls — shell commands, file operations, screenshots, browser automation — to the remote device.

Installation

pipx install snippbot-device

Or in a virtual environment:

pip install snippbot-device

With optional capabilities (use pip in a venv):

pip install snippbot-device[screen]    # Screenshots (Pillow + mss)
pip install snippbot-device[browser]   # Browser automation (Playwright)
pip install snippbot-device[camera]    # Camera capture (OpenCV)
pip install snippbot-device[all]       # All optional capabilities

Requires Python 3.11 or higher.

Quick Start

1. Pair with your Snippbot daemon

From the Snippbot UI, click Pair Device to generate a 6-digit pairing code. Then on the remote machine:

snippbot-device pair --host DAEMON_IP --port 18781 --code XXXXXX

2. Start the agent

snippbot-device start        # Background (daemonized)
snippbot-device start -f     # Foreground (see logs)

3. Verify

snippbot-device status       # Check connection and resource usage
snippbot-device capabilities # List detected capabilities

Commands

snippbot-device pair          Pair this device with a Snippbot daemon
snippbot-device start         Start the device agent
snippbot-device stop          Stop the running agent
snippbot-device status        Show agent status and connection info
snippbot-device capabilities  List detected capabilities

Capabilities

The agent auto-detects what the machine can do:

Capability Requirement Description
execution.bash Built-in Shell commands (bash, zsh, cmd)
execution.python Built-in Python script execution
filesystem.read Built-in Read files
filesystem.write Built-in Write files
filesystem.transfer Built-in Send/receive files to daemon
system.info Built-in OS, CPU, memory, disk info
capture.screenshot [screen] extra Take screenshots
capture.camera_photo [camera] extra Camera capture
browser.navigate [browser] extra Browser automation
display.remote_view [remote] extra Screen streaming
execution.docker Docker CLI in PATH Docker container management

Configuration

Config is stored at ~/.snippbot-device/config.toml after pairing.

daemon_host = "192.168.1.100"
daemon_ws_port = 18781
device_name = "my-laptop"
device_token = "device_..."
device_id = "..."
max_concurrent_tasks = 4
heartbeat_interval = 15
auto_update = true

How It Works

  1. The agent connects to the daemon via WebSocket (ws://host:port/ws/device)
  2. Authenticates using the token received during pairing
  3. Advertises its capabilities (what tools it can execute)
  4. Enters a message loop waiting for tool requests
  5. Sends heartbeats every 15 seconds with CPU/memory/disk metrics
  6. Auto-reconnects with exponential backoff if the connection drops

Security

  • Device tokens are stored locally and validated on each connection
  • Environment variables matching *_KEY, *_SECRET, *_TOKEN, *_PASSWORD are stripped from command execution
  • File operations are restricted to allowed paths (configurable)
  • Execution timeout: 5 minutes max per tool call
  • Output limit: 1 MB per result

Logs

# Foreground mode: logs to stdout
# Background mode: logs to ~/.snippbot-device/agent.log
tail -f ~/.snippbot-device/agent.log

See Also

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

snippbot_device-0.1.1.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

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

snippbot_device-0.1.1-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file snippbot_device-0.1.1.tar.gz.

File metadata

  • Download URL: snippbot_device-0.1.1.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for snippbot_device-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3bf081349dc55368a1367f884cc6aa748913fdb68b6492781f2641bf8d8e52af
MD5 2f2058fd9059c6f145c470c3510fc6d6
BLAKE2b-256 19f58b9edd59eaa705812254be9adb13b058d26c0e44114fb89bf704b806b705

See more details on using hashes here.

File details

Details for the file snippbot_device-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for snippbot_device-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cef1c950549928693df3fe4a1bc86f1ee921ece0b5303cf1f3afb6068a853760
MD5 40da563af79f9c16033b3c5fa2dae1f3
BLAKE2b-256 6a0b773efca6c5cdea9e5fe4efd4ccb736cb7adeac572802be1cc54738e05476

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