portainer

Community

Portainer deployment management made simple.

Authorjayteealao
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill simplifies managing Portainer deployments by providing a Bash-based CLI to create, update, and inspect Docker stacks from a Git repository via the Portainer API.

Core Features & Use Cases

  • Create/Update Stacks: Deploy stacks from Git repositories and keep them in sync with Portainer.
  • Check Stack Status: Retrieve stack and container status to monitor deployments.
  • View Logs: Access container logs for debugging and health checks.
  • Use Case: You want to deploy a new application from a Git repo to Portainer, confirm the stack is healthy, and monitor its containers.

Quick Start

Set environment variables and run basic Portainer operations:

  • Export endpoints and tokens: export PORTAINER_URL="https://portainer.example.com" export PORTAINER_TOKEN="ptr_YOUR_TOKEN_HERE"

  • List stacks: curl -s "$PORTAINER_URL/api/stacks" -H "X-API-Key: $PORTAINER_TOKEN" | jq '.[] | {Id, Name, Status}'

  • Check a specific stack by name: STACK_NAME="my-stack" curl -s "$PORTAINER_URL/api/stacks" -H "X-API-Key: $PORTAINER_TOKEN" | jq ".[] | select(.Name=="$STACK_NAME")"

  • Redeploy a stack from Git: ENDPOINT_ID=$(curl -s "$PORTAINER_URL/api/endpoints" -H "X-API-Key: $PORTAINER_TOKEN" | jq '.[0].Id') STACK_ID=$(curl -s "$PORTAINER_URL/api/stacks" -H "X-API-Key: $PORTAINER_TOKEN" | jq -r ".[] | select(.Name=="$STACK_NAME") | .Id") curl -s -X PUT "$PORTAINER_URL/api/stacks/$STACK_ID/git/redeploy?endpointId=$ENDPOINT_ID"
    -H "X-API-Key: $PORTAINER_TOKEN"
    -H "Content-Type: application/json"
    -d '{"pullImage": true, "prune": false}'

Dependency Matrix

Required Modules

curljq

Components

scriptsreferences

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: portainer
Download link: https://github.com/jayteealao/Aperture/archive/main.zip#portainer

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.