Feature/support for vertexai accounts#2
Open
giefferre wants to merge 8 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add first-class Google VertexAI account support alongside existing OAuth accounts. CCM can now manage mixed fleets of OAuth and VertexAI identities with full feature parity: switching, isolated profiles, export/import, health checks, and statusline display.
Motivation
Claude Code supports authentication via Google VertexAI (
CLAUDE_CODE_USE_VERTEX=1insettings.json), but CCM's account model was built entirely around OAuth email-based identity. Users running VertexAI cannot use CCM at all —ccm addfails because no.oauthAccountexists. This PR makes VertexAI a first-class account type, identified by GCP project ID instead of email.Design decisions
ccm addreadssettings.jsonforCLAUDE_CODE_USE_VERTEX=1and branches automatically — no--type vertexflag needed.settings.json(project ID, region, model pins, caching flags, service account path) is captured and restored as a unit, preserving configuration fidelity across switches..oauthAccountor VertexAI env vars) to prevent ambiguous auth state.vertex:project-ideverywhere (list, statusline, history, export).Changes
ccm.sh(+1114 / -375 lines):"type": "oauth"to existing accounts)get_account_type(),get_account_display_id(),get_current_account_type(),read_vertex_env()/write_vertex_env()/clear_vertex_env(), credential backup/restore,account_exists_by_project(),validate_vertex_project_id()perform_switch()dispatching four scenarios: OAuth↔OAuth, OAuth→Vertex, Vertex→OAuth, Vertex↔Vertexcmd_add_account()refactored into_add_oauth_account()+_add_vertex_account()cmd_list,cmd_verify,cmd_remove_account,cmd_export,cmd_import,cmd_reorder,cmd_recover,switch_isolated,profiles_sync,cmd_history,cmd_setup, embedded statusline heredocresolve_account_identifier()now searches by project ID (4th dimension after number, email, alias)statusline.sh: Mirrored VertexAI detection from embedded heredoc — readsCLAUDE_CODE_USE_VERTEXandANTHROPIC_VERTEX_PROJECT_IDfromsettings.json, matches againstsequence.jsonby.projectId.Documentation: CHANGELOG.md, README.md, CLAUDE.md, ccm/SKILL.md, index.html, statusline.html updated with VertexAI references, examples, and corrected architecture line ranges.
Retro-compatibility
bash -n ccm.shpasses on every commit.Test plan
ccm version— shows 4.3.0ccm doctor— all 13 checks passccm list— existing OAuth accounts display normally withtype: "oauth"after migrationsettings.json, runccm add— auto-detects and registers asvertextypeccm list— showsvertex:project-idfor VertexAI accountccm switchbetween OAuth and VertexAI — clean transition, correct config stateccm switch --isolated <vertex-alias>— creates profile with correct env varsccm verify— validates both OAuth and VertexAI backupsccm recover— detects VertexAI-specific inconsistenciesccm export/ccm importround-trip with mixed account typesccm remove <vertex-account>— cleans up vertex env backup and configvertex:project-idfor active VertexAI sessionindex.htmlandstatusline.htmlrender correctly in browser