foryourhealth111-pixel/Vibe-Skills
vibe
VerifiedVibe Code Orchestrator (VCO) is a governed runtime entry that freezes requirements, bounds execution, and enforces verification and phase cleanup.
scripts/setup/sync-codex-settings-to-user-env.ps1
View on GitHubparam(
[string]$CodexRoot = '',
[ValidateSet("IntentAdvice", "VectorDiff", "All")]
[string]$Target = "All",
[ValidateSet("User", "Process")]
[string]$Scope = "User",
[switch]$DryRun
)
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot '..\common\vibe-governance-helpers.ps1')
$CodexRoot = Resolve-VgoTargetRoot -TargetRoot $CodexRoot
function Get-NonEmptyOrNull {
param([string]$Value)
if ([string]::IsNullOrWhiteSpace($Value)) { return $null }
return [string]$Value
}
function Set-EnvSafe {
param(
[Parameter(Mandatory = $true)][string]$Name,
[Parameter(Mandatory = $true)][string]$Value,
[Parameter(Mandatory = $true)][string]$Scope,
[switch]$DryRun
)
if ($DryRun) {
Write-Host ("- would set {0} ({1})" -f $Name, $Scope) -ForegroundColor DarkGray
return
}
if ($Scope -eq "Process") {
Set-Item -Path ("env:{0}" -f $Name) -Value $Value
return
}
# Persist to Windows user environment (registry) without printing the secret value.
[Environment]::SetEnvironmentVariable($Name, $Value, "User")
}
$settingsPath = Join-Path $CodexRoot "settings.json"
if (-not (Test-Path -LiteralPath $settingsPath)) {
throw "Codex settings.json not found: $settingsPath"
}
try {
$settings = Get-Content -LiteralPath $settingsPath -Raw -Encoding UTF8 | ConvertFrom-Json
} catch {
throw "Failed to parse settings.json as JSON: $settingsPath"
}
if (-not $settings.env) {
throw "settings.json missing .env object: $settingsPath"
}
Write-Host "Sync Codex settings.json -> Windows env" -ForegroundColor Cyan
Write-Host ("- target: {0}" -f $Target)
Write-Host ("- scope: {0}" -f $Scope)
if ($DryRun) { Write-Host "- dry_run: true" -ForegroundColor Yellow }
function Sync-One {
param([string]$Name)
$value = $null
try { $value = $settings.env.$Name } catch { $value = $null }
$resolved = Get-NonEmptyOrNull -Value ([string]$value)
if (-not $resolved) {
Write-Host ("- {0}: missing in settings.json (skip)" -f $Name) -ForegroundColor DarkGray
return
}
Set-EnvSafe -Name $Name -Value $resolved -Scope $Scope -DryRun:$DryRun
Write-Host ("- {0}: synced" -f $Name) -ForegroundColor Green
}
if ($Target -eq "IntentAdvice" -or $Target -eq "All") {
Sync-One -Name "VCO_INTENT_ADVICE_BASE_URL"
Sync-One -Name "VCO_INTENT_ADVICE_API_KEY"
Sync-One -Name "VCO_INTENT_ADVICE_MODEL"
}
if ($Target -eq "VectorDiff" -or $Target -eq "All") {
Sync-One -Name "VCO_VECTOR_DIFF_BASE_URL"
Sync-One -Name "VCO_VECTOR_DIFF_API_KEY"
Sync-One -Name "VCO_VECTOR_DIFF_MODEL"
}
Write-Host "Done. Note: a new shell may be required to pick up User-scope variables." -ForegroundColor Cyan
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |