Output the same output structure as in npx

This commit is contained in:
Eyal Sharon
2025-05-29 17:26:02 +03:00
parent 5dfd696c2b
commit 72ad76692b

View File

@ -1,4 +1,4 @@
curl -s --no-buffer "https://api.cli.qodo.ai/v1/auth/cli-auth" | while read line; do
[[ $line == data:*auth_url* ]] && open "$(echo "$line" | sed 's/.*"auth_url":"\([^"]*\)".*/\1/' | sed 's/\\//g')"
[[ $line == data:*api_key* ]] && echo "$line" && break
[[ $line == data:*api_key* ]] && echo "✅ Authentication successful! API key saved.\n📋 Your API key: $(echo "$line" | sed 's/.*"api_key":"\([^"]*\)".*/\1/')" && break
done