Core Concept

Modules

Modules are reusable components that perform specific actions in workflows. Shiro supports built-in, HTTP, and subprocess modules.

Module Types

Built-in Modules

Compiled into the main Shiro binary. No additional setup required.

  • print - Console output
  • shell - Shell command execution
  • slack.notify - Slack notifications
  • git.diff - Git operations
  • gitlab - GitLab API operations
  • ai.generate - AI text generation

HTTP Modules

External services that communicate via HTTP API. Must implement the module API contract.

Example: Jira integration module running as a separate HTTP service.

Subprocess Modules

External binaries executed as subprocesses. Can be pre-compiled or run via go run.

Auto-detected execution mode based on module.yaml configuration.

Module Registry

Modules are registered in .shiro/modules/registry.yaml:

yaml
modules:
  slack:
    name: "Slack Notifications"
    type: "builtin"
    description: "Send notifications to Slack"
    version: "1.0.0"
  
  jira:
    name: "Jira Integration"
    type: "http"
    endpoints:
      - http://localhost:8080
    config: ".shiro/modules/jira/config.yaml"
    version: "1.0.0"
    
  custom-tool:
    name: "Custom Tool"
    type: "subprocess"
    source: "github.com/user/custom-tool"
    version: "1.0.0"

Managing Modules

bash
# List installed modules
shiro module list

# Add a module
shiro add module slack

# Add from GitHub
shiro add module github.com/user/custom-module

# Search for modules
shiro search module jira

# Remove a module
shiro remove module jira

HTTP Module API Contract

HTTP modules must implement these endpoints:

  • POST /execute - Execute the module with step configuration
  • GET /metadata - Return module metadata and schemas
  • GET /health - Health check endpoint