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.2.tar.gz (25.0 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.2-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snippbot_device-0.1.2.tar.gz
  • Upload date:
  • Size: 25.0 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.2.tar.gz
Algorithm Hash digest
SHA256 c498f54fc654a3c9ba9e94f01aeefed76fbd034734d85affdcc16369d131025d
MD5 bca17236283d53cc3691cc42ea30482b
BLAKE2b-256 635720639af91f5c14fcfed321cdd9330f2cc3bdfa8cc7c2d9168bd3c77baedc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snippbot_device-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd093a901134c9abfe0c9127095adc83d60dd51ca7bdbefe19ea403e314392c
MD5 420bf1f71b1cd79b70fbf42ebc0e80ca
BLAKE2b-256 5684f6d113736dba5adfe0c87cef08885fa3eb7af832a43df4a4cbe171abbd68

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