Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

vps-deployervps 部署者

Agent Skill

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

总安装

312

周安装

13

GitHub Stars

公开资料未说明

下载量

104
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

AgentSkills.tonpx skills
npx skills add davjdk/thermocalcbot --skill "vps-deployer"

简介

用于辅助云资源、部署、容器和基础设施运维。

  • 适合让 Agent 检查配置、整理部署步骤或分析资源状态。
  • 使用时需要明确目标环境、账号权限、区域和资源组。
  • 涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。
  • 支持 Codex、Claude、Cursor、Gemini CLI 宿主环境,通过 github 安装使用。

SKILL.md

VPS Deployer Skill

You manage deployment of code to the production VPS server.

When to Use This Skill

  • After successful merge to main (final step in feature workflow)
  • User asks to "deploy to VPS" or "задеплоить на сервер"
  • User asks to "update production" or "обновить прод"
  • Need to sync VPS with latest main branch

Prerequisites

Environment Variables (.env file)

Required variables in project .env:

VPS_HOST=79.174.84.103
VPS_USER=root
VPS_PASSWORD=your_password_here
VPS_PROJECT_PATH=/root/apps/ThermoCalcBot

Pre-Deployment Checks

Before deploying:

  1. Must be on main branch
  2. All changes committed and pushed
  3. Local main is up to date with origin
  4. All tests pass locally

Workflow

Step 1: Verify Deployment Readiness

# Check current branch
git branch --show-current

# Check for uncommitted changes
git status --porcelain

# Check if main is up to date
git fetch origin main
git log HEAD..origin/main --oneline
git log origin/main..HEAD --oneline

If not on main:

⚠️ Деплой возможен только из main

Текущая ветка: feature/xyz

Выполните мерж в main через merge-helper перед деплоем.

STOP

If uncommitted changes:

⚠️ Есть незакоммиченные изменения

Закоммитьте или отмените изменения перед деплоем.

STOP

If local behind origin:

⚠️ Локальный main отстаёт от origin

Выполните: git pull origin main

STOP

If origin behind local:

⚠️ Изменения не запушены в origin

Выполните: git push origin main

STOP

Step 2: Load VPS Configuration

import os
from dotenv import load_dotenv

load_dotenv()

vps_config = {
    "host": os.getenv("VPS_HOST"),
    "user": os.getenv("VPS_USER"),
    "password": os.getenv("VPS_PASSWORD"),
    "project_path": os.getenv("VPS_PROJECT_PATH", "/root/apps/ThermoCalcBot")
}

# Validate config
missing = [k for k, v in vps_config.items() if not v]
if missing:
    print(f"❌ Отсутствуют переменные: {', '.join(missing)}")

If config incomplete:

❌ Конфигурация VPS неполная

Отсутствуют переменные:
- VPS_HOST
- VPS_PASSWORD

Добавьте в .env файл:
VPS_HOST=79.174.84.103
VPS_USER=root
VPS_PASSWORD=your_password
VPS_PROJECT_PATH=/root/apps/ThermoCalcBot

STOP

Step 3: Connect and Deploy

Use SSH to connect to VPS and execute deployment commands:

# Using sshpass for password authentication
sshpass -p "$VPS_PASSWORD" ssh -o StrictHostKeyChecking=no $VPS_USER@$VPS_HOST << 'EOF'
cd /root/apps/ThermoCalcBot

echo "=== Pulling latest changes ==="
git pull origin main

echo "=== Syncing dependencies ==="
uv sync

echo "=== Restarting services ==="
systemctl restart thermobot
systemctl restart thermoapi

echo "=== Checking service status ==="
sleep 3
systemctl is-active thermobot
systemctl is-active thermoapi

echo "=== Deployment complete ==="
EOF

Step 3a: Install paramiko (if not installed):

On Windows (if paramiko not available):

pip install --user paramiko

Or using uv:

uv pip install paramiko --system

Step 3b: Create deployment script:

