Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ _bmad-output/*
# macOS
.DS_Store
._*

# Opencode
.beads/
.opencode/
.cli-proxy-api/
.venv/
4 changes: 3 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func main() {
var antigravityLogin bool
var projectID string
var vertexImport string
var vertexImportPrefix string
var configPath string
var password string

Expand All @@ -81,6 +82,7 @@ func main() {
flag.StringVar(&projectID, "project_id", "", "Project ID (Gemini only, not required)")
flag.StringVar(&configPath, "config", DefaultConfigPath, "Configure File Path")
flag.StringVar(&vertexImport, "vertex-import", "", "Import Vertex service account key JSON file")
flag.StringVar(&vertexImportPrefix, "vertex-import-prefix", "", "Prefix for Vertex model namespacing (use with -vertex-import)")
flag.StringVar(&password, "password", "", "")

flag.CommandLine.Usage = func() {
Expand Down Expand Up @@ -449,7 +451,7 @@ func main() {

if vertexImport != "" {
// Handle Vertex service account import
cmd.DoVertexImport(cfg, vertexImport)
cmd.DoVertexImport(cfg, vertexImport, vertexImportPrefix)
} else if login {
// Handle Google/Gemini login
cmd.DoLogin(cfg, projectID, options)
Expand Down
3 changes: 3 additions & 0 deletions internal/auth/vertex/vertex_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ type VertexCredentialStorage struct {

// Type is the provider identifier stored alongside credentials. Always "vertex".
Type string `json:"type"`

// Prefix optionally namespaces models for this credential (e.g., "teamA/gemini-2.0-flash").
Prefix string `json:"prefix,omitempty"`
}

// SaveTokenToFile writes the credential payload to the given file path in JSON format.
Expand Down
3 changes: 2 additions & 1 deletion internal/cmd/vertex_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// DoVertexImport imports a Google Cloud service account key JSON and persists
// it as a "vertex" provider credential. The file content is embedded in the auth
// file to allow portable deployment across stores.
func DoVertexImport(cfg *config.Config, keyPath string) {
func DoVertexImport(cfg *config.Config, keyPath string, prefix string) {
if cfg == nil {
cfg = &config.Config{}
}
Expand Down Expand Up @@ -69,6 +69,7 @@ func DoVertexImport(cfg *config.Config, keyPath string) {
ProjectID: projectID,
Email: email,
Location: location,
Prefix: strings.TrimSpace(prefix),
}
metadata := map[string]any{
"service_account": sa,
Expand Down