CapRover Management
Analyze CapRover apps, containers, cluster nodes, and deployment configuration.
Phase 1: Discovery
#!/bin/bash
CAPTAIN_URL="${CAPROVER_URL}"
TOKEN="${CAPROVER_API_TOKEN}"
BASE="${CAPTAIN_URL}/api/v2"
AUTH=(-H "x-captain-auth: ${TOKEN}" -H "Content-Type: application/json")
echo "=== All Apps ==="
curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \
| jq -r '.data.appDefinitions[] | "\(.appName)\t\(.hasPersistentData)\t\(.instanceCount)\t\(.notExposeAsWebApp)\t\(.hasDefaultSubDomainSsl)"' \
| column -t | head -20
echo ""
echo "=== App Details ==="
curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \
| jq '.data.appDefinitions[] | {
appName,
instanceCount,
captainDefinitionRelativeFilePath,
hasPersistentData,
customDomain: [.customDomain[]?.publicDomain],
envVarCount: (.envVars | length),
volumeCount: (.volumes | length),
ports: [.ports[]?]
}' | head -40
echo ""
echo "=== Cluster Nodes ==="
curl -s "${BASE}/user/system/nodes" "${AUTH[@]}" \
| jq -r '.data.nodes[] | "\(.nodeId)\t\(.hostname)\t\(.ip)\t\(.state)\t\(.isLeader)"' \
| column -t
echo ""
echo "=== Docker Registries ==="
curl -s "${BASE}/user/registries" "${AUTH[@]}" \
| jq -r '.data.registries[] | "\(.id)\t\(.registryDomain)\t\(.registryUser)"' \
| column -t
Phase 2: Analysis
#!/bin/bash
CAPTAIN_URL="${CAPROVER_URL}"
TOKEN="${CAPROVER_API_TOKEN}"
BASE="${CAPTAIN_URL}/api/v2"
AUTH=(-H "x-captain-auth: ${TOKEN}" -H "Content-Type: application/json")
echo "=== App Container Status ==="
curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \
| jq '.data.appDefinitions[] | {
appName,
instanceCount,
versions: [.versions[]? | {version, timeStamp, deployedImageName}] | last(3)
}' | head -30
echo ""
echo "=== Custom Domains & SSL ==="
curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \
| jq -r '.data.appDefinitions[] | select(.customDomain | length > 0) | "\(.appName)\t\(.customDomain | map(.publicDomain) | join(","))\tSSL:\(.hasDefaultSubDomainSsl)"' \
| column -t
echo ""
echo "=== Persistent Directories ==="
curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \
| jq -r '.data.appDefinitions[] | select(.volumes | length > 0) | "\(.appName)\t\(.volumes | map(.containerPath) | join(","))"' \
| column -t
echo ""
echo "=== Resource Limits ==="
curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \
| jq '.data.appDefinitions[] | select(.containerHttpPort != null) | {
appName,
containerHttpPort: .containerHttpPort,
httpPort: .containerHttpPort,
websocketSupport: .websocketSupport
}'
echo ""
echo "=== System Info ==="
curl -s "${BASE}/user/system/info" "${AUTH[@]}" \
| jq '.data | {
hasRootSsl: .hasRootSsl,
rootDomain: .rootDomain,
captainVersion: .captainVersion,
dockerVersion: .dockerVersion
}'
echo ""
echo "=== Nginx Config Status ==="
curl -s "${BASE}/user/system/nginxconfig" "${AUTH[@]}" \
| jq '{baseConfig: (.data.baseConfig.customValue | length > 0), captainConfig: (.data.captainConfig.customValue | length > 0)}' 2>/dev/null
Output Format
CAPROVER ANALYSIS
==================
App Instances Domains SSL Volumes Env-Vars
────────────────────────────────────────────────────────────────────────
web-app 2 app.example.com Yes 1 8
api-server 3 api.example.com Yes 0 12
worker 1 none No 2 5
Cluster: 2 nodes (1 leader) | Docker: v24.0.7 | Captain: v1.12.0
Root Domain: captain.example.com | Root SSL: Yes
Safety Rules
- Read-only: Only use GET endpoints against the CapRover API
- Never deploy, scale, or delete apps without explicit confirmation
- Env vars: Never output environment variable values, only counts
- Auth token: Keep the captain auth token secure, rotate regularly
Anti-Hallucination Rules
- NEVER assume resource names — always discover via CLI/API in Phase 1 before referencing in Phase 2.
- NEVER fabricate metric names or dimensions — verify against the service documentation or
--help output.
- NEVER mix CLI commands between service versions — confirm which version/API you are targeting.
- ALWAYS use the discovery → verify → analyze chain — every resource referenced must have been discovered first.
- ALWAYS handle empty results gracefully — an empty response is valid data, not an error to retry.
Counter-Rationalizations
| Shortcut |
Counter |
Why |
| "I'll skip discovery and check known resources" |
Always run Phase 1 discovery first |
Resource names change, new resources appear — assumed names cause errors |
| "The user only asked for a quick check" |
Follow the full discovery → analysis flow |
Quick checks miss critical issues; structured analysis catches silent failures |
| "Default configuration is probably fine" |
Audit configuration explicitly |
Defaults often leave logging, security, and optimization features disabled |
| "Metrics aren't needed for this" |
Always check relevant metrics when available |
API/CLI responses show current state; metrics reveal trends and intermittent issues |
| "I don't have access to that" |
Try the command and report the actual error |
Assumed permission failures prevent useful investigation; actual errors are informative |
1---2name: managing-caprover3description: |4 Use when working with Caprover — capRover self-hosted PaaS management covering5 app inventory, container status, custom domain mappings, persistent directory6 mounts, environment variable auditing, cluster node status, Docker registry7 integration, and Nginx configuration review. Use for managing CapRover8 infrastructure.9connection_type: caprover10preload: false11metadata:12 source: https://skillmd.com/skills/cloudthinker-ai/managing-caprover13---1415# CapRover Management1617Analyze CapRover apps, containers, cluster nodes, and deployment configuration.1819## Phase 1: Discovery2021```bash22#!/bin/bash23CAPTAIN_URL="${CAPROVER_URL}"24TOKEN="${CAPROVER_API_TOKEN}"25BASE="${CAPTAIN_URL}/api/v2"26AUTH=(-H "x-captain-auth: ${TOKEN}" -H "Content-Type: application/json")2728echo "=== All Apps ==="29curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \30 | jq -r '.data.appDefinitions[] | "\(.appName)\t\(.hasPersistentData)\t\(.instanceCount)\t\(.notExposeAsWebApp)\t\(.hasDefaultSubDomainSsl)"' \31 | column -t | head -203233echo ""34echo "=== App Details ==="35curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \36 | jq '.data.appDefinitions[] | {37 appName,38 instanceCount,39 captainDefinitionRelativeFilePath,40 hasPersistentData,41 customDomain: [.customDomain[]?.publicDomain],42 envVarCount: (.envVars | length),43 volumeCount: (.volumes | length),44 ports: [.ports[]?]45 }' | head -404647echo ""48echo "=== Cluster Nodes ==="49curl -s "${BASE}/user/system/nodes" "${AUTH[@]}" \50 | jq -r '.data.nodes[] | "\(.nodeId)\t\(.hostname)\t\(.ip)\t\(.state)\t\(.isLeader)"' \51 | column -t5253echo ""54echo "=== Docker Registries ==="55curl -s "${BASE}/user/registries" "${AUTH[@]}" \56 | jq -r '.data.registries[] | "\(.id)\t\(.registryDomain)\t\(.registryUser)"' \57 | column -t58```5960## Phase 2: Analysis6162```bash63#!/bin/bash64CAPTAIN_URL="${CAPROVER_URL}"65TOKEN="${CAPROVER_API_TOKEN}"66BASE="${CAPTAIN_URL}/api/v2"67AUTH=(-H "x-captain-auth: ${TOKEN}" -H "Content-Type: application/json")6869echo "=== App Container Status ==="70curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \71 | jq '.data.appDefinitions[] | {72 appName,73 instanceCount,74 versions: [.versions[]? | {version, timeStamp, deployedImageName}] | last(3)75 }' | head -307677echo ""78echo "=== Custom Domains & SSL ==="79curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \80 | jq -r '.data.appDefinitions[] | select(.customDomain | length > 0) | "\(.appName)\t\(.customDomain | map(.publicDomain) | join(","))\tSSL:\(.hasDefaultSubDomainSsl)"' \81 | column -t8283echo ""84echo "=== Persistent Directories ==="85curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \86 | jq -r '.data.appDefinitions[] | select(.volumes | length > 0) | "\(.appName)\t\(.volumes | map(.containerPath) | join(","))"' \87 | column -t8889echo ""90echo "=== Resource Limits ==="91curl -s "${BASE}/user/apps/appDefinitions" "${AUTH[@]}" \92 | jq '.data.appDefinitions[] | select(.containerHttpPort != null) | {93 appName,94 containerHttpPort: .containerHttpPort,95 httpPort: .containerHttpPort,96 websocketSupport: .websocketSupport97 }'9899echo ""100echo "=== System Info ==="101curl -s "${BASE}/user/system/info" "${AUTH[@]}" \102 | jq '.data | {103 hasRootSsl: .hasRootSsl,104 rootDomain: .rootDomain,105 captainVersion: .captainVersion,106 dockerVersion: .dockerVersion107 }'108109echo ""110echo "=== Nginx Config Status ==="111curl -s "${BASE}/user/system/nginxconfig" "${AUTH[@]}" \112 | jq '{baseConfig: (.data.baseConfig.customValue | length > 0), captainConfig: (.data.captainConfig.customValue | length > 0)}' 2>/dev/null113```114115## Output Format116117```118CAPROVER ANALYSIS119==================120App Instances Domains SSL Volumes Env-Vars121────────────────────────────────────────────────────────────────────────122web-app 2 app.example.com Yes 1 8123api-server 3 api.example.com Yes 0 12124worker 1 none No 2 5125126Cluster: 2 nodes (1 leader) | Docker: v24.0.7 | Captain: v1.12.0127Root Domain: captain.example.com | Root SSL: Yes128```129130## Safety Rules131132- **Read-only**: Only use GET endpoints against the CapRover API133- **Never deploy, scale, or delete** apps without explicit confirmation134- **Env vars**: Never output environment variable values, only counts135- **Auth token**: Keep the captain auth token secure, rotate regularly136137## Anti-Hallucination Rules1381391. **NEVER assume resource names** — always discover via CLI/API in Phase 1 before referencing in Phase 2.1402. **NEVER fabricate metric names or dimensions** — verify against the service documentation or `--help` output.1413. **NEVER mix CLI commands between service versions** — confirm which version/API you are targeting.1424. **ALWAYS use the discovery → verify → analyze chain** — every resource referenced must have been discovered first.1435. **ALWAYS handle empty results gracefully** — an empty response is valid data, not an error to retry.144145## Counter-Rationalizations146147| Shortcut | Counter | Why |148|----------|---------|-----|149| "I'll skip discovery and check known resources" | Always run Phase 1 discovery first | Resource names change, new resources appear — assumed names cause errors |150| "The user only asked for a quick check" | Follow the full discovery → analysis flow | Quick checks miss critical issues; structured analysis catches silent failures |151| "Default configuration is probably fine" | Audit configuration explicitly | Defaults often leave logging, security, and optimization features disabled |152| "Metrics aren't needed for this" | Always check relevant metrics when available | API/CLI responses show current state; metrics reveal trends and intermittent issues |153| "I don't have access to that" | Try the command and report the actual error | Assumed permission failures prevent useful investigation; actual errors are informative |154