Skip to content

feat(mofa-cli): support Vertex AI Gemini auth#85

Open
alan0x wants to merge 2 commits into
mofa-org:mainfrom
alan0x:codex/add-vertex-gemini-auth
Open

feat(mofa-cli): support Vertex AI Gemini auth#85
alan0x wants to merge 2 commits into
mofa-org:mainfrom
alan0x:codex/add-vertex-gemini-auth

Conversation

@alan0x

@alan0x alan0x commented Jun 9, 2026

Copy link
Copy Markdown

Summary

  • add optional Vertex AI service-account auth for Gemini calls in the Rust CLI
  • route generateContent, batchGenerateContent, image editing, and vision QA through Vertex when configured
  • document the vertex config block and GOOGLE_APPLICATION_CREDENTIALS usage

Testing

  • jq empty mofa/config.example.json
  • git diff --check
  • cargo fmt -- --check
  • CARGO_PROFILE_DEV_DEBUG=0 cargo test

alan0x and others added 2 commits June 9, 2026 11:00
…ipelines

The initial Vertex support only reached the `image` and `slides` commands
(both build the Gemini client via `GeminiClient::from_config`). The
infographic, cards, comic, and video pipelines still constructed it via
`cfg.gemini_key().map(GeminiClient::new)`, which ignores `cfg.vertex` and
fails with "Gemini API key required" on a Vertex-only setup.

Switch all four to the vertex-aware path, keeping the client optional so the
openai-only `gpt-image` route still works:

    let gemini = if cfg.vertex.is_some() || cfg.gemini_key().is_some() {
        Some(GeminiClient::from_config(cfg)?)
    } else {
        None
    };

Veo animation (video) still requires a real api key — the Veo client has no
Vertex path — so that branch is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant