Skip to main content

Local agent runner for ClevAgent — heartbeat proxy and remote restart executor.

Project description

clevagent-runner

Local agent runner for ClevAgent — heartbeat proxy and remote restart executor.

Document role:

  • package-level operator guide for clevagent-runner
  • focuses on runner installation, flags, and local execution behavior
  • broader product/tier contracts belong in the repo root docs and public site docs

What It Does

clevagent-runner runs alongside your AI agents on your machine or server. It:

  1. Heartbeat proxy — Checks whether each watched process/container is alive and sends heartbeats to ClevAgent on its behalf. No changes needed inside your agent code.
  2. Command executor — Polls ClevAgent for restart/stop commands and executes them securely. Only targets explicitly listed in --watch can be restarted (whitelist enforced at runtime).

Installation

pip install clevagent-runner

Requires Python 3.8+. No system dependencies beyond requests.

Quick Start

clevagent-runner start \
  --api-key "cv_your_project_key" \
  --watch "docker:my-trading-bot" \
  --watch "launchd:com.mycompany.crypto-agent"

Your project API key is available in the ClevAgent dashboard under Settings → API Key.

Supported Watch Types

Type Target format Example
docker Container name docker:my-bot
systemd Service name systemd:my-agent.service
launchd Label (macOS) launchd:com.myco.agent
process pgrep -f substring process:python agent.py

Options

clevagent-runner start --help

  --api-key TEXT            ClevAgent project API key (cv_xxx)  [required]
  --watch TYPE:TARGET       Process to watch. Repeatable.
  --endpoint URL            ClevAgent server (default: https://clevagent.io)
  --heartbeat-interval INT  Seconds between heartbeats (default: 30)
  --log-level LEVEL         DEBUG|INFO|WARNING|ERROR (default: INFO)

Running as a Background Service

macOS (launchd)

<!-- ~/Library/LaunchAgents/io.clevagent.runner.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key><string>io.clevagent.runner</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/clevagent-runner</string>
    <string>start</string>
    <string>--api-key</string><string>cv_YOUR_KEY</string>
    <string>--watch</string><string>docker:my-agent</string>
  </array>
  <key>RunAtLoad</key><true/>
  <key>KeepAlive</key><true/>
  <key>StandardErrorPath</key><string>/tmp/clevagent-runner.err.log</string>
</dict>
</plist>
launchctl load ~/Library/LaunchAgents/io.clevagent.runner.plist

Linux (systemd)

# /etc/systemd/system/clevagent-runner.service
[Unit]
Description=ClevAgent Runner
After=network.target

[Service]
ExecStart=/usr/local/bin/clevagent-runner start \
  --api-key cv_YOUR_KEY \
  --watch docker:my-agent
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
systemctl enable --now clevagent-runner

Security

  • Whitelist-only: Only targets passed via --watch can receive restart/stop commands from the server.
  • No shell execution: Commands are assembled from hardcoded safe templates with shell=False.
  • API key scoped: The runner only has access to agents in your project.

License

MIT — see LICENSE.

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

clevagent_runner-0.1.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

clevagent_runner-0.1.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clevagent_runner-0.1.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clevagent_runner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6dcdc16d6777e270543175f260bf995c5231e6ab668ecde4614c6a9f0566181
MD5 9b27296c4c86fc92b7e849acbe2163a2
BLAKE2b-256 8735378c54044f00d9d9b7ea00f4fa77062c0580991c47f4a729ea7d6d6065c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for clevagent_runner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e181ddb1fa02001f9dfe275e48ee3d959eaae71cd91bbd651917b478831bfc5a
MD5 a770b2a1ed17182751c4a116ee317e8e
BLAKE2b-256 68892fcffb4b2532b1b935e06ed25d2a2a65e25210b0a3187b3a212f88ffac08

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