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/export-codex-settings-sanitized.ps1
View on GitHubparam(
[string]$CodexRoot = '',
[string]$OutPath = "",
[switch]$Overwrite
)
$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 Resolve-DefaultOutPath {
param([string]$ExplicitOutPath)
$p = Get-NonEmptyOrNull -Value $ExplicitOutPath
if ($p) { return $p }
# Default: write a GitHub-safe template into the VCO repo config folder
$repoRoot = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..\\..")).Path
return (Join-Path $repoRoot "config\\settings.template.codex.json")
}
function Redact-EnvValue {
param(
[string]$Key,
[string]$Value
)
if (-not $Key) { return $Value }
$k = $Key.ToUpperInvariant()
if ($k -in @("VCO_INTENT_ADVICE_API_KEY", "VCO_VECTOR_DIFF_API_KEY")) { return "<REQUIRED>" }
# Conservative generic redaction (avoid leaking unexpected credentials)
if ($k -match "(_KEY|TOKEN|SECRET|PASSWORD|PASSWD)$") {
return "<REDACTED>"
}
return $Value
}
$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"
}
$outPath = Resolve-DefaultOutPath -ExplicitOutPath $OutPath
if ((Test-Path -LiteralPath $outPath) -and (-not $Overwrite)) {
throw "OutPath already exists: $outPath (pass -Overwrite to replace)"
}
# Build a sanitized copy (preserve structure, redact env values)
$sanitized = [ordered]@{}
foreach ($prop in @($settings.PSObject.Properties.Name)) {
if ($prop -ne "env") {
$sanitized[$prop] = $settings.$prop
}
}
$sanitizedEnv = [ordered]@{}
foreach ($p in @($settings.env.PSObject.Properties)) {
$name = [string]$p.Name
$value = [string]$p.Value
$sanitizedEnv[$name] = Redact-EnvValue -Key $name -Value $value
}
$sanitized["env"] = $sanitizedEnv
$json = ($sanitized | ConvertTo-Json -Depth 50)
New-Item -ItemType Directory -Path (Split-Path -Parent $outPath) -Force | Out-Null
$json | Set-Content -LiteralPath $outPath -Encoding UTF8
Write-Host "Wrote sanitized settings template:" -ForegroundColor Green
Write-Host ("- {0}" -f $outPath)
Write-Host "Note: secrets were redacted; safe to commit/push." -ForegroundColor Green
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 |