netxops/scripts/link-preset.sh
oliver 5179eb74b1 Auto-install the Netx Ops agent preset on plugin activate.
Copy presets into ~/.dsh/.agent-presets (not a Windows junction — DSH discovery skips those) so dsh plugin add alone surfaces Custom → Netx Ops with skills.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 23:09:58 +08:00

19 lines
586 B
Bash

#!/usr/bin/env bash
# Install presets/netxops into $DSH_HOME/.agent-presets (copy, not symlink).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SRC="$ROOT/presets/netxops"
DSH_HOME="${DSH_HOME:-$HOME/.dsh}"
DEST_PARENT="$DSH_HOME/.agent-presets"
DEST="$DEST_PARENT/netxops"
if [[ ! -f "$SRC/agent.cordis.yml" ]]; then
echo "Missing preset dir: $SRC" >&2
exit 1
fi
mkdir -p "$DEST_PARENT"
rm -rf "$DEST"
cp -R "$SRC" "$DEST"
date -u +%Y-%m-%dT%H:%M:%SZ > "$DEST/.dsh-netxops-managed"
echo "Installed $DEST"
echo "Open Settings → Agent presets → Custom → Netx Ops"