@@ -10,47 +10,23 @@ metadata:
1010
1111Deploy and manage projects on Vercel using the CLI with token-based authentication, without relying on ` vercel login ` .
1212
13- ## Step 1: Locate the Vercel Token
13+ ## Step 1: Verify Vercel Credentials Without Printing Secrets
1414
1515Before running any Vercel CLI commands, identify where the token is coming from. Work through these scenarios in order:
1616
1717### A) ` VERCEL_TOKEN ` is already set in the environment
1818
1919``` bash
20- printenv VERCEL_TOKEN
20+ test -n " ${ VERCEL_TOKEN:- } " && echo " VERCEL_TOKEN is set " || echo " VERCEL_TOKEN is not set "
2121```
2222
2323If this returns a value, you're ready. Skip to Step 2.
2424
25- ### B) Token is in a ` .env ` file under ` VERCEL_TOKEN `
25+ ### B) Token is not set
2626
27- ``` bash
28- grep ' ^VERCEL_TOKEN=' .env 2> /dev/null
29- ```
30-
31- If found, export it:
32-
33- ``` bash
34- export VERCEL_TOKEN=$( grep ' ^VERCEL_TOKEN=' .env | cut -d= -f2-)
35- ```
36-
37- ### C) Token is in a ` .env ` file under a different name
38-
39- Look for any variable that looks like a Vercel token (Vercel tokens typically start with ` vca_ ` ):
40-
41- ``` bash
42- grep -i ' vercel' .env 2> /dev/null
43- ```
44-
45- Inspect the output to identify which variable holds the token, then export it as ` VERCEL_TOKEN ` :
46-
47- ``` bash
48- export VERCEL_TOKEN=$( grep ' ^<VARIABLE_NAME>=' .env | cut -d= -f2-)
49- ```
50-
51- ### D) No token found — ask the user
52-
53- If none of the above yield a token, ask the user to provide one. They can create a Vercel access token at vercel.com/account/tokens.
27+ Do not search ` .env ` files or print candidate values. Ask the user to export ` VERCEL_TOKEN ` in their local
28+ shell or secret manager, then repeat the presence check. Never ask them to paste the token into chat. They can
29+ create an access token at vercel.com/account/tokens.
5430
5531---
5632
@@ -70,12 +46,9 @@ vercel deploy
7046Similarly, check for the project ID and team scope. These let the CLI target the right project without needing ` vercel link ` .
7147
7248``` bash
73- # Check environment
74- printenv VERCEL_PROJECT_ID
75- printenv VERCEL_ORG_ID
76-
77- # Or check .env
78- grep -i ' vercel' .env 2> /dev/null
49+ # Check presence without printing identifiers
50+ test -n " ${VERCEL_PROJECT_ID:- } " && echo " VERCEL_PROJECT_ID is set" || echo " VERCEL_PROJECT_ID is not set"
51+ test -n " ${VERCEL_ORG_ID:- } " && echo " VERCEL_ORG_ID is set" || echo " VERCEL_ORG_ID is not set"
7952```
8053
8154** If you have a project URL** (e.g. ` https://vercel.com/my-team/my-project ` ), extract the team slug:
0 commit comments