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/persist-codex-openai-env.ps1
View on GitHubparam(
[string]$CodexRoot = '',
[string]$BaseUrl = "",
[string]$ApiKey = "",
[switch]$AllowEmptyApiKey
)
$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
}
$settingsPath = Join-Path $CodexRoot "settings.json"
if (-not (Test-Path -LiteralPath $settingsPath)) {
throw "Codex settings.json not found: $settingsPath (run the installer first or create it from config/settings.template.codex.json)"
}
$resolvedBaseUrl = Get-NonEmptyOrNull -Value $BaseUrl
if (-not $resolvedBaseUrl) {
$resolvedBaseUrl = Get-NonEmptyOrNull -Value $env:VCO_INTENT_ADVICE_BASE_URL
}
$resolvedApiKey = Get-NonEmptyOrNull -Value $ApiKey
if (-not $resolvedApiKey) {
$resolvedApiKey = Get-NonEmptyOrNull -Value $env:VCO_INTENT_ADVICE_API_KEY
}
if (-not $resolvedApiKey -and (-not $AllowEmptyApiKey)) {
throw "VCO_INTENT_ADVICE_API_KEY is missing. Provide -ApiKey or set env:VCO_INTENT_ADVICE_API_KEY. (We refuse to write an empty/placeholder key by default.)"
}
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) {
$settings | Add-Member -NotePropertyName env -NotePropertyValue ([pscustomobject]@{})
}
if ($resolvedBaseUrl) {
$settings.env | Add-Member -NotePropertyName VCO_INTENT_ADVICE_BASE_URL -NotePropertyValue $resolvedBaseUrl -Force
}
if ($resolvedApiKey) {
$settings.env | Add-Member -NotePropertyName VCO_INTENT_ADVICE_API_KEY -NotePropertyValue $resolvedApiKey -Force
}
# Keep these consistent with the shipped template unless user already overrides them.
if (-not ($settings.env.PSObject.Properties.Name -contains "VCO_PROFILE")) {
$settings.env | Add-Member -NotePropertyName VCO_PROFILE -NotePropertyValue "full" -Force
}
if (-not ($settings.env.PSObject.Properties.Name -contains "VCO_CODEX_MODE")) {
$settings.env | Add-Member -NotePropertyName VCO_CODEX_MODE -NotePropertyValue "true" -Force
}
$settings | ConvertTo-Json -Depth 50 | Set-Content -LiteralPath $settingsPath -Encoding UTF8
Write-Host "Updated Codex settings.json env:" -ForegroundColor Green
if ($resolvedBaseUrl) { Write-Host "- VCO_INTENT_ADVICE_BASE_URL set" }
Write-Host "- VCO_INTENT_ADVICE_API_KEY set"
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 |