service add / deploy: --endpoint http|tcp, and show a tcp service's tcp:// address
Merged
JW
7d ago+229+229+012345678901234567890123456789-15-15-01234567890123456789
The CLI half of InsForge/instacloud-platform#658, which adds compute endpoint tcp: a compute service reached as raw TCP on its own port, at its own IPv6 address.
insta service add compute game --image itzg/minecraft-server --port 25565 --endpoint tcp
# added compute service game ⦠ā tcp://<route_key>.ip.<region>.compute.instacloud.tech:25565
insta deploy --image app:2 --port 7000 --endpoint tcp # switch an existing service; --endpoint http switches back
Changes
service add/deploy: new--endpoint <http|tcp>.- Parsed locally, so a typo, or a non-compute
service add, fails before any network call. - Sent only when given, so every existing invocation sends the same body as before.
- Which ports tcp accepts is the platform's answer and is not repeated here.
- Parsed locally, so a typo, or a non-compute
- Archive (source-dir) lane:
- carries
endpointin the one gated body; - accepts a live operation with an empty
urlwhen the platform names the tcp host (endpointHost, added in #658); - an empty
urlwith no tcp host is still the "no URL" failure it always was, and that case has a control test.
- carries
- Output:
service listand theservice addline showtcp://<endpoint_host>:<port>for a tcp service instead of a domain, ortcp/<port> (address after the first deploy)before a deploy has confirmed the host;deployprints-> tcp://host:port;--jsonpassesendpoint/endpoint_host/endpointHostthrough.
Tests
test/endpoint-tcp.test.ts:- parse;
- request bodies, both with and without the flag;
- local refusals;
- list and added lines, including the not-yet-deployed and http-unchanged cases;
- deploy target;
- archive accept and refuse.
- Full suite: 2137 passed;
typecheckclean. - Negative controls: each change was sabotaged in isolation and the matching test failed:
- the list rendering;
- the added line;
- both bodies;
- the deploy target;
- archive accept and archive body;
- the type check.
Order and companions
- Merge order: after #658 deploys. An older platform ignores
endpointand creates an http service. - Command reference: InsForge/instacloud-skills
cli-reference.md(AGENTS rule 4), in its own PR. - MCP: this is a new flag on existing leaves (
service add,deploy), not a new leaf, so rule 6 does not bind. The matchingendpointargument on the MCPdeploy/servicestools will follow in InsForge/instacloud-mcp.
š¤ Generated with Claude Code
Summary by cubic
Adds an --endpoint <http|tcp> option to service add and deploy, letting a compute service be reached as raw TCP on its own port at its own IPv6 address instead of an HTTPS domain. TCP services now show tcp://<host>:<port> (or tcp/<port> (address after the first deploy) before the host is confirmed) in service add, service list, and deploy output, and --json passes the endpoint fields through.
Details
- The flag is parsed locally and only sent when given, so typos and non-compute services fail before any network call, and existing invocations send unchanged bodies.
deploynormalizes the flag beforeApiClient.load()orrequireProject(): either can touch the network, andrequireProject()can persist an automatic link for an unlinked directory, so a typo like--endpoint tpcdies before any of that runs.- The archive deploy lane carries the endpoint and accepts an empty URL when the platform returns an
endpointHost; the no-URL-without-host failure is unchanged. - Requires the platform change to be deployed first; older platforms ignore
endpointand create an HTTP service.