mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-06 05:49:12 +02:00
fix(cli): ensure cloud URLs are configured when not using local mode
After installing via `curl | bash` (default/cloud mode) or running `multica setup` without a local server, the CLI config could retain stale localhost URLs from a previous `multica config local` or `--local` install. This caused `multica login` to connect to localhost instead of multica.ai. Fix: explicitly write cloud URLs (api.multica.ai / multica.ai) to the config in both the install script's cloud mode and the setup command's cloud fallback path.
This commit is contained in:
@@ -241,6 +241,16 @@ configure_local() {
|
||||
ok "CLI configured for localhost (backend :8080, frontend :3000)"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Configure CLI for Multica Cloud
|
||||
# ---------------------------------------------------------------------------
|
||||
configure_cloud() {
|
||||
info "Configuring CLI for Multica Cloud..."
|
||||
multica config set server_url https://api.multica.ai 2>/dev/null || true
|
||||
multica config set app_url https://multica.ai 2>/dev/null || true
|
||||
ok "CLI configured for multica.ai"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Main: Default mode (cloud — install CLI to connect to multica.ai)
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -252,6 +262,7 @@ run_default() {
|
||||
|
||||
detect_os
|
||||
install_cli
|
||||
configure_cloud
|
||||
|
||||
printf "\n"
|
||||
printf "${BOLD}${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}\n"
|
||||
|
||||
@@ -55,6 +55,13 @@ func runSetup(cmd *cobra.Command, args []string) error {
|
||||
fmt.Fprintf(os.Stderr, " server_url: %s\n", cfg.ServerURL)
|
||||
} else if !forceLocal {
|
||||
fmt.Fprintln(os.Stderr, "No local server detected — using Multica Cloud (https://multica.ai).")
|
||||
|
||||
cfg, _ := cli.LoadCLIConfigForProfile(profile)
|
||||
cfg.AppURL = "https://multica.ai"
|
||||
cfg.ServerURL = "https://api.multica.ai"
|
||||
if err := cli.SaveCLIConfigForProfile(cfg, profile); err != nil {
|
||||
return fmt.Errorf("save config: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Authenticate.
|
||||
|
||||
Reference in New Issue
Block a user