andyawd/vertexaibillingswitchskill/en
Claude Code and agent skill by andyawd/vertexaibillingswitchskill
- community
Checking that the SKILL.md file is still in the repository.
Set up Gemini CLI's Vertex AI authentication mode, including gcloud installation, GCP auth, project setup, API enablement, ADC login, and billing auto-switch Hook deployment. Trigger when user mentions Vertex AI, ADC, Application Default Credentials, GCP project setup, or billing quota. After loading, immediately begin the interactive workflow from Step 0.
Install
npx vskill@latest install andyawd/vertexaibillingswitchskill/enSKILL.md
Your Role
You are an interactive setup wizard. Your task is to guide the user through the Vertex AI setup by following the workflow below, step by step.
Core behavior rules:
- Strictly follow the order: Step 0 → Step 1 → ... → Step 6
- You MUST ALWAYS AND ONLY use the
read_fileandwrite_filetools when handling.envorsettings.jsonfiles (Explanation: Usingrun_shell_commandlikeechoor>causes UTF-16 encoding corruption on Windows. To guarantee consistent behavior, using shell commands for writing is strictly forbidden across ALL operating systems: Mac, Linux, and Windows) - Every step marked
ask_userrequires calling theask_usertool and waiting for a response - You must execute all steps sequentially and wait for each response
- Only use
run_shell_commandwhen a step explicitly instructs you to - If a step fails, follow that step's "Failure handling" instructions
IMPORTANT — Execute Immediately After Loading
You must immediately perform the following action. No preamble is needed:
- DO NOT output any explanatory text
- DO NOT ask "shall we begin" or wait for confirmation
- DIRECTLY call
ask_userto execute Step 0 (Disclaimer Confirmation)
This is a mandatory instruction. Skipping this step is an execution failure.
Vertex AI Billing Switch
Automatically set up Gemini CLI's Vertex AI authentication mode and deploy a global billing auto-switch Hook.
Usage
No other arguments accepted. The Project ID will be collected interactively during execution.
Mandatory Interaction Rules
All steps marked with ask_user are mandatory blocking points:
- DO NOT assume answers
- DO NOT skip or omit questions
- MUST call
ask_userand wait for the user's response before proceeding
Violating these rules is considered an execution failure. The entire process must restart from the beginning.
Workflow
Route Summary
| User Type | Steps | |
|---|---|---|
| First-time user | 0 → 1 → 2 → 3 → 4 → 5 → 6 | |
| Returning user — Full reset | 0 → 1 → 2 → 3 → 4 → 5 → 6 | |
| Returning user — Same account, switch project | 0 → 1 → 4 → 5 (skip Hook deploy) → 6 | |
| Returning user — Switch account | 0 → 1 → 3 → 4 → 5 (skip Hook deploy) → 6 | |
| Returning user — Rename billing accounts | 0 → 1 → R → Done | |
| Returning user — Hook only (Vertex AI already configured) | 0 → 1 → H → 6 |
Step 0: Disclaimer Confirmation
STOP — Mandatory interaction pointThis is the first step after the skill is triggered. It always fires and cannot be skipped.
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
Use ask_user:
Handling logic
"I understand" → Proceed to Step 1
"Let me reconsider" → Display the following message and immediately abort:
Aborted. Please confirm your Google Cloud account has no payment method attached, then run/en run the skill workflowagain.
Step 1: Environment Detection
This step runs silently — no user interaction unless all checks pass.
Checks
Use run_shell_command to perform the following checks sequentially:
1. Check if gcloud is installed:
2. Check if gcloud is authenticated (only if check 1 passed):
3. Check if Hook is deployed (only if checks 1 and 2 passed):
First, get the home directory:
Then check for the Hook file:
Decision logic
All three checks pass (returning user) →
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
Use ask_user:
- "Full reset" → Continue to Step 2 (full flow)
- "Rename billing accounts" → Proceed to Step R
- "Switch project/account" → Set
quick_switch = true, then:
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
Use ask_user:
- "Same account" → Skip to Step 4 (no re-authentication needed)
- "Switch account" → Proceed to Step 3
Checks 1 and 2 pass, check 3 fails (gcloud ready, Hook not deployed) →
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
Use ask_user:
- "Deploy Hook only" → Set
hook_only = true, proceed to Step H - "Full setup" → Continue to Step 2 (full flow)
Checks 1 or 2 fail (first-time user) → Continue to Step 2
Step H: Deploy Hook Only
Entry point from Step 1 whenhook_only = true.The user already has Vertex AI configured and only needs the billing switch Hook deployed.
H-1: Setup Variables
Use run_shell_command to get the home directory:
Store as {home_dir} and set:
{gcloud_cmd}=gcloud(already verified in Step 1){skill_dir}based on installation method:- Installed via Gemini CLI:
{home_dir}/.gemini/extensions/VertexAiBillingSwitchSkill/skills/en - Manually installed:
{home_dir}/.gemini/skills/en
Use run_shell_command to read the current GCP project (for display and options only):
Store as {detected_project} (if empty or (unset), label as "not set").
H-2: Choose GCP Project
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
If{detected_project}is "not set", inform the user before calling ask_user: "gcloud does not have a default project set. Consider choosing 'Specify another project' or 'Create new project'."
Use ask_user:
"Use current project"
Set {project_id} = {detected_project}, proceed directly to H-4 (Confirm deployment).
"Specify another project"
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
Use ask_user:
Validate: if empty or clearly invalid, ask again. Store as {project_id}, proceed to H-3 (Apply new project settings).
"Create new project"
Read `references/create-project.md` and execute the full auto-create sub-flow (4-A detect billing accounts, 4-B enter project name, 4-C create, 4-D link billing, 4-E confirm).
After obtaining {project_id}, proceed to H-3 (Apply new project settings).
H-3: Apply New Project Settings (only for "Specify another project" or "Create new project")
Inform the user:
Switching GCP project to{project_id}…
Execute sequentially using run_shell_command:
Update gcloud default project:
Enable Vertex AI API:
Update `~/.gemini/.env`:
- Use
read_fileto read{home_dir}/.gemini/.env(start with empty content if file doesn't exist) - Remove existing
GOOGLE_CLOUD_PROJECT=andGOOGLE_CLOUD_LOCATION=lines - Append:
`` GOOGLE_CLOUD_PROJECT={project_id} GOOGLE_CLOUD_LOCATION=global ``
- Use
write_fileto write back
Proceed to H-4 (Confirm deployment).
H-4: Confirm Deployment
STOP — You MUST call ask_user. DO NOT assume the answer. Wait for the response before continuing.
Use ask_user:
- Yes → Proceed to H-5
- No → Display "Cancelled. To retry, trigger this Skill again." and abort
H-5: Deploy Hook
Read `references/deploy-hook.md` and execute all deployment steps (directory creation, Hook script copy, settings.json non-destructive merge).
Note: Ignore the precondition at the top of that file stating "execute only whenquick_switch = false". In thehook_only = trueroute, execute all steps directly.
Proceed to Step 6 (hook_only = true).
Step R: Rename Billing Accounts
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/en/SKILL.md
Popularity
- Repository stars
- 6
- Repository forks
- 1
- 7-day trend score
- 10
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/andyawd/vertexaibillingswitchskill/en)