Command-line interface for executing automated workflows with YAML configuration files
634
Command-line interface for executing automated workflows with YAML configuration.
Open-Automator Shell is a powerful CLI tool for running automated workflows defined in YAML files. It provides a flexible, modular approach to automation with support for encrypted wallets, task orchestration, and comprehensive error handling.
docker pull lordraw/open-automator-shell:latest
# Run a workflow file
docker run --rm \
-v $(pwd)/workflows:/workflows \
-v $(pwd)/data:/data \
lordraw/open-automator-shell:latest \
/workflows/myworkflow.yaml
docker run --rm \
-v $(pwd)/workflows:/workflows \
-v $(pwd)/data:/data \
-e OA_WALLET_FILE=/data/wallet.enc \
-e OA_WALLET_PASSWORD=mysecret \
lordraw/open-automator-shell:latest \
/workflows/myworkflow.yaml
# Create a simple workflow
cat > workflow.yaml << 'EOF'
- tasks:
- name: hello
module: oa-system
function: execute_command
params:
command: echo "Hello from Open-Automator!"
EOF
# Run it
docker run --rm -v $(pwd):/workflows lordraw/open-automator-shell:latest /workflows/workflow.yaml
# workflow-advanced.yaml
- tasks:
- name: check_disk
module: oa-system
function: execute_command
params:
command: df -h
on_success: backup_files
on_failure: notify_error
- name: backup_files
module: oa-io
function: copy_file
params:
source: /data/important.txt
destination: /backup/important.txt
- name: notify_error
module: oa-notify
function: send_notification
params:
message: "Disk check failed!"
docker run --rm \
-v $(pwd):/workflows \
-v $(pwd)/data:/data \
-v $(pwd)/backup:/backup \
lordraw/open-automator-shell:latest \
/workflows/workflow-advanced.yaml
# First, create a wallet
docker run --rm -it \
-v $(pwd)/data:/data \
lordraw/open-automator-wallet:latest \
create /data/wallet.enc
# Then use it in workflow
docker run --rm \
-v $(pwd)/workflows:/workflows \
-v $(pwd)/data:/data \
-e OA_WALLET_FILE=/data/wallet.enc \
-e OA_WALLET_PASSWORD=mysecret \
lordraw/open-automator-shell:latest \
/workflows/workflow-with-secrets.yaml
Workflow with secrets:
# workflow-with-secrets.yaml
- tasks:
- name: connect_db
module: oa-pg
function: connect
params:
host: "{{DB_HOST}}"
user: "{{DB_USER}}"
password: "{{DB_PASSWORD}}"
database: "{{DB_NAME}}"
# workflow-git.yaml
- tasks:
- name: clone_repo
module: oa-git
function: clone_repository
params:
url: https://github.com/user/repo.git
path: /data/repo
- name: checkout_branch
module: oa-git
function: checkout
params:
repo_path: /data/repo
branch: main
docker run --rm \
-v $(pwd)/data:/data \
lordraw/open-automator-shell:latest \
/data/workflow-git.yaml
| Variable | Description | Default | Required |
|---|---|---|---|
OA_WALLET_FILE | Path to wallet file (encrypted or JSON) | /data/wallet.enc | No |
OA_WALLET_PASSWORD | Password for encrypted wallet | changeme | No* |
WORKFLOW_PATH | Default path for workflows | /workflows | No |
LOG_LEVEL | Logging level (DEBUG, INFO, WARNING, ERROR) | INFO | No |
*Required only for encrypted wallets
version: '3.8'
services:
# One-shot workflow execution
workflow-runner:
image: lordraw/open-automator-shell:latest
volumes:
- ./workflows:/workflows
- ./data:/data
- ./logs:/logs
environment:
- OA_WALLET_FILE=/data/wallet.enc
- OA_WALLET_PASSWORD=${WALLET_PASSWORD}
- LOG_LEVEL=INFO
command: /workflows/main-workflow.yaml
restart: "no"
# Scheduled execution with cron
scheduled-workflow:
image: lordraw/open-automator-shell:latest
volumes:
- ./workflows:/workflows
- ./data:/data
environment:
- OA_WALLET_FILE=/data/wallet.json
entrypoint: /bin/bash
command: |
-c "while true; do
python3.12 automator.py /workflows/hourly-task.yaml
sleep 3600
done"
restart: unless-stopped
Run with:
WALLET_PASSWORD=mysecret docker-compose up
Recommended volume mounts:
docker run --rm \
-v /path/to/workflows:/workflows:ro \ # Workflow files (read-only)
-v /path/to/data:/data \ # Data directory
-v /path/to/logs:/logs \ # Log output
-v /path/to/output:/output \ # Workflow outputs
lordraw/open-automator-shell:latest \
/workflows/myworkflow.yaml
The shell includes these built-in modules:
# Basic workflow structure
- tasks:
- name: task_name
module: module_name
function: function_name
params:
param1: value1
param2: value2
on_success: next_task # Optional
on_failure: error_task # Optional
- name: next_task
module: another_module
function: another_function
-v $(pwd)/workflows:/workflows:ro
This prevents accidental modification of workflow files.
Use wallet files instead of hardcoding secrets:
# Good ✅
params:
password: "{{DB_PASSWORD}}"
# Bad ❌
params:
password: "hardcoded_secret"
For development/testing, use plain JSON wallets:
echo '{"DB_PASSWORD": "test123"}' > data/wallet.json
docker run --rm \
-v $(pwd)/data:/data \
-e OA_WALLET_FILE=/data/wallet.json \
lordraw/open-automator-shell:latest workflow.yaml
docker run --rm lordraw/open-automator-shell:latest workflow.yaml
if [ $? -eq 0 ]; then
echo "Workflow succeeded"
else
echo "Workflow failed"
fi
docker run --rm \
-e LOG_LEVEL=DEBUG \
lordraw/open-automator-shell:latest \
workflow.yaml 2>&1 | tee workflow.log
This image supports multiple architectures:
linux/amd64 - Intel/AMD 64-bitlinux/arm64 - ARM 64-bit (Apple Silicon, ARM servers)Docker will automatically pull the correct architecture for your system.
The container includes a basic health check:
HEALTHCHECK CMD pgrep -f python3.12 || exit 1
# Ensure absolute path or correct mount
docker run --rm -v $(pwd):/workflows lordraw/open-automator-shell:latest /workflows/file.yaml
# Verify password is correct
docker run --rm -it -v $(pwd)/data:/data lordraw/open-automator-wallet:latest verify /data/wallet.enc
# Fix file permissions (container uses uid 1000)
chown -R 1000:1000 data/
# List available modules
docker run --rm lordraw/open-automator-shell:latest --list-modules
Issues: GitHub Issues
Documentation: Full Docs
Examples: Workflow Examples
Star us on GitHub! ⭐ https://github.com/lordraw77/open-automator
Content type
Image
Digest
sha256:b66657b1b…
Size
300.5 MB
Last updated
7 months ago
docker pull lordraw/open-automator-shell