diff --git a/cmd/axme/email_login.go b/cmd/axme/email_login.go index 6fc0eb0..244ea90 100644 --- a/cmd/axme/email_login.go +++ b/cmd/axme/email_login.go @@ -271,6 +271,34 @@ func (rt *runtime) runEmailLogin(ctx context.Context, ctxName string) error { return err } + // Optional profile collection (name + company) — best-effort, never blocks login. + if !rt.outputJSON && c.resolvedActorToken() != "" { + fmt.Fprintln(os.Stderr) + fmt.Fprintln(os.Stderr, " Quick profile (press Enter to skip):") + fmt.Fprintln(os.Stderr) + + fmt.Fprint(os.Stderr, " Your name: ") + nameReader := bufio.NewReader(os.Stdin) + nameLine, _ := nameReader.ReadString('\n') + displayName := strings.TrimSpace(nameLine) + + fmt.Fprint(os.Stderr, " Company: ") + companyReader := bufio.NewReader(os.Stdin) + companyLine, _ := companyReader.ReadString('\n') + company := strings.TrimSpace(companyLine) + + if displayName != "" || company != "" { + profilePayload := map[string]any{} + if displayName != "" { + profilePayload["display_name"] = displayName + } + if company != "" { + profilePayload["company"] = company + } + _, _, _, _ = rt.request(ctx, c, "POST", "/v1/portal/personal/profile", nil, profilePayload, true) + } + } + summary := rt.deviceLoginSummary(ctx, c, ctxName, hydrated) if rt.outputJSON { return rt.printJSON(summary) diff --git a/cmd/axme/main.go b/cmd/axme/main.go index fb7c4d4..386eee8 100644 --- a/cmd/axme/main.go +++ b/cmd/axme/main.go @@ -4240,6 +4240,7 @@ func (rt *runtime) hydrateContextFromServer(ctx context.Context, c *clientConfig } func (rt *runtime) applyAuthHeaders(req *http.Request, c *clientConfig) { + req.Header.Set("X-Axme-Client", "axme-cli/"+version) if c.APIKey != "" { req.Header.Set("x-api-key", c.APIKey) }