Add Entire Repo Clone Command · Entire
Command Addition
Added a command: entire repo clone /gh/entirehq/entire-api, which checks if there's an existing mirror of that repo. If there's only one cell, it does the git clone. If it's available in more than one cell, it lets you select in the same interactive way entire repo mirror create does today. It should also allow an optional positional argument target directory. Pass that argument through to the git clone call.
What it does:
- Parses
/gh/<owner>/<repo>(leading slash optional, owner/repo lowercased, same charset guards as mirror create). - Lists mirror placements of that repo via the control plane (server-side provider+owner filter, client-side repo match).
- 0 mirrors → error pointing at
entire repo mirror create. - 1 cell → clones immediately.
- >1 cell → interactive
huhpicker (cell · jurisdiction · host), same style asmirror create. - Optional
[target-dir]passed straight through togit clone entire://<host>/gh/<owner>/<repo> [target-dir].
Tradeoffs / notes:
- Non-interactive + multiple cells: errors with a
--cluster <host>pointer rather than hanging. Added a--clusterflag for scripting/disambiguation. - Picker is single-select (you clone from one cell), not multi-select like create.
- Doesn't filter by mirror status — a suspended/processing placement is still offered;
git clonesurfaces the failure. Easy to tighten later if you want onlyreadycells listed.
Commit Summary
- Committed as
69c03282aonshimmying-gliding-mitten.
Changes and Features
entire clone <repo> [target-dir]— top-level alias, visible in root help, same code asentire repo clone(fresh command instance since cobra forbids one command under two parents; carries--json/--insecure-http-authpersistent flags the repo group otherwise supplies).- Lint fix done right: moved
agentimport.Importer's ireturn suppression from a per-line//nolintinto the.golangci.yamlallowlist, and removed the directive. The per-line form was being repeatedly stripped bymise run lint's--fix, which then tripped CI (no--fix). Allowlisting is stable against that.
Testing and Verification
Tests cover ref parsing, cell labels, target selection (single/dedupe/--cluster match+miss/non-interactive), and the client-side repo filter. mise run fmt && lint clean; full cmd/entire/cli suite passes.
Review Process
- PR: Pull Request 1529.
- Ctrl+C bug fixed: the picker cancellation returned a zero-value mirror with a nil error, so clone fell through to
git clone entire:///gh/...(empty host). Now a cancelled picker is a silent abort — it just prints "Clone cancelled." and exits cleanly, no git invocation.