Token导航 LogoToken导航TokenDH.com
运维和基础设施执行命令github未标认证来源可访问许可证需确认审计提醒

kamal-deployment卡迈勒部署

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

682

周安装

29

GitHub Stars

32

下载量

239
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:kamal-deployment(卡迈勒部署)
来源仓库:https://github.com/faqndo97/ai-skills
仓库路径:skills/kamal-deployment
安装命令:
npx skills add https://github.com/faqndo97/ai-skills --skill kamal-deployment
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/faqndo97/ai-skills --skill kamal-deployment

简介

kamal-deployment 用于辅助云资源、部署、容器、基础设施和运维自动化任务。

  • 适合让 Agent 检查配置、整理部署步骤、分析资源状态或生成排障思路。
  • 使用时需明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作。
  • 涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。

SKILL.md

Kamal 2 Deployment

Kamal is a deployment tool by 37signals that deploys containerized applications to any Linux server using Docker, SSH, and Kamal Proxy. It offers zero-downtime deploys, rolling restarts, automatic SSL/TLS certificates, and auxiliary services management.

Quick Start

# Install
gem install kamal

# Initialize in your project
kamal init
# Creates: config/deploy.yml, .kamal/secrets, .kamal/hooks/

# First deploy (bootstraps servers + deploys)
kamal setup

# Subsequent deploys
kamal deploy

Key Concepts

  • Service: Your application name, used to uniquely configure containers
  • Server: A virtual or physical host running your application image
  • Role: A server group running the same command (e.g., web, job)
  • Accessory: A long-running auxiliary service (database, Redis) with independent lifecycle
  • Kamal Proxy: Reverse proxy for zero-downtime deploys and SSL termination on each server
  • Kamal 2 provides its own private network called kamal - do NOT add a custom private network in your config

Configuration Reference

For complete deploy.yml configuration, see configuration.md.

Workflows

Initial Setup

  1. Run kamal init to generate config files
  2. Configure config/deploy.yml (see configuration.md)
  3. Set up .kamal/secrets with registry credentials and app secrets
  4. Ensure your app has a Dockerfile exposing port 80 with a /up health check
  5. Set config.assume_ssl = true and config.force_ssl = true in production.rb
  6. Exclude /up from host authorization in Rails 7+: config.host_authorization = {exclude: ->(request) {request.path == "/up"}}
  7. Run kamal setup for the first deployment

Deploying Updates

kamal deploy                    # Full deploy (build + push + deploy)
kamal deploy --skip-push        # Deploy existing image from registry
kamal deploy --version=VERSION  # Deploy specific version

Managing Accessories

kamal accessory boot all        # Boot all accessories
kamal accessory boot postgres   # Boot specific accessory
kamal accessory reboot redis    # Reboot an accessory
kamal accessory remove postgres # Remove an accessory
kamal accessory details postgres
kamal accessory logs postgres

Maintenance & Debugging

# Logs
kamal app logs                  # Application logs
kamal app logs -f               # Follow logs
kamal app logs -r web           # Logs for specific role
kamal proxy logs                # Proxy logs

# Console access
kamal app exec -i 'bin/rails console'
kamal app exec -i --reuse bash  # Shell into running container
kamal app exec --primary "bin/rails about"

# Rollback
kamal app containers            # List available versions
kamal rollback [VERSION]         # Rollback to version

# Redeploy (skip bootstrap, proxy setup, pruning, registry login)
kamal redeploy

# Locks
kamal lock status               # Check deploy lock
kamal lock acquire -m "reason"  # Prevent deploys
kamal lock release              # Allow deploys again

# Server management
kamal server bootstrap          # Bootstrap servers with Docker
kamal details                   # Show details about all containers
kamal audit                     # Show audit log from servers
kamal prune                     # Prune old images and containers
kamal config                    # Show combined config (includes secrets!)
kamal docs [SECTION]            # Show Kamal configuration docs

# Cleanup
kamal remove                    # Remove everything from servers

Global Flags

FlagDescription
-v, --verboseDetailed logging
-q, --quietMinimal logging
--version=VERSIONRun against specific app version
-p, --primaryPrimary host only
-h, --hosts=HOSTSComma-separated hosts (supports wildcards)
-r, --roles=ROLESComma-separated roles (supports wildcards)
-d, --destinationDeployment destination
-H, --skip-hooksSkip hook execution

Database Operations

# Run migrations via entrypoint (recommended)
# bin/docker-entrypoint handles db:prepare automatically

# Or via pre-deploy hook
kamal app exec -p -q -d $KAMAL_DESTINATION --version $KAMAL_VERSION "rails db:migrate"

# Database backup (with S3 backup accessory)
kamal accessory exec s3_backup "sh backup.sh"
kamal accessory exec s3_backup "sh restore.sh"

Architecture Patterns

For complete examples of single-server and multi-server setups, see examples.md.

Single Server (Rails + PostgreSQL + Redis + Sidekiq)

All services on one VPS with Let's Encrypt SSL. Best for small-to-medium apps.

Multi-Server (Scaled)

Separate servers for web, job, database, and cache behind a load balancer on a private network. Best for high-traffic apps.

Hooks

Custom scripts in .kamal/hooks/ that run at deployment points. If a hook returns non-zero, the command aborts.

Available: docker-setup, pre-connect, pre-build, pre-deploy, post-deploy, pre-app-boot, post-app-boot, pre-proxy-reboot, post-proxy-reboot.

For details, see configuration.md.

Upgrading from Kamal 1

kamal upgrade              # In-place upgrade from Kamal 1 to 2
kamal upgrade --rolling    # Zero-downtime upgrade
kamal downgrade            # Reverse if needed

Common Gotchas

  • Kamal 2 creates its own kamal network - remove any custom private network from your config
  • Always set config.assume_ssl = true in production.rb when using SSL
  • Do NOT use your domain name as the VM hostname - it overrides /etc/resolv.conf
  • Docker port exposure bypasses UFW - closing ports in UFW is not enough, Docker rules are higher in iptables
  • Short deploy_timeout causes failures on underpowered servers - increase it if deploys fail
  • Asset bridging must be explicitly configured with asset_path - it's not automatic
  • Accessories must be removed before moving to a new destination
  • Kamal 2 doesn't support ERB in config/deploy.yml (unlike Kamal 1)
  • Set config.reload_routes = false in Devise initializer to fix ActionController::RoutingError
  • Enable forward_headers: true in proxy config when behind Cloudflare to preserve real client IPs

CI/CD

For GitHub Actions deployment workflows, see cicd.md.

Backups

For database backup strategies with S3, see backups.md.

Server Hardening

For production server security setup, see server-hardening.md.

Logging & Monitoring

For Vector log aggregation and structured logging, see logging.md.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.35%
按下载量换算92

Claude

26.81%
按下载量换算64

Cursor

18.03%
按下载量换算43

Gemini CLI

8.87%
按下载量换算21

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/faqndo97/ai-skills --skill kamal-deployment 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills