Skip to content

client create: auto-generate the client name (<firstname>-NN) and make --location optional #137

Description

@LukasWodka

Part of the installer first-run UX v2 spec (umbrella in the backend tracker; interim copy fixes in tracebloc/client#307). Goal: client create needs zero flags and zero prompts on the installer path — name auto-generated, location omitted.

Auto-generated client name — <firstname>-NN

  • Parse first_name from GET /userinfo/ into api.Identity and persist it in the profile at login (the backend already returns it for account users; fallback when empty: email local-part).
  • When --name is absent, auto-name the client <slug(first_name)>-NNlukas-01, lukas-02, … NN = next free number scanned from the account's existing client names (ListClients already fetches the full paginated list in runClientCreate). Zero-padded 2 digits.
  • No name prompt, ever. --name / TRACEBLOC_CLIENT_NAME still override.
  • The auto-name passes internal/slug untouched (lukas-01lukas-01), so display name = namespace = handle by construction, and the -2 slug collision suffix never fires for auto-names.
  • Note: this is a deliberate product deviation from RFC-0001 §6.6 (which derives from the hostname) — decided by Lukas 2026-07-06. Update the RFC §6.6/§7.7 wording in a companion docs commit.

--location optional

  • Remove the location requirement: no errMissingFlag("--location"), no prompt (delete the validateNonEmpty prompt block).
  • CreateClientRequest.Locationjson:"location,omitempty" (the backend accepts absent/blank today — EdgeDevice.location is blank=True, serializer auto-builds required=False).
  • Guard the review render (renderClientReview) for empty location; resumeCommand is already conditional.
  • The internal/geo auto-detect (cli#93) stays available for --location-less enrichment later but must not block or prompt.

Noun pass (naming lock)

  • Adopt message: "This cluster is already registered as client …" → machine/client nouns per the naming rule (machine = hardware, client = tracebloc entity).
  • Sweep remaining user-facing strings for vendorother collaborators (installer strings already swept in client#307).

Acceptance

  • tracebloc client create --yes --credential-file f with no other flags, non-interactive: succeeds — auto-name minted, no location sent.
  • Two machines, same account, same first name → lukas-01, lukas-02 (numbering, not slug -2 stacking).
  • Re-run on the same cluster still adopts (idempotency unchanged).
  • --name/--location flags still honored verbatim.

Refs: RFC-0001 (cli#55) §6.6/§6.7/§7.7 · connect/install flow family backend#877.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions