## What changed

`cmd/entire/cli/repo.go`:

- **`repoRemoteURL(r coreapi.Repo)`** — synthesizes `entire://<clusterHost>/<path>` from the created repo's resolved coordinates. It does `strings.TrimPrefix(path, "/")` before joining, so the leading slash the API returns on `path` (which you flagged) produces a single separator — e.g. `path: "/acme/web"` → `entire://aws-us-east-2.entire.io/acme/web`, not a doubled `//`. Returns `""` (field omitted) when either `clusterHost` or `path` is still unresolved on a provisioning repo, so we never emit a half-formed URL.
- **`repoCreateOutput(*coreapi.Repo)`** — merges that `remote` into the repo's JSON. `coreapi.Repo` has a custom ogen marshaler plus `AdditionalProps`, so a wrapper struct that embeds it would have its added field shadowed by the promoted `MarshalJSON`. Instead it round-trips the repo through its own encoder into a `map[string]json.RawMessage` and injects `remote` — preserving every original field.
- The create `RunE` now calls `CreateRepo` then `repoCreateOutput`. Output stays JSON-only (per your choice); `repo get`/`repo list` are untouched.

The URL shape matches what `git-remote-entire` consumes (`repoSlug := parsedURL.Path`) and mirrors the existing `repo mirror` synthesis pattern.

## Verification

- `mise run fmt` — clean
- `mise run lint` — 0 issues
- New tests in `cmd/entire/cli/repo_test.go` pass: leading-slash dedup, missing/blank coordinates → omitted, and a full round-trip asserting `remote` is stamped while `id`/`name` survive.

`jq -r .remote` on the create output now yields `entire://<cluster>/<path>`.

One thing worth confirming when you next hit the real API: that `CreateRepo`'s response actually populates `path` and `clusterHost` synchronously (vs. only after provisioning completes). If a fresh create returns them empty, the `remote` field will be omitted by design — and we'd want to either resolve them another way or document that `repo get` is where the remote appears once provisioned. Want me to extend the stamping to `repo get` as a fallback for that case?

commit

1mo ago·9.5s·1 call

On `main`, so I'll branch first, then commit.

You're on a branch

1mo ago·27.1s·2 calls

Committed on `return-remote-from-create` as `db50a2171`:

- `cmd/entire/cli/repo.go` — `repoRemoteURL` + `repoCreateOutput`, wired into the create command
- `cmd/entire/cli/repo_test.go` — unit tests (leading-slash dedup, missing-coordinate omission, full round-trip)

fmt and lint were already clean and the new tests pass. Nothing pushed.

Cursor says: repoCreateOutput unconditionally overwrites the "remote" key in the marshaled object. If the API later adds a first-class "remote" field (or returns it via additional properties), this would silently replace the server-provided value. Prefer only stamping the synthesized field when it isn't already present.

1mo ago·2m·8 calls

Addressed Cursor's feedback and amended the commit (`7de7dce99c`).

Change in `repoCreateOutput`: it now only stamps the synthesized `remote` when the marshaled object doesn't already contain that key — so a future first-class `remote` field, or one arriving via additional properties, takes precedence over synthesis. Added `TestRepoCreateOutput_PreservesServerProvidedRemote` to lock in that the server value wins. fmt, lint (0 issues), and all four tests pass.

What do you think of this feedback: "repoCreateOutput dereferences r (via *r) without guarding against a nil pointer; if a caller ever passes a nil repo (e.g., unexpected API behavior), this will panic rather than returning an error."

1mo ago·2m·7 calls

Committed as `cce6f8300`.

Summary of what this addresses: added a `nil` guard at the top of `repoCreateOutput` (returning an error instead of panicking) plus `TestRepoCreateOutput_NilRepoErrors`. While wiring it up I also caught that the `errors.New` swap had left the `errors` import missing — the build was broken — so I added the import. Build, tests, and lint (0 issues) are all green.

The nil case stays defensive rather than reachable in practice (the caller only passes a repo on a nil-error create), but the helper now enforces its own contract.

repo create: guard repoCreateOutput against a nil repo

repoCreateOutput dereferenced its *Repo argument (via *r in the remote synthesis) without a nil check. The sole caller only passes a repo after a nil-error create, so this defends the contract rather than a live path — but a nil pointer would slip past json.Marshal (which encodes a nil pointer as "null" without error) and panic later on the dereference. Return an error up front instead.
