Back to Skills
    🦞

    arcane-docker-manager

    This skill enables you to interact with your Arcane

    By @cougz
    View on GitHub
    SKILL.md
    # OpenClaw - Arcane Docker Management Skill
    
    ## Overview
    This skill enables you to interact with your Arcane Docker Management API to manage Docker containers, compose stacks, templates, networks, volumes, images, and system monitoring. Arcane is a comprehensive Docker management platform with a REST API.
    
    ## When to Use This Skill
    Use this skill when the user requests any of the following:
    - Managing Docker containers (list, start, stop, restart, remove, inspect)
    - Managing Docker Compose stacks (deploy, update, remove, view logs)
    - Working with Docker templates (create, deploy, manage)
    - Managing Docker images (list, pull, remove, prune)
    - Managing Docker networks and volumes
    - Monitoring system resources and Docker statistics
    - Managing user accounts and API keys
    - Viewing system logs and events
    
    ## API Configuration
    
    ### Base URL
    The API base URL should be configured by the user. Default: `http://localhost:3552/api`
    
    ### Authentication
    Arcane supports two authentication methods:
    
    1. **Bearer Token (JWT)**: Obtained via login endpoint
    2. **API Key**: Long-lived authentication using `X-API-Key` header
    
    #### Getting a Bearer Token
    ```bash
    curl -X POST "$BASE_URL/auth/login" \
      -H "Content-Type: application/json" \
      -d '{
        "username": "admin",
        "password": "your_password"
      }'
    ```
    
    Response includes `token`, `refreshToken`, and `expiresAt`.
    
    #### Using API Keys
    API keys can be created and managed through the `/apikeys` endpoints. Use the `X-API-Key` header for authentication.
    
    ## Core Functionality
    
    ### 1. Container Management
    
    #### List Containers
    ```bash
    # Get all containers
    curl -X GET "$BASE_URL/containers" \
      -H "Authorization: Bearer $TOKEN"
    
    # Filter by status
    curl -X GET "$BASE_URL/containers?status=running" \
      -H "Authorization: Bearer $TOKEN"
    
    # Search containers
    curl -X GET "$BASE_URL/containers?search=nginx" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Container Operations
    ```bash
    # Start container
    curl -X POST "$BASE_URL/containers/{id}/start" \
      -H "Authorization: Bearer $TOKEN"
    
    # Stop container
    curl -X POST "$BASE_URL/containers/{id}/stop" \
      -H "Authorization: Bearer $TOKEN"
    
    # Restart container
    curl -X POST "$BASE_URL/containers/{id}/restart" \
      -H "Authorization: Bearer $TOKEN"
    
    # Remove container
    curl -X DELETE "$BASE_URL/containers/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Get container details
    curl -X GET "$BASE_URL/containers/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Get container logs
    curl -X GET "$BASE_URL/containers/{id}/logs?tail=100" \
      -H "Authorization: Bearer $TOKEN"
    
    # Get container stats
    curl -X GET "$BASE_URL/containers/{id}/stats" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Advanced Container Operations
    ```bash
    # Execute command in container
    curl -X POST "$BASE_URL/containers/{id}/exec" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "command": ["ls", "-la"],
        "workingDir": "/app"
      }'
    
    # Rename container
    curl -X POST "$BASE_URL/containers/{id}/rename" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "new-container-name"
      }'
    
    # Update container resources
    curl -X POST "$BASE_URL/containers/{id}/update" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "cpuShares": 512,
        "memory": 536870912,
        "restartPolicy": "unless-stopped"
      }'
    ```
    
    ### 2. Docker Compose Stack Management
    
    #### List Stacks
    ```bash
    curl -X GET "$BASE_URL/stacks" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Deploy Stack from Template
    ```bash
    curl -X POST "$BASE_URL/stacks" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "my-stack",
        "templateId": "template-id",
        "envVars": {
          "PORT": "8080",
          "DATABASE_URL": "postgres://..."
        }
      }'
    ```
    
    #### Deploy Stack from Compose File
    ```bash
    curl -X POST "$BASE_URL/stacks" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "my-stack",
        "composeContent": "version: \"3.8\"\nservices:\n  web:\n    image: nginx:latest\n    ports:\n      - \"80:80\""
      }'
    ```
    
    #### Stack Operations
    ```bash
    # Get stack details
    curl -X GET "$BASE_URL/stacks/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Update stack
    curl -X PUT "$BASE_URL/stacks/{id}" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "envVars": {
          "PORT": "9090"
        }
      }'
    
    # Remove stack
    curl -X DELETE "$BASE_URL/stacks/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Start stack
    curl -X POST "$BASE_URL/stacks/{id}/start" \
      -H "Authorization: Bearer $TOKEN"
    
    # Stop stack
    curl -X POST "$BASE_URL/stacks/{id}/stop" \
      -H "Authorization: Bearer $TOKEN"
    
    # Restart stack
    curl -X POST "$BASE_URL/stacks/{id}/restart" \
      -H "Authorization: Bearer $TOKEN"
    
    # Get stack logs
    curl -X GET "$BASE_URL/stacks/{id}/logs?tail=100" \
      -H "Authorization: Bearer $TOKEN"
    
    # Pull latest images for stack
    curl -X POST "$BASE_URL/stacks/{id}/pull" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    ### 3. Template Management
    
    #### List Templates
    ```bash
    curl -X GET "$BASE_URL/templates" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Create Template
    ```bash
    curl -X POST "$BASE_URL/templates" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "nginx-template",
        "description": "Basic nginx web server",
        "content": "version: \"3.8\"\nservices:\n  web:\n    image: nginx:{{VERSION}}\n    ports:\n      - \"{{PORT}}:80\"",
        "variables": [
          {
            "name": "VERSION",
            "description": "Nginx version",
            "defaultValue": "latest"
          },
          {
            "name": "PORT",
            "description": "Host port",
            "defaultValue": "80"
          }
        ],
        "category": "web-servers",
        "tags": ["nginx", "web"]
      }'
    ```
    
    #### Template Operations
    ```bash
    # Get template
    curl -X GET "$BASE_URL/templates/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Update template
    curl -X PUT "$BASE_URL/templates/{id}" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "updated-template-name",
        "description": "Updated description"
      }'
    
    # Delete template
    curl -X DELETE "$BASE_URL/templates/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Get template content with parsed variables
    curl -X GET "$BASE_URL/templates/{id}/content" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Global Template Variables
    ```bash
    # Get global variables
    curl -X GET "$BASE_URL/templates/global-variables" \
      -H "Authorization: Bearer $TOKEN"
    
    # Update global variables
    curl -X PUT "$BASE_URL/templates/global-variables" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "GLOBAL_DOMAIN": "example.com",
        "GLOBAL_NETWORK": "traefik-public"
      }'
    ```
    
    ### 4. Image Management
    
    #### List Images
    ```bash
    curl -X GET "$BASE_URL/images" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Pull Image
    ```bash
    curl -X POST "$BASE_URL/images/pull" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "image": "nginx:latest"
      }'
    ```
    
    #### Image Operations
    ```bash
    # Get image details
    curl -X GET "$BASE_URL/images/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Remove image
    curl -X DELETE "$BASE_URL/images/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Prune unused images
    curl -X POST "$BASE_URL/images/prune" \
      -H "Authorization: Bearer $TOKEN"
    
    # Search images in registry
    curl -X GET "$BASE_URL/images/search?term=nginx" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    ### 5. Network Management
    
    #### List Networks
    ```bash
    curl -X GET "$BASE_URL/networks" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Create Network
    ```bash
    curl -X POST "$BASE_URL/networks" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "my-network",
        "driver": "bridge",
        "internal": false,
        "attachable": true
      }'
    ```
    
    #### Network Operations
    ```bash
    # Get network details
    curl -X GET "$BASE_URL/networks/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Remove network
    curl -X DELETE "$BASE_URL/networks/{id}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Connect container to network
    curl -X POST "$BASE_URL/networks/{id}/connect" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "containerId": "container-id"
      }'
    
    # Disconnect container from network
    curl -X POST "$BASE_URL/networks/{id}/disconnect" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "containerId": "container-id"
      }'
    
    # Prune unused networks
    curl -X POST "$BASE_URL/networks/prune" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    ### 6. Volume Management
    
    #### List Volumes
    ```bash
    curl -X GET "$BASE_URL/volumes" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    #### Create Volume
    ```bash
    curl -X POST "$BASE_URL/volumes" \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "my-volume",
        "driver": "local",
        "labels": {
          "project": "my-app"
        }
      }'
    ```
    
    #### Volume Operations
    ```bash
    # Get volume details
    curl -X GET "$BASE_URL/volumes/{name}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Remove volume
    curl -X DELETE "$BASE_URL/volumes/{name}" \
      -H "Authorization: Bearer $TOKEN"
    
    # Prune unused volumes
    curl -X POST "$BASE_URL/volumes/prune" \
      -H "Authorization: Bearer $TOKEN"
    ```
    
    ### 7. System Monitoring
    
    #### System Information
    ```bash
    # Get Docker system info
    curl -X GET "$BASE_URL/system/info"
    
    ... (truncated)