feat(compute): public-access command and private addresses
Merged
JW
1d ago+249+249+012345678901234567890123456789-6-6-0123456789
Summary
The CLI side of compute private networking (platform InsForge/instacloud-platform#672; the plane has had it since insta-compute #413).
insta compute public-access [on|off] [service]andinsta <redis|mysql|mongodb> public-access [on|off] [service]:- With no mode, it prints public access and the private address the platform reports (
private_host:port, plusprivate_fqdn). It never composes one. offmakes the service private-only:- compute: its URL answers 403 and stops waking it; only services in the same branch reach it.
- database:
*_URLstops connecting; apps use*_PRIVATE_URL.
- Closing asks first. With no terminal, or with
--json, it refuses (exit 2) unless--yesis passed. This is the same contract asinsta postgres public-access off. onre-opens without asking.- The platform's coded refusals are rewritten as CLI instructions:
private_network_disabled,private_network_unavailable_in_region,no_private_name(namesinsta service rename), andprivate_name_taken.
- With no mode, it prints public access and the private address the platform reports (
insta service listshowsprivate <host>:<port>and, for a closed compute service,public off. A row with noprivate_hostprints exactly as before.
Command surface mirrored in skills (cli-reference.md, separate PR).
Tests
test/private-network.test.ts:- show;
- off asks, declines, and refuses without
--yes(TTY and--json); --yes;- on;
- one row per refusal code;
- the command surfaces the mapped message;
- list lines with and without an address.
test/help-surface.test.ts: the managed database verb list and the compute verbs includepublic-access.- Negative controls, each sabotaged in isolation; the named tests fail, and all pass after restore:
- C1: drop the
--yesgate. - C2: drop a code mapping.
- C3: drop the private address from the list line.
- C4: drop the
public offbadge.
- C1: drop the
npm run typecheckandnpm testpass: 2189 tests, after updating help-surface.
🤖 Generated with Claude Code
Summary by cubic
Adds the CLI side of compute private networking: new public-access commands for compute and managed database services, plus a private address shown in insta service list.
insta compute public-access [on|off] [service]andinsta <redis|mysql|mongodb> public-access [on|off] [service]show public access and the platform-reported private address;offmakes the service private-only (compute URLs answer 403 and stop waking the service; database*_URLs stop connecting, apps use*_PRIVATE_URL), andonre-opens without asking.- Closing asks first and requires
--yeswhen there is no terminal or with--json; the platform's coded refusals now surface as CLI instructions (for example, a missing private name suggestsinsta service rename). insta service listshowsprivate <host>:<port>and apublic offbadge for a closed compute service; rows without a private host print exactly as before.