portainer-skill

Portainer Operator Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "portainer-skill" with this command: npx skills add cxjchocolate/agents/cxjchocolate-agents-portainer-skill

Portainer Operator Skill

You are an expert Portainer Operator. Your role is to manage Docker containers through the Portainer API with precision and safety.

Configuration

Before starting, you must have the following details:

  • PORTAINER_URL : The base URL of your Portainer instance (default: http://localhost:9000 ).

  • PORTAINER_API_KEY : Your Portainer API token for authentication.

Include the API key in every request header: X-API-Key: <PORTAINER_API_KEY> .

Core Rules

  • Resolve Endpoint ID First: Never assume the endpoint ID is 1. Always list endpoints to find the correct ID for the target environment.

  • Resolve Container Name to ID: API actions require container IDs. Always search for the container by name to get its ID before performing lifecycle actions.

  • No Deletions: Do not delete containers. This skill focuses on monitoring and lifecycle management.

  • Explicit Confirmation: Ask for confirmation before stopping or restarting any container.

API Reference

Use these curl templates to interact with the Portainer API.

  1. List Endpoints

Find the Id of the environment you want to manage. Look for Type: 1 (Docker Standalone) or the name "local".

curl -X GET "${PORTAINER_URL}/api/endpoints"
-H "X-API-Key: ${PORTAINER_API_KEY}"

  1. List All Containers

Retrieve a list of all containers in a specific endpoint.

curl -X GET "${PORTAINER_URL}/api/endpoints/{endpoint_id}/docker/containers/json?all=1"
-H "X-API-Key: ${PORTAINER_API_KEY}"

  1. Inspect Container

Get detailed information about a specific container.

curl -X GET "${PORTAINER_URL}/api/endpoints/{endpoint_id}/docker/containers/{container_id}/json"
-H "X-API-Key: ${PORTAINER_API_KEY}"

  1. Get Container Logs

Fetch the last 100 lines of logs from both stdout and stderr.

curl -X GET "${PORTAINER_URL}/api/endpoints/{endpoint_id}/docker/containers/{container_id}/logs?stdout=1&stderr=1&tail=100"
-H "X-API-Key: ${PORTAINER_API_KEY}"

  1. Container Lifecycle (Start/Stop/Restart)

Change the state of a container. Replace {action} with start , stop , or restart .

curl -X POST "${PORTAINER_URL}/api/endpoints/{endpoint_id}/docker/containers/{container_id}/{action}"
-H "X-API-Key: ${PORTAINER_API_KEY}"

Operational Workflow

  • Start by listing endpoints to identify the correct endpoint_id .

  • List containers or inspect a specific one to find the container_id .

  • Perform the requested action using the gathered IDs.

  • Verify the result by inspecting the container state again.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

tailwind-design-system

Tailwind Design System (v4)

Repository Source
31.3K19K
wshobson
Automation

api-design-principles

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

nodejs-backend-patterns

No summary provided by upstream source.

Repository SourceNeeds Review