forked from agent0ai/dox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-cline.ps1
More file actions
54 lines (46 loc) · 1.92 KB
/
Copy pathinstall-cline.ps1
File metadata and controls
54 lines (46 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# DOX — installer/updater for the Cline skills and rule.
#
# Workspace install (run from your project root):
# irm https://raw.githubusercontent.com/jpbaking/dox/main/install-cline.ps1 | iex
# Global install (all projects):
# $env:DOX_GLOBAL = "1"; irm https://raw.githubusercontent.com/jpbaking/dox/main/install-cline.ps1 | iex
#
# Existing DOX skill/rule files are overwritten, so re-running updates them.
# Override the source with $env:DOX_REPO (owner/repo) and $env:DOX_REF (branch or tag).
$ErrorActionPreference = "Stop"
$Repo = if ($env:DOX_REPO) { $env:DOX_REPO } else { "jpbaking/dox" }
$Ref = if ($env:DOX_REF) { $env:DOX_REF } else { "main" }
$Base = "https://raw.githubusercontent.com/$Repo/$Ref"
$Skills = @("dox-init", "dox-child", "dox-audit", "dox-fix", "dox-upgrade")
$Mode = if ($env:DOX_GLOBAL) { "global" } else { "workspace" }
if ($Mode -eq "global") {
$SkillsDir = Join-Path $HOME ".cline\skills"
$RulesDir = Join-Path $HOME "Documents\Cline\Rules"
} else {
$SkillsDir = ".cline\skills"
$RulesDir = ".clinerules"
}
function Fetch {
param(
[string]$Src,
[string]$Dest
)
$srcUrl = "$Base/$Src"
$destDir = Split-Path -Parent $Dest
if ($destDir -and -not (Test-Path $destDir)) {
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
}
Invoke-WebRequest -Uri $srcUrl -OutFile $Dest -UseBasicParsing
Write-Host " + $Dest"
}
Write-Host "DOX Cline install ($Mode) from $Repo@$Ref"
if ($Mode -eq "workspace") {
Write-Host " into $(Get-Location)"
}
foreach ($s in $Skills) {
Fetch "skills/cline/$s/SKILL.md" (Join-Path $SkillsDir "$s\SKILL.md")
}
Fetch "rules/cline/dox.md" (Join-Path $RulesDir "dox.md")
Write-Host "Done. Skills: /dox-init /dox-child /dox-audit /dox-fix /dox-upgrade"
Write-Host "Note: this does not add the framework itself - run /dox-init in Cline"
Write-Host "(or copy AGENTS.md from https://github.com/$Repo) to set up a project."