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

pip install snippbot-device

With optional capabilities:

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 18782 --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 = 18782
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.0.tar.gz (23.8 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.0-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snippbot_device-0.1.0.tar.gz
  • Upload date:
  • Size: 23.8 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.0.tar.gz
Algorithm Hash digest
SHA256 d42e371cbbd25cc266595f4e7fd8cf4e9523f44fb54a9a048e6479b503fe1d28
MD5 c23a4f2a27202c22a05cebccbe962858
BLAKE2b-256 33c18c7c84955d3e10b2a247cc82935f6664a313fc7b6b1704cf5e8fe60a7d3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snippbot_device-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3889f496261435953613dbb6651804f88f4979720146dcaa01510cf9e5b36e6f
MD5 55bfc50596051df5a47df28ebb0946d7
BLAKE2b-256 74bff2d20f90b2054538a10e0520096cf53ab204dfd11f1fd22d47a23994897b

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