Skip to content

Commit 3cd7b66

Browse files
committed
✨ Add zero-config Vercel deployment monitor: implement auto-detection of auth token and project ID, providing real-time deployment status and build state icons.
1 parent f1f900b commit 3cd7b66

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"description": "Auto-detecting Vercel deployment monitor with zero configuration required. Automatically discovers your Vercel auth token from CLI config (macOS: ~/Library/Application Support/com.vercel.cli/auth.json, Linux: ~/.config/vercel/auth.json, Windows: %APPDATA%/vercel/auth.json) and project ID from .vercel/project.json. Shows real-time deployment status, build state icons, deployment URL preview, and time elapsed since last deployment. Falls back gracefully to environment variables VERCEL_TOKEN and VERCEL_PROJECT_ID if auto-detection fails. Works across all platforms without any manual setup.",
3+
"statusLine": {
4+
"type": "command",
5+
"command": "bash -c 'input=$(cat); DIR=$(echo \"$input\" | jq -r \".workspace.current_dir\"); if [[ \"$OSTYPE\" == \"darwin\"* ]]; then AUTH_FILE=\"$HOME/Library/Application Support/com.vercel.cli/auth.json\"; elif [[ \"$OSTYPE\" == \"linux-gnu\"* ]]; then AUTH_FILE=\"$HOME/.config/vercel/auth.json\"; elif [[ \"$OSTYPE\" == \"msys\" || \"$OSTYPE\" == \"cygwin\" ]]; then AUTH_FILE=\"$APPDATA/vercel/auth.json\"; else AUTH_FILE=\"$HOME/.config/vercel/auth.json\"; fi; PROJECT_FILE=\".vercel/project.json\"; if [ -f \"$AUTH_FILE\" ]; then TOKEN=$(jq -r \".token // empty\" \"$AUTH_FILE\" 2>/dev/null); else TOKEN=\"$VERCEL_TOKEN\"; fi; if [ -f \"$PROJECT_FILE\" ]; then PROJECT=$(jq -r \".projectId // empty\" \"$PROJECT_FILE\" 2>/dev/null); else PROJECT=\"$VERCEL_PROJECT_ID\"; fi; if [ -n \"$TOKEN\" ] && [ -n \"$PROJECT\" ] && [ \"$TOKEN\" != \"null\" ] && [ \"$PROJECT\" != \"null\" ]; then DEPLOY_DATA=$(curl -s -H \"Authorization: Bearer $TOKEN\" \"https://api.vercel.com/v6/deployments?projectId=$PROJECT&limit=1\" 2>/dev/null); if [ -n \"$DEPLOY_DATA\" ] && [ \"$DEPLOY_DATA\" != \"null\" ]; then STATE=$(echo \"$DEPLOY_DATA\" | jq -r \".deployments[0].state // empty\"); URL=$(echo \"$DEPLOY_DATA\" | jq -r \".deployments[0].url // empty\" | cut -c1-20); CREATED=$(echo \"$DEPLOY_DATA\" | jq -r \".deployments[0].created // empty\"); if [ -n \"$CREATED\" ] && [ \"$CREATED\" != \"null\" ]; then AGO=$(( ($(date +%s) - $CREATED/1000) / 60 )); TIME_AGO=\"${AGO}m ago\"; else TIME_AGO=\"unknown\"; fi; case \"$STATE\" in READY) STATUS_ICON=\"✅\";; BUILDING) STATUS_ICON=\"🔄\";; QUEUED) STATUS_ICON=\"⏳\";; ERROR) STATUS_ICON=\"❌\";; *) STATUS_ICON=\"❓\";; esac; else STATE=\"API error\"; URL=\"\"; TIME_AGO=\"\"; STATUS_ICON=\"❌\"; fi; else STATE=\"config missing\"; URL=\"\"; TIME_AGO=\"\"; STATUS_ICON=\"⚠️\"; fi; echo \"▲ Vercel 🚀 $STATUS_ICON $STATE | 🌐 $URL | ⏰ $TIME_AGO | 📁 ${DIR##*/}\"'"
6+
}
7+
}

