Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

elizaOS Shell Plugin (Python)

A secure shell command execution plugin for elizaOS that allows agents to run terminal commands within a restricted directory with command history tracking.

Installation

pip install elizaos-plugin-shell

Features

  • Cross-platform support: Works on Linux, macOS, and Windows
  • Directory restriction: Commands are restricted to a specified directory for safety
  • Command filtering: Configurable list of forbidden commands
  • Timeout protection: Automatic termination of long-running commands
  • Command history: Tracks command execution history per conversation
  • File operation tracking: Monitors file creation, modification, and deletion
  • Type safe: Full type annotations with Pydantic models

Configuration

Set the following environment variables:

# Set the allowed directory (commands can only run here)
SHELL_ALLOWED_DIRECTORY=/path/to/safe/directory

# Optional: Set custom timeout in milliseconds (default: 30000)
SHELL_TIMEOUT=60000

# Optional: Add additional forbidden commands (comma-separated)
SHELL_FORBIDDEN_COMMANDS=rm,mv,cp,chmod,chown,shutdown,reboot

Usage

from elizaos_plugin_shell import ShellService, ShellConfig

# Load configuration
config = ShellConfig.from_env()

# Create service
service = ShellService(config)

# Execute a command
result = await service.execute_command("ls -la", conversation_id="conv-123")

if result.success:
    print(f"Output: {result.stdout}")
else:
    print(f"Error: {result.stderr}")

# Get command history
history = service.get_command_history("conv-123", limit=10)

# Clear history
service.clear_command_history("conv-123")

Security

The plugin enforces several security measures:

  1. Directory Restriction: All commands execute within SHELL_ALLOWED_DIRECTORY
  2. Forbidden Commands: Dangerous commands are blocked by default
  3. Path Traversal Protection: Blocks ../ and similar patterns
  4. No Shell Expansion: Commands execute without dangerous shell interpretation
  5. Timeout Protection: Commands auto-terminate after timeout

License

MIT

Metadata

Release files for elizaos-plugin-shell 2.0.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for elizaos-plugin-shell 2.0.0a5
File Size Uploaded
elizaos_plugin_shell-2.0.0a5.tar.gz 14.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elizaos-plugin-shell 2.0.0a5
File Interpreter ABI Platform
elizaos_plugin_shell-2.0.0a5-py3-none-any.whl Python 3 none any Details

Total release size: 31.4 kB

Release files / elizaos_plugin_shell-2.0.0a5.tar.gz

Download URL elizaos_plugin_shell-2.0.0a5.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a95a3fafd22cfa409b3783784e8c4cebe83558baff007609b42bce2dc033b43d
BLAKE2b-256 checksum
How to use checksums
3c1828d0c5c9d58e979826944e3273cb9a0f8f6ad74193065b0a522cf92ae92c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / elizaos_plugin_shell-2.0.0a5-py3-none-any.whl

Download URL elizaos_plugin_shell-2.0.0a5-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5bd062903b2c63d416e80f3c2d11b6130d40e6e949894d3743a38ca6d7a0965e
BLAKE2b-256 checksum
How to use checksums
d5de31dacf99fcfe950a7d6d05a3458df4208a5bd27723de6f3f53240e8380e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

2.0.0a5 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page