Skip to content

Commit 051dc52

Browse files
committed
ux: make private key output clearer with arrow indicator
1 parent afebb2b commit 051dc52

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

claude-code-sync

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,18 @@ cmd_init() {
164164
echo -e "${RED} IMPORTANT: SAVE YOUR PRIVATE KEY! ${NC}"
165165
echo -e "${RED}========================================${NC}"
166166
echo ""
167-
echo "Your private key (save this securely, you'll need it on other machines):"
167+
echo -e "Your PRIVATE KEY is the line starting with ${BLUE}AGE-SECRET-KEY-${NC}:"
168168
echo ""
169-
cat "$KEY_FILE"
169+
while IFS= read -r line; do
170+
if [[ "$line" == AGE-SECRET-KEY-* ]]; then
171+
echo -e "${GREEN}${line}${NC} ${YELLOW}<-- COPY THIS!${NC}"
172+
else
173+
echo "$line"
174+
fi
175+
done < "$KEY_FILE"
170176
echo ""
177+
echo -e "${BLUE}Copy the ENTIRE block above (including comments) to import on other machines.${NC}"
171178
echo -e "${YELLOW}This key will NOT be shown again!${NC}"
172-
echo -e "${YELLOW}Store it in a password manager or secure location.${NC}"
173179
echo ""
174180
fi
175181

claude-code-sync.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,21 @@ function Invoke-Init {
165165
Write-Host " IMPORTANT: SAVE YOUR PRIVATE KEY! " -ForegroundColor Red
166166
Write-Host "========================================" -ForegroundColor Red
167167
Write-Host ""
168-
Write-Host "Your private key (save this securely, you'll need it on other machines):"
168+
Write-Host "Your PRIVATE KEY is the line starting with " -NoNewline
169+
Write-Host "AGE-SECRET-KEY-" -ForegroundColor Cyan -NoNewline
170+
Write-Host ":"
169171
Write-Host ""
170-
Get-Content $KEY_FILE | Write-Host
172+
Get-Content $KEY_FILE | ForEach-Object {
173+
if ($_ -match "^AGE-SECRET-KEY-") {
174+
Write-Host $_ -ForegroundColor Green -NoNewline
175+
Write-Host " <-- COPY THIS!" -ForegroundColor Yellow
176+
} else {
177+
Write-Host $_
178+
}
179+
}
171180
Write-Host ""
181+
Write-Host "Copy the ENTIRE block above (including comments) to import on other machines." -ForegroundColor Cyan
172182
Write-Host "This key will NOT be shown again!" -ForegroundColor Yellow
173-
Write-Host "Store it in a password manager or secure location." -ForegroundColor Yellow
174183
Write-Host ""
175184
}
176185

0 commit comments

Comments
 (0)