Repository navigation
Expand file tree
/
Copy pathinstall.ps1
More file actions
87 lines (69 loc) · 2.64 KB
/
Copy pathinstall.ps1
File metadata and controls
87 lines (69 loc) · 2.64 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<#
.SYNOPSIS
Org installer (Windows): install the OKF CLI tools and register the
knowledge-bundle skill into all AI agents (Claude Code, Cursor, Codex,
generic .agents).
.DESCRIPTION
Uses `uv` (preferred) to install the package as an isolated tool, then runs
`catalogify --install` to drop the skill into each agent's skills directory.
-Source controls where the package comes from. For org rollout, pass the Git
URL of the repo (the package lives in the `catalogify` subdirectory):
./install.ps1 -Source "catalogify"
With no -Source, it installs from this local folder (handy for testing).
NOTE: okf-inventory and okf-history are bash scripts that shell out to git.
On Windows they use the bash.exe that ships with Git for Windows, so install
Git for Windows (https://git-scm.com/download/win) first.
.PARAMETER Source
pip/uv install source. Default: this script's folder.
.PARAMETER Agents
Comma-separated agents or 'all'. Default: all.
.PARAMETER Scope
'user' (default, ~/.<agent>/skills) or 'project' (./.<agent>/skills).
.EXAMPLE
./install.ps1
.EXAMPLE
./install.ps1 -Source "catalogify"
#>
[CmdletBinding()]
param(
[string]$Source = "",
[string]$Agents = "all",
[ValidateSet("user", "project")]
[string]$Scope = "user"
)
$ErrorActionPreference = "Stop"
if (-not $Source) { $Source = $PSScriptRoot }
function Test-Command($name) {
return [bool](Get-Command $name -ErrorAction SilentlyContinue)
}
Write-Host "Installing catalogify from: $Source"
if (-not (Test-Command "git")) {
Write-Warning "git not found on PATH. okf-inventory / okf-history need git and its bash.exe (Git for Windows)."
}
if (Test-Command "uv") {
# --native-tls uses the system cert store (needed behind TLS-inspecting proxies).
uv tool install --native-tls --force "$Source"
uv tool update-shell 2>$null
}
elseif (Test-Command "pip") {
Write-Host "uv not found; falling back to pip install --user..."
pip install --user --upgrade "$Source"
}
elseif (Test-Command "python") {
python -m pip install --user --upgrade "$Source"
}
else {
throw "Neither uv, pip, nor python found on PATH. Install uv (https://astral.sh/uv) or Python first."
}
$skillArgs = @("--agents", $Agents, "--scope", $Scope)
Write-Host "Registering the skill with agents: $Agents (scope=$Scope)..."
if (Test-Command "catalogify") {
& catalogify install @skillArgs
}
else {
Write-Host "(catalogify not on PATH yet; invoking via python module)"
python -m catalogify.installer @skillArgs
}
Write-Host ""
Write-Host "Done. Open a new terminal so PATH refreshes, then ask your agent:"
Write-Host ' "generate an OKF knowledge bundle for this repo"'