feat: launch official product site and one-click installers

This commit is contained in:
2026-03-06 22:28:20 +08:00
parent ceb3557dde
commit b6f46a07a0
4 changed files with 472 additions and 182 deletions

38
install/install.ps1 Normal file
View File

@@ -0,0 +1,38 @@
param(
[string]$RepoUrl = "https://fun-md.com/Fun_MD/devops-skills.git",
[string]$CodexHome = "$HOME\.codex"
)
$ErrorActionPreference = "Stop"
$skillName = "gitea-issue-devops-agent"
$targetDir = Join-Path $CodexHome "skills\$skillName"
$tmpRoot = Join-Path $env:TEMP ("devops-skills-" + [Guid]::NewGuid().ToString("N"))
try {
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
throw "[install] git is required but not found."
}
Write-Host "[install] downloading $skillName from $RepoUrl"
git clone --depth 1 $RepoUrl $tmpRoot | Out-Null
$sourceDir = Join-Path $tmpRoot "skills\$skillName"
if (-not (Test-Path $sourceDir)) {
throw "[install] skill directory not found in repository."
}
New-Item -ItemType Directory -Force (Join-Path $CodexHome "skills") | Out-Null
if (Test-Path $targetDir) {
Remove-Item -Recurse -Force $targetDir
}
Copy-Item -Path $sourceDir -Destination $targetDir -Recurse -Force
Write-Host "[install] done"
Write-Host "[install] installed path: $targetDir"
}
finally {
if (Test-Path $tmpRoot) {
Remove-Item -Recurse -Force $tmpRoot
}
}

33
install/install.sh Normal file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail
REPO_URL="${REPO_URL:-https://fun-md.com/Fun_MD/devops-skills.git}"
SKILL_NAME="gitea-issue-devops-agent"
CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
TARGET_DIR="${CODEX_HOME}/skills/${SKILL_NAME}"
TMP_DIR="$(mktemp -d)"
cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT
if ! command -v git >/dev/null 2>&1; then
echo "[install] git is required but not found."
exit 1
fi
echo "[install] downloading ${SKILL_NAME} from ${REPO_URL}"
git clone --depth 1 "$REPO_URL" "$TMP_DIR/repo" >/dev/null 2>&1
if [ ! -d "$TMP_DIR/repo/skills/${SKILL_NAME}" ]; then
echo "[install] skill directory not found in repository."
exit 1
fi
mkdir -p "${CODEX_HOME}/skills"
rm -rf "$TARGET_DIR"
cp -R "$TMP_DIR/repo/skills/${SKILL_NAME}" "$TARGET_DIR"
echo "[install] done"
echo "[install] installed path: ${TARGET_DIR}"