Improve Grant CLI Verb Syntax and Handling

the following cli verbs are a bit shit:
https://linear.app/entirehq/issue/COR-699/cant-repo-grant-with-entire-cli has all details. new branch, go!
Bottom line: Reworked the grant/repo CLI per COR-699 — grantees are now positional github:alice handles, repo grants resolve by name, and repo get shows the clone URL. All unit tests + lint pass. Not committed (yours to push).
What changed (cmd/entire/cli/):
- Positional grantee —
grant {org,project,repo} add/removenow take<target> <grantee>where grantee isprovider:handle(e.g.github:alice). The CLI resolves the handle → provider user id behind the scenes (newresolveGranteeProviderviaResolveHandle), killing the--provider/--provider-user-id/--grantee-type/--grantee-idflag soup that caused the original "provider identity not found".removealso accepts an account ULID (typed-id revoke route).- New form:
entire grant repo add web github:alice --project acme --role writer
- New form:
- Clone URL —
entire repo getnow has aREMOTEfield (theentire://URL),-until provisioned. List stays lean. - Resolve-by-name —
grant repo list/add/remove <name> --project <name>already routes throughresolveRepoRef; tests lock in that the name is sent for server-side exact-match. (If it still 404s for you, the gap is the server's repo name filter, not the CLI.)
Two follow-ups worth flagging:
- Friendly grantee in
grant listis server-blocked. Grant lists return an account ULID; there's no reverse account-ULID→handle endpoint (ResolveHandleis forward-only,BatchLookupenriches org/project/repo but not accounts). Needs a server endpoint before the CLI can showgithub:aliceinstead of the ULID. - Per your notes: dropped the real handle/GH-id, swapped to fakes (
alice/12345, examples useweb/acme), and introduced a dedicatedproviderGitHubconstant inresolveref.gorather than borrowing the unrelatedcheckpointProviderGitHub.
Want me to commit, or open a follow-up issue for the server-side grantee reverse-lookup?
$ entire grant repo list dogbark --project paul
no repo named "dogbark" in that project (run entire repo list <project> to see names, or pass a ULID)
that's a terrible idea. don't do that, let's investigate the server-side code in ~/src/entirehq/entiredb. If we need to make changes there, make a NEW git worktree first.
Bottom line: It was a CLI bug, not a server bug — no entiredb change needed. Fixed and committed as 71e6e4c9a.
Root cause: The server (entiredb api/corev1/repos.go:179, core/coreapi/repos.go:629) returns a ?name=-filtered repo list under the singular repo field — exactly like the org/project endpoints. resolveRepoRef read the plural repos array, which is empty on a filtered query, so every grant repo … <name> --project <p> 404'd with "no repo named" even though the repo existed. Your repo list paul worked precisely because it sends no name filter and reads the plural array.
The fix: one field — out.Repo.Get() instead of out.Repos[0], mirroring resolveProjectRef. The old test had mocked the plural array, which is why the bug shipped; the fixture now matches the real server's singular field so the regression stays covered.
No new worktree was needed since the change is entirely in the CLI. Both commits are on paul/cor-699-cant-repo-grant-with-entire-cli, unpushed. Worth a quick live retest of entire grant repo list dogbark --project paul on your end to confirm against the real server.