Skip to content

Plugin Development

Ready to extend Stavily? This guide walks you through creating plugins using real examples. We’ll use our Machine Data Extractor plugin as a practical case study.

  • Python 3.8+ (or your preferred language)
  • Git for version control
  • Basic programming knowledge

Let’s build a practical plugin that extracts system information. This is a real action plugin that demonstrates the complete development process.

  1. Create the plugin logic - A Python script that reads from stdin and writes to stdout
  2. Add configuration - Define what data to extract via plugin.yaml
  3. Test locally - Verify it works before deploying
  4. Package for distribution - Make it ready for the marketplace

Your plugin reads JSON config from stdin and writes JSON results to stdout:

#!/usr/bin/env python3
import json
import sys
import platform
import psutil # For system monitoring
def main():
# Read configuration from stdin
config = json.load(sys.stdin)
# Extract requested data
result = {"status": "success", "data": {}}
if config.get("extract_cpu"):
result["data"]["cpu"] = {
"count": psutil.cpu_count(),
"percent": psutil.cpu_percent(interval=1)
}
if config.get("extract_memory"):
mem = psutil.virtual_memory()
result["data"]["memory"] = {
"total": mem.total,
"available": mem.available,
"percent": mem.percent
}
# Write result to stdout
print(json.dumps(result))
if __name__ == "__main__":
main()

The plugin.yaml file tells Stavily how to run your plugin:

id: "machine-data-extractor"
name: "Machine Data Extractor"
description: "Extracts CPU, memory, and system information"
version: "1.0.0"
author: "Stavily Team"
type: "action"
runtime:
type: "python"
version: "3.8+"
entry_point: "main.py"
configuration:
extract_cpu:
type: "boolean"
description: "Extract CPU information"
default: false
extract_memory:
type: "boolean"
description: "Extract memory information"
default: false
permissions: [] # No special permissions needed

Test locally by piping JSON config to your script:

Terminal window
echo '{"extract_cpu": true, "extract_memory": true}' | python3 main.py

Expected output:

{
"status": "success",
"data": {
"cpu": {"count": 8, "percent": 15.2},
"memory": {"total": 17179869184, "available": 8589934592, "percent": 50.0}
}
}

Best for: Tasks that run once and complete Examples: Send notifications, run commands, process data Execution: Short-lived, receives config + trigger data

Best for: Continuous monitoring and event detection Examples: Watch files, monitor APIs, schedule tasks Execution: Long-running in orchestrator, emit events

Best for: Delivering results to external systems Examples: Send to Slack, log to database, update dashboards Execution: Process action results and deliver

Security First:

  • Validate all inputs to prevent injection attacks
  • Request minimal permissions (principle of least privilege)
  • Never hardcode secrets - use Stavily’s secret management

Performance:

  • Keep plugins lightweight and efficient
  • Implement timeouts for external calls
  • Handle errors gracefully without crashing

User Experience:

  • Clear, descriptive configuration options
  • Comprehensive error messages
  • Good documentation and examples

Ready to share your plugin? Here’s how to get it listed:

Terminal window
git init my-awesome-plugin
cd my-awesome-plugin
# Add your plugin files
git add .
git commit -m "Initial plugin release"
git remote add origin https://github.com/yourusername/my-awesome-plugin.git
git push -u origin main
  1. Go to the Stavily marketplace
  2. Click “Submit Plugin”
  3. Provide your Git repository URL
  4. Our team reviews and certifies your plugin
  • Browse existing plugins for inspiration and code examples
  • Join our developer community for support and collaboration
  • Check the marketplace for monetization opportunities

Start building - the automation ecosystem needs your creativity!

Ready to monetize? Get paid when users subscribe to your plugins:

  • 70% revenue share on premium plugins
  • Monthly payouts starting at $100 minimum
  • Transparent fees (only standard payment processing)
  1. Push your plugin to a Git repository
  2. Submit the repo URL to our marketplace
  3. Our team reviews and certifies your plugin
  4. Start earning when users install it!

Check out the marketplace for real plugins you can study and modify. The community has built everything from simple notification tools to complex enterprise integrations.

Start small, think big - your first plugin could become the next big automation tool!


This guide gets you building immediately. For advanced topics like multi-language support or complex integrations, explore the architecture guide.