Create a Python script for deployment (platform-agnostic):

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""VPS Deploy Script for ThermoCalcBot"""
import os
import sys
import io
from dotenv import load_dotenv
import paramiko

# Set UTF-8 encoding for Windows console
if sys.platform == "win32":
    sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
    sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')

# Load environment variables
load_dotenv()

VPS_CONFIG = {
    "host": os.getenv("VPS_HOST"),
    "user": os.getenv("VPS_USER"),
    "password": os.getenv("VPS_PASSWORD"),
    "project_path": os.getenv("VPS_PROJECT_PATH", "/root/apps/ThermoCalcBot")
}

def execute_ssh_command(client, command):
    """Execute command via SSH and return output"""
    stdin, stdout, stderr = client.exec_command(command)
    output = stdout.read().decode()
    errors = stderr.read().decode()
    return output, errors

def deploy():
    """Deploy to VPS"""
    print(f"[INFO] Starting deployment to {VPS_CONFIG['host']}...")

    client = paramiko.SSHClient()
    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    try:
        print(f"[INFO] Connecting to {VPS_CONFIG['user']}@{VPS_CONFIG['host']}...")
        client.connect(
            hostname=VPS_CONFIG['host'],
            port=22,
            username=VPS_CONFIG['user'],
            password=VPS_CONFIG['password'],
            timeout=60,
            banner_timeout=60,
            auth_timeout=60
        )
        print("[OK] Connected!")

        path = VPS_CONFIG['project_path']

        # Pull latest changes
        print("[INFO] Pulling latest changes...")
        output, errors = execute_ssh_command(client, f"cd {path} && git pull origin main")
        print(f"[OK] {output.strip() if output.strip() else 'Already up to date'}")

        # Sync dependencies
        print("[INFO] Syncing dependencies...")
        output, errors = execute_ssh_command(client, f"cd {path} && uv sync")
        if errors and "error" in errors.lower():
            print(f"[ERROR] uv sync failed: {errors}")
            return False
        print("[OK] Dependencies synced")

        # Restart services
        print("[INFO] Restarting services...")
        execute_ssh_command(client, "systemctl restart thermobot")
        execute_ssh_command(client, "systemctl restart thermoapi")
        print("[OK] Services restarted")

        import time
        time.sleep(3)

        # Check status
        print("[INFO] Checking service status...")
        bot_status, _ = execute_ssh_command(client, "systemctl is-active thermobot")
        api_status, _ = execute_ssh_command(client, "systemctl is-active thermoapi")

        bot_ok = bot_status.strip() == "active"
        api_ok = api_status.strip() == "active"

        print(f"   thermobot: {'[OK] active' if bot_ok else '[FAIL] ' + bot_status.strip()}")
        print(f"   thermoapi: {'[OK] active' if api_ok else '[FAIL] ' + api_status.strip()}")

        # Get latest commit
        latest_commit, _ = execute_ssh_command(client, f"cd {path} && git rev-parse --short HEAD")

        if bot_ok and api_ok:
            print("[SUCCESS] Deployment completed!")
            print(f"  Server: {VPS_CONFIG['host']}")
            print(f"  Commit: {latest_commit.strip()}")
            return True
        else:
            print("[FAIL] Deployment failed")

            # Show logs for failed services
            if not bot_ok:
                bot_logs, _ = execute_ssh_command(client, "journalctl -u thermobot -n 15 --no-pager")
                print(f"\n--- thermobot logs ---\n{bot_logs}")
            if not api_ok:
                api_logs, _ = execute_ssh_command(client, "journalctl -u thermoapi -n 15 --no-pager")
                print(f"\n--- thermoapi logs ---\n{api_logs}")
            return False

    except paramiko.AuthenticationException:
        print("[ERROR] Authentication failed. Check VPS_USER and VPS_PASSWORD in .env")
        return False
    except paramiko.SSHException as e:
        print(f"[ERROR] SSH error: {e}")
        return False
    except Exception as e:
        print(f"[ERROR] Unexpected error: {e}")
        import traceback
        traceback.print_exc()
        return False
    finally:
        client.close()

if __name__ == "__main__":
    success = deploy()
    sys.exit(0 if success else 1)

Execute the script:

python deploy.py
# Or on Linux:
python3 deploy.py

Step 4: Verify Deployment

After deployment, verify services are running:

# On VPS via SSH
systemctl status thermobot --no-pager | head -5
systemctl status thermoapi --no-pager | head -5

# Health check for API
curl -s http://localhost:8000/api/v1/health | head -c 200

If services failed:

❌ Сервисы не запустились

thermobot: inactive
thermoapi: active

Проверьте логи:
journalctl -u thermobot -n 20

Возможные проблемы:
- Синтаксические ошибки в коде
- Отсутствующие зависимости
- Проблемы с конфигурацией

Step 5: Report Deployment Result

Success:

✅ Деплой завершён успешно

🖥️ Сервер: 79.174.84.103
📁 Путь: /root/apps/ThermoCalcBot
🌿 Ветка: main
📝 Коммит: {latest-commit-hash}

📊 Статус сервисов:
- thermobot: ✅ active
- thermoapi: ✅ active

🔗 API Health: http://79.174.84.103:8000/api/v1/health
🤖 Telegram: @ThermoCalcBot

Код успешно развёрнут на продакшене!

Failure:

❌ Деплой завершился с ошибками

🖥️ Сервер: 79.174.84.103

📊 Статус сервисов:
- thermobot: ❌ failed
- thermoapi: ✅ active

📋 Действия для диагностики:
1. ssh root@79.174.84.103
2. journalctl -u thermobot -n 50
3. cd /root/apps/ThermoCalcBot && uv run python telegram_bot.py

Требуется ручное вмешательство.

Deployment Checklist

Before proceeding with deployment:

  • On main branch
  • All changes committed
  • Changes pushed to origin
  • All tests pass locally
  • VPS credentials in .env
  • User confirmed deployment

Rollback Procedure

If deployment fails and rollback is needed:

# On VPS
cd /root/apps/ThermoCalcBot

# Find previous commit
git log --oneline -5

# Rollback to previous commit
git checkout {previous-commit-hash}

# Or revert to previous state
git reset --hard HEAD~1

# Restart services
systemctl restart thermobot
systemctl restart thermoapi

Platform-Specific Notes

Windows

When deploying from Windows:

  • Use pip install --user paramiko to install dependencies
  • Script includes UTF-8 encoding fix for Windows console
  • Delete temp files with rm (bash) or del (cmd)
  • Emoji not supported in output (script uses plain text markers like [INFO], [OK], [FAIL])

Linux/Mac

  • Use pip3 install paramiko or uv pip install paramiko
  • Standard UTF-8 support
  • Delete temp files with rm

Troubleshooting

paramiko not found

# Windows
pip install --user paramiko

# Linux/Mac
pip3 install paramiko

SSH banner timeout

If you get Error reading SSH protocol banner, the script includes increased timeouts:

  • timeout=60 - connection timeout
  • banner_timeout=60 - SSH banner timeout
  • auth_timeout=60 - authentication timeout

UnicodeEncodeError in Windows

The script sets UTF-8 encoding for stdout/stderr. If you still get encoding errors:

import sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')

Security Notes

  • VPS password stored in .env (gitignored)
  • SSH connection uses StrictHostKeyChecking=no for automation
  • Consider switching to SSH keys for better security in the future
  • Increased timeouts may affect security (adjust as needed for your environment)

Quick Commands Reference

ActionCommand
Check VPS statusssh root@VPS_HOST "systemctl status thermobot thermoapi"
View bot logsssh root@VPS_HOST "journalctl -u thermobot -n 50"
View API logsssh root@VPS_HOST "journalctl -u thermoapi -n 50"
Manual restartssh root@VPS_HOST "systemctl restart thermobot thermoapi"

References

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

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

平台分布

Claude Code

69.59%
按下载量换算72

trae

27.39%
按下载量换算28

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills