From 962abdbb2bedd41389ffb68bb566ae960ad639e9 Mon Sep 17 00:00:00 2001 From: Azzurriii Date: Mon, 9 Nov 2026 15:01:16 +0700 Subject: [PATCH] feat: make production endpoint selectable in environment picker Co-Authored-By: Claude Opus 5.5 --- internal/app/app.go | 2 +- internal/app/commands.go | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/internal/app/app.go b/internal/app/app.go index d917506..f9501c0 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -25,7 +25,7 @@ import ( const ( DefaultApexEndpoint = "https://api.enterprise-sandbox.fystack.io" - // ProductionApexEndpoint is listed in the setup menu but not selectable yet. + // ProductionApexEndpoint is offered as an environment in the setup menu. ProductionApexEndpoint = "https://api.fystack.io" defaultTokenMax = 4096 operatorSchema = 2 diff --git a/internal/app/commands.go b/internal/app/commands.go index 677eb5c..1074a21 100644 --- a/internal/app/commands.go +++ b/internal/app/commands.go @@ -206,18 +206,25 @@ func (a *App) promptEndpoint(defaultValue string) (string, error) { if !ok || !isTerminal(file) { return defaultValue, nil } - const custom = 2 + const ( + sandbox = iota + production + custom + ) options := []menuOption{ - {Label: fmt.Sprintf("Sandbox %s", defaultValue)}, - {Label: fmt.Sprintf("Production %s (coming soon)", ProductionApexEndpoint), Disabled: true}, - {Label: "Custom endpoint"}, + sandbox: {Label: fmt.Sprintf("Sandbox %s", defaultValue)}, + production: {Label: fmt.Sprintf("Production %s", ProductionApexEndpoint)}, + custom: {Label: "Custom endpoint"}, } choice, err := a.choose(file, "Fystack environment", options) if err != nil { return "", fmt.Errorf("read Fystack environment: %w", err) } - if choice != custom { + switch choice { + case sandbox: return defaultValue, nil + case production: + return ProductionApexEndpoint, nil } for { fmt.Fprint(a.Out, "Custom endpoint: ")