@darkrei08/setup-ai 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,25 +10,24 @@ skill — each via its **official, current** method for your OS.
10
10
 
11
11
  ## Quick start
12
12
 
13
+ One command. No install, no clone. It opens a menu to choose what to set up:
14
+
13
15
  ```bash
14
- # no install needed — runs the launcher once, then discards it
15
16
  npx github:darkrei08/setup-ai
16
17
  ```
17
18
 
18
- or, once published to npm:
19
+ Prefer non-interactive? Same command, add a flag:
19
20
 
20
21
  ```bash
21
- npx @darkrei08/setup-ai # interactive module menu
22
- npx @darkrei08/setup-ai --only pi,codex,opencode
23
- npx @darkrei08/setup-ai --all # everything incl. optional GUI apps
24
- npm i -g @darkrei08/setup-ai && setup-ai # global command
22
+ npx github:darkrei08/setup-ai --only pi,codex,opencode # just these
23
+ npx github:darkrei08/setup-ai --all # everything
25
24
  ```
26
25
 
27
- The launcher (`bin/setup-ai.mjs`, zero dependencies) detects your OS and runs
28
- the right script: `setup-ai.ps1` on Windows (via `pwsh`), `setup-ai.sh` on
29
- macOS/Linux (via `bash`). With no selection flag on an interactive terminal it
30
- opens an arrow-key **multi-select menu** (↑/↓ move · Space toggle · `a` all ·
31
- Enter confirm); on a non-interactive shell it installs the core set.
26
+ That's the whole thing. Three details worth knowing:
27
+
28
+ - **Windows PowerShell**: one command per line (no bash `\`). If node or git was just installed, open a **new terminal** so PATH refreshes.
29
+ - **What it does**: detects your OS and runs `setup-ai.sh` (macOS/Linux) or `setup-ai.ps1` (Windows). Menu keys: ↑/↓ move · Space toggle · `a` all · Enter.
30
+ - **Shorter name**: once it's on npm, drop `github:` → `npx @darkrei08/setup-ai` (run it from any folder except the repo's own source dir).
32
31
 
33
32
  ### npm vs npx
34
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkrei08/setup-ai",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Cross-OS installer for an AI coding toolchain (pi, codex, antigravity, opencode, herdr, gentle-ai, engram, Engineering Excellence) with an interactive module menu.",
5
5
  "type": "module",
6
6
  "bin": {
package/setup-ai.ps1 CHANGED
@@ -33,7 +33,7 @@ param(
33
33
  $ErrorActionPreference = 'Stop'
34
34
  Set-StrictMode -Version Latest
35
35
 
36
- $ScriptVersion = "3.0.0"
36
+ $ScriptVersion = "3.0.2"
37
37
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
38
38
  $LogDir = Join-Path $ScriptDir "logs"
39
39
  New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
@@ -78,6 +78,14 @@ function Write-Log {
78
78
 
79
79
  function Test-Cmd { param([string]$Name) [bool](Get-Command $Name -ErrorAction SilentlyContinue) }
80
80
 
81
+ # winget updates the registry PATH, not the live process. Re-read it so tools
82
+ # installed this run (node, git, ...) resolve without opening a new terminal.
83
+ function Update-SessionPath {
84
+ $machine = [Environment]::GetEnvironmentVariable('Path','Machine')
85
+ $user = [Environment]::GetEnvironmentVariable('Path','User')
86
+ $env:Path = (@($machine, $user) | Where-Object { $_ }) -join ';'
87
+ }
88
+
81
89
  # Run a step; $Optional means failures are logged as WARN and swallowed.
82
90
  function Invoke-Step {
83
91
  param([string]$Phase, [scriptblock]$Action, [switch]$Optional)
@@ -156,12 +164,25 @@ function Mod-Base {
156
164
  Install-Winget -Id "GitHub.cli" -Phase "base"
157
165
  Install-Winget -Id "Python.Python.3.12" -Phase "base"
158
166
  Install-Winget -Id "Neovim.Neovim" -Phase "base"
167
+ Update-SessionPath
159
168
  }
160
169
 
161
170
  function Mod-Node {
162
171
  Write-Log INFO "node" "start" "Node.js"
163
- if (-not (Test-Cmd node)) { Install-Winget -Id "OpenJS.NodeJS.LTS" -Phase "node" }
164
- if (Test-Cmd npm) { Invoke-Step -Phase "node" -Optional -Action { npm install -g npm@latest } }
172
+ if (-not (Test-Cmd node)) {
173
+ Install-Winget -Id "OpenJS.NodeJS.LTS" -Phase "node"
174
+ Update-SessionPath
175
+ # winget's PATH refresh can still lag; add the default install dir directly.
176
+ $nodeDir = Join-Path $env:ProgramFiles "nodejs"
177
+ if ((-not (Test-Cmd node)) -and (Test-Path (Join-Path $nodeDir "node.exe"))) {
178
+ $env:Path = "$nodeDir;$env:Path"
179
+ }
180
+ }
181
+ if (Test-Cmd npm) {
182
+ Invoke-Step -Phase "node" -Optional -Action { npm install -g npm@latest }
183
+ } else {
184
+ Write-Log WARN "node" "unresolved" "node/npm not on PATH after install — open a NEW terminal and re-run (node-dependent modules will be skipped)"
185
+ }
165
186
  }
166
187
 
167
188
  function Mod-Bun {
@@ -187,9 +208,10 @@ function Mod-Go {
187
208
  function Mod-Ee {
188
209
  Write-Log INFO "ee" "start" "Engineering Excellence"
189
210
  if (-not (Test-Cmd npx)) { Write-Log WARN "ee" "npx_missing" "npx not found; install node first"; return }
190
- $agents = @{ pi = ".pi"; claude = ".claude"; gemini = ".gemini"; cursor = ".cursor"; antigravity = ".antigravity" }
211
+ # Keys are `skills` CLI agent names (claude-code, gemini-cli), not dir names.
212
+ $agents = @{ pi = ".pi"; 'claude-code' = ".claude"; 'gemini-cli' = ".gemini"; cursor = ".cursor"; antigravity = ".antigravity"; codex = ".codex"; opencode = ".config\opencode" }
191
213
  $any = $false
192
- foreach ($a in @('pi','claude','gemini','cursor','antigravity')) {
214
+ foreach ($a in @('pi','claude-code','gemini-cli','cursor','antigravity','codex','opencode')) {
193
215
  if (Test-Path (Join-Path $HOME $agents[$a])) {
194
216
  Invoke-Step -Phase "ee" -Optional -Action {
195
217
  npx --yes skills@latest add $EE_Slug --skill $EE_Skill --global --agent $a --copy --yes
package/setup-ai.sh CHANGED
@@ -26,7 +26,7 @@
26
26
  set -Eeuo pipefail
27
27
  IFS=$'\n\t'
28
28
 
29
- SCRIPT_VERSION="3.0.0"
29
+ SCRIPT_VERSION="3.0.2"
30
30
 
31
31
  SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
32
32
  LOG_DIR="${SCRIPT_DIR}/logs"
@@ -441,6 +441,11 @@ mod_node() {
441
441
  run_cmd "node" bash "${installer}"
442
442
  fi
443
443
 
444
+ # nvm refuses to operate when npm_config_prefix is set (e.g. to /usr/local),
445
+ # aborting with "nvm is not compatible with the npm_config_prefix ...".
446
+ # It is only needed by nvm's own shims, so drop it for this process.
447
+ unset npm_config_prefix NPM_CONFIG_PREFIX 2>/dev/null || true
448
+
444
449
  # shellcheck disable=SC1090
445
450
  source "${NVM_DIR}/nvm.sh"
446
451
 
@@ -597,16 +602,20 @@ mod_ee() {
597
602
 
598
603
  # Install the skill for every detected agent using the modern skills CLI
599
604
  # (replaces the old git-clone-and-move). Agents are detected by their config dir.
605
+ # Keys are the `skills` CLI agent names (claude-code, gemini-cli, ...), which
606
+ # differ from the config-dir basename; values are the dir we detect them by.
600
607
  local agent dir
601
608
  local -A agent_dir=(
602
609
  [pi]="${HOME}/.pi"
603
- [claude]="${HOME}/.claude"
604
- [gemini]="${HOME}/.gemini"
610
+ [claude-code]="${HOME}/.claude"
611
+ [gemini-cli]="${HOME}/.gemini"
605
612
  [cursor]="${HOME}/.cursor"
606
613
  [antigravity]="${HOME}/.antigravity"
614
+ [codex]="${HOME}/.codex"
615
+ [opencode]="${HOME}/.config/opencode"
607
616
  )
608
617
  local installed_any=0
609
- for agent in pi claude gemini cursor antigravity; do
618
+ for agent in pi claude-code gemini-cli cursor antigravity codex opencode; do
610
619
  dir="${agent_dir[$agent]}"
611
620
  [[ -d "${dir}" ]] || continue
612
621
  run_optional "engineering-excellence" \