Agent Skillslencx/opsail › bootstrap-opsail

bootstrap-opsail

GitHub

用于检测当前Agent环境并自动安装或更新Opsail CLI及运行时Skill,支持OpenClaw、Hermes等主流平台,确保版本一致性与正确注册。

skills/bootstrap-opsail/SKILL.md lencx/opsail

Trigger Scenarios

Opsail缺失或版本不匹配 需要初始化Opsail运行环境

Install

npx skills add lencx/opsail --skill bootstrap-opsail -g -y
More Options

Use without installing

npx skills use lencx/opsail@bootstrap-opsail

指定 Agent (Claude Code)

npx skills add lencx/opsail --skill bootstrap-opsail -a claude-code -g -y

安装 repo 全部 skill

npx skills add lencx/opsail --all -g -y

预览 repo 内 skill

npx skills add lencx/opsail --list

SKILL.md

Frontmatter
{
    "name": "bootstrap-opsail",
    "license": "Apache-2.0",
    "metadata": {
        "author": "Opsail contributors",
        "version": "0.2.0",
        "homepage": "https:\/\/github.com\/lencx\/opsail",
        "opsail-role": "transient-bootstrap"
    },
    "description": "Install or update the Opsail CLI and runtime Skill for the current AgentSkills-compatible host, including OpenClaw, Hermes Agent, Claude Code, and Codex. Use when Opsail is missing, mismatched, or not registered.",
    "compatibility": "Requires HTTPS, terminal access, and permission to modify the CLI installation and the current host's global skill directory. Node.js is optional."
}

Bootstrap Opsail

This is a transient install/update procedure. Do not register it as a global Skill; persist only the opsail runtime Skill.

Plan

Before making persistent changes:

  1. Detect the current host. OpenClaw, Hermes Agent, Claude Code, and Codex have dedicated commands below; any other AgentSkills-compatible host follows the generic path. For Hermes, also identify the active profile. Ask only if detection is inconclusive.
  2. Resolve https://api.github.com/repos/lencx/opsail/releases/latest. If the API fails or is rate limited, resolve the tag from the redirect target of https://github.com/lencx/opsail/releases/latest. Require a stable vMAJOR.MINOR.PATCH tag and record it without v as OPSAIL_VERSION.
  3. Inspect opsail --version, all matching executables (type -a opsail or Get-Command opsail -All), and the installed runtime Skill. Compare that Skill with https://raw.githubusercontent.com/lencx/opsail/refs/heads/main/skills/opsail/SKILL.md.
  4. Select adapters:
    • CLI: prefer npm only on Node.js 20+ when npm view opsail@latest version equals OPSAIL_VERSION. Derive PLATFORM_PACKAGE as @opsail/<process.platform>-<process.arch>; require npm view "opsail@${OPSAIL_VERSION}" optionalDependencies --json to list it at the exact version and npm view "${PLATFORM_PACKAGE}@${OPSAIL_VERSION}" version to resolve. Otherwise use the platform installer: https://raw.githubusercontent.com/lencx/opsail/refs/heads/main/skills/bootstrap-opsail/scripts/install.sh on macOS and Linux, or https://raw.githubusercontent.com/lencx/opsail/refs/heads/main/skills/bootstrap-opsail/scripts/install.ps1 on Windows.
    • Runtime Skill: use npx --yes skills@latest only with Node.js 18+ and when it names the current host as a supported agent whose global destination matches the host's documented Skill directory. For Hermes, require HERMES_HOME to resolve to the intended profile. Install Codex directly into $HOME/.agents/skills. Otherwise use the host's native skill-install command. Without one, stage the Skill directory for a copy into the host's documented global skill directory.
  5. Plan the CLI and runtime Skill independently. Show all network sources, destinations, the executable that will win on PATH, and every install, update, downgrade, replacement, or PATH change. Ask for approval only for mismatched components; matching components are verify-only.

Stage temporary preflight downloads only for inspection. After approval, execute the same inspected installer, then clean up.

Apply

If the CLI mismatches, use the selected adapter.

With npm:

npm install --global "opsail@${OPSAIL_VERSION}"

On macOS or Linux, run the inspected installer:

OPSAIL_VERSION="$OPSAIL_VERSION" sh "$OPSAIL_INSTALLER"

Set OPSAIL_INSTALLER to the inspected temporary file. Pass OPSAIL_INSTALL_DIR only for an approved absolute path.

On Windows, run:

& $OpsailInstaller -Version $OpsailVersion

Set $OpsailInstaller to the inspected temporary file. Use -InstallDir only for an approved path and -UpdatePath only for an approved persistent PATH change.

If the runtime Skill mismatches, run only the command for the current host. With Node.js 18+, set OPSAIL_HOST_AGENT to openclaw, hermes-agent, claude-code, or to another agent name whose skills@latest global destination matches the intended host or profile Skill directory:

npx --yes skills@latest add https://github.com/lencx/opsail/tree/main/skills/opsail --global --agent "$OPSAIL_HOST_AGENT" --copy --yes

If the intended Hermes profile destination cannot be verified for skills@latest, or without Node.js 18+, use the native command (prefix it with hermes -p NAME when targeting a named profile):

hermes skills install https://raw.githubusercontent.com/lencx/opsail/refs/heads/main/skills/opsail/SKILL.md

Without Node.js 18+, OpenClaw requires a local directory. After the planned replacement is approved, download and inspect the same runtime Skill into a temporary directory as SKILL.md, then run:

openclaw skills install "$TEMPORARY_OPSAIL_SKILL_DIRECTORY" --as opsail --global --force

Codex uses $HOME/.agents/skills regardless of Node.js availability. Without Node.js 18+, Claude Code uses ${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills. Stage and inspect the same SKILL.md in a temporary directory, set OPSAIL_HOST_SKILLS_DIR to the applicable directory, then run:

mkdir -p "$OPSAIL_HOST_SKILLS_DIR/opsail"
cp "$TEMPORARY_OPSAIL_SKILL_DIRECTORY/SKILL.md" "$OPSAIL_HOST_SKILLS_DIR/opsail/SKILL.md"

On Windows, use $HOME\.agents\skills for Codex. For Claude Code, append skills to a non-empty $env:CLAUDE_CONFIG_DIR; otherwise use $HOME\.claude\skills. Assign the result to $OpsailHostSkillsDir, then run:

New-Item -ItemType Directory -Force (Join-Path $OpsailHostSkillsDir "opsail") | Out-Null
Copy-Item (Join-Path $TemporaryOpsailSkillDirectory "SKILL.md") -Destination (Join-Path $OpsailHostSkillsDir "opsail") -Force

For any other host, prefer its native skill-install command with the same source. Without one, run the same copy with OPSAIL_HOST_SKILLS_DIR set to the host's documented global skill directory.

Verify

  • opsail --version reports exactly opsail ${OPSAIL_VERSION}.
  • opsail read --help succeeds.
  • The current host discovers the opsail Skill and its content matches main.

Constraints

  • Configure only the current host unless the user names additional hosts.
  • Do not use sudo, change npm configuration, or edit shell profiles.
  • Stop on failed resolution, download, checksum, installation, or verification. Do not bypass a host security decision or silently switch sources.
  • A host-global CLI is not visible inside a sandboxed host, such as an OpenClaw sandbox. Configure the same Opsail version inside the sandbox only with separate approval.

Version History

  • 4580d27 Current 2026-07-30 20:47

Same Skill Collection

skills/opsail/SKILL.md

Metadata

Files
0
Version
4580d27
Hash
aacd1656
Indexed
2026-07-30 20:47

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 02:38
浙ICP备14020137号-1 $Гость$