docs/components.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,6 +2670,14 @@
26702670
"content": "{\n \"description\": \"Watch your code garden grow with each session. Plants evolve from seeds to trees based on your activity, with dynamic weather effects. Displays: Plant stages (🌱 seed 0-9, 🌿 sprout 10-19, 🍃 sapling 20-29, 🌳 tree 30-39, 🌺 flower 40+), Weather (🌧️ rainy every 7 growth points, ☀️ sunny every 5 points, ⛅ cloudy default), Garden Level (stage number), Growth counter (total session interactions).\",\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"bash -c 'input=$(cat); MODEL=$(echo \\\"$input\\\" | jq -r \\\".model.display_name\\\"); DIR=$(echo \\\"$input\\\" | jq -r \\\".workspace.current_dir\\\"); SESSION=$(echo \\\"$input\\\" | jq -r \\\".session_id\\\" | cut -c1-8); CACHE=\\\"/tmp/garden_$SESSION\\\"; if [ ! -f \\\"$CACHE\\\" ]; then echo \\\"0\\\" > \\\"$CACHE\\\"; fi; GROWTH=$(cat \\\"$CACHE\\\"); GROWTH=$((GROWTH + 1)); echo \\\"$GROWTH\\\" > \\\"$CACHE\\\"; STAGE=$((GROWTH / 10)); case $STAGE in 0) PLANT=\\\"🌱\\\";; 1) PLANT=\\\"🌿\\\";; 2) PLANT=\\\"🍃\\\";; 3) PLANT=\\\"🌳\\\";; *) PLANT=\\\"🌺\\\";; esac; WEATHER=$([ $((GROWTH % 7)) -eq 0 ] && echo \\\"🌧️\\\" || [ $((GROWTH % 5)) -eq 0 ] && echo \\\"☀️\\\" || echo \\\"⛅\\\"); echo \\\"[$MODEL] $PLANT $WEATHER Garden Lv.$STAGE | 📁 ${DIR##*/} | Growth: $GROWTH\\\"'\"\n }\n}",
26712671
"description": "Watch your code garden grow with each session. Plants evolve from seeds to trees based on your activity, with dynamic weather effects. Displays: Plant stages (🌱 seed 0-9, 🌿 sprout 10-19, 🍃 sapling 20-29, 🌳 tree 30-39, 🌺 flower 40+), Weather (🌧️ rainy every 7 growth points, ☀️ sunny every 5 points, ⛅ cloudy default), Garden Level (stage number), Growth counter (total session interactions)."
26722672
},
2673+
{
2674+
"name": "zero-config-deployment-monitor",
2675+
"path": "statusline/zero-config-deployment-monitor.json",
2676+
"category": "statusline",
2677+
"type": "setting",
2678+
"content": "{\n \"description\": \"Auto-detecting Vercel deployment monitor with zero configuration required. Automatically discovers your Vercel auth token from CLI config (macOS: ~/Library/Application Support/com.vercel.cli/auth.json, Linux: ~/.config/vercel/auth.json, Windows: %APPDATA%/vercel/auth.json) and project ID from .vercel/project.json. Shows real-time deployment status, build state icons, deployment URL preview, and time elapsed since last deployment. Falls back gracefully to environment variables VERCEL_TOKEN and VERCEL_PROJECT_ID if auto-detection fails. Works across all platforms without any manual setup.\",\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"bash -c 'input=$(cat); DIR=$(echo \\\"$input\\\" | jq -r \\\".workspace.current_dir\\\"); if [[ \\\"$OSTYPE\\\" == \\\"darwin\\\"* ]]; then AUTH_FILE=\\\"$HOME/Library/Application Support/com.vercel.cli/auth.json\\\"; elif [[ \\\"$OSTYPE\\\" == \\\"linux-gnu\\\"* ]]; then AUTH_FILE=\\\"$HOME/.config/vercel/auth.json\\\"; elif [[ \\\"$OSTYPE\\\" == \\\"msys\\\" || \\\"$OSTYPE\\\" == \\\"cygwin\\\" ]]; then AUTH_FILE=\\\"$APPDATA/vercel/auth.json\\\"; else AUTH_FILE=\\\"$HOME/.config/vercel/auth.json\\\"; fi; PROJECT_FILE=\\\".vercel/project.json\\\"; if [ -f \\\"$AUTH_FILE\\\" ]; then TOKEN=$(jq -r \\\".token // empty\\\" \\\"$AUTH_FILE\\\" 2>/dev/null); else TOKEN=\\\"$VERCEL_TOKEN\\\"; fi; if [ -f \\\"$PROJECT_FILE\\\" ]; then PROJECT=$(jq -r \\\".projectId // empty\\\" \\\"$PROJECT_FILE\\\" 2>/dev/null); else PROJECT=\\\"$VERCEL_PROJECT_ID\\\"; fi; if [ -n \\\"$TOKEN\\\" ] && [ -n \\\"$PROJECT\\\" ] && [ \\\"$TOKEN\\\" != \\\"null\\\" ] && [ \\\"$PROJECT\\\" != \\\"null\\\" ]; then DEPLOY_DATA=$(curl -s -H \\\"Authorization: Bearer $TOKEN\\\" \\\"https://api.vercel.com/v6/deployments?projectId=$PROJECT&limit=1\\\" 2>/dev/null); if [ -n \\\"$DEPLOY_DATA\\\" ] && [ \\\"$DEPLOY_DATA\\\" != \\\"null\\\" ]; then STATE=$(echo \\\"$DEPLOY_DATA\\\" | jq -r \\\".deployments[0].state // empty\\\"); URL=$(echo \\\"$DEPLOY_DATA\\\" | jq -r \\\".deployments[0].url // empty\\\" | cut -c1-20); CREATED=$(echo \\\"$DEPLOY_DATA\\\" | jq -r \\\".deployments[0].created // empty\\\"); if [ -n \\\"$CREATED\\\" ] && [ \\\"$CREATED\\\" != \\\"null\\\" ]; then AGO=$(( ($(date +%s) - $CREATED/1000) / 60 )); TIME_AGO=\\\"${AGO}m ago\\\"; else TIME_AGO=\\\"unknown\\\"; fi; case \\\"$STATE\\\" in READY) STATUS_ICON=\\\"✅\\\";; BUILDING) STATUS_ICON=\\\"🔄\\\";; QUEUED) STATUS_ICON=\\\"⏳\\\";; ERROR) STATUS_ICON=\\\"❌\\\";; *) STATUS_ICON=\\\"❓\\\";; esac; else STATE=\\\"API error\\\"; URL=\\\"\\\"; TIME_AGO=\\\"\\\"; STATUS_ICON=\\\"❌\\\"; fi; else STATE=\\\"config missing\\\"; URL=\\\"\\\"; TIME_AGO=\\\"\\\"; STATUS_ICON=\\\"⚠️\\\"; fi; echo \\\"▲ Vercel 🚀 $STATUS_ICON $STATE | 🌐 $URL | ⏰ $TIME_AGO | 📁 ${DIR##*/}\\\"'\"\n }\n}",
2679+
"description": "Auto-detecting Vercel deployment monitor with zero configuration required. Automatically discovers your Vercel auth token from CLI config (macOS: ~/Library/Application Support/com.vercel.cli/auth.json, Linux: ~/.config/vercel/auth.json, Windows: %APPDATA%/vercel/auth.json) and project ID from .vercel/project.json. Shows real-time deployment status, build state icons, deployment URL preview, and time elapsed since last deployment. Falls back gracefully to environment variables VERCEL_TOKEN and VERCEL_PROJECT_ID if auto-detection fails. Works across all platforms without any manual setup."
2680+
},
26732681
{
26742682
"name": "custom-telemetry",
26752683
"path": "telemetry/custom-telemetry.json",

0 commit comments

Comments
 (0)