insta 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -624,7 +624,7 @@ export function removeTarget(count, service, opts) {
624
624
  if (opts.region !== undefined)
625
625
  throw new Error('--region does not apply to --remove');
626
626
  if (service !== undefined) {
627
- throw new Error(count !== undefined && count.trim() !== '' && Number.isFinite(Number(count)) ? '--remove lowers the replica count by one; pass no count' : `unexpected argument: ${service} (usage: insta compute scale [service] --remove <instance>)`);
627
+ throw new Error(count !== undefined && count.trim() !== '' && Number.isFinite(Number(count)) ? '--remove names one instance; pass no count' : `unexpected argument: ${service} (usage: insta compute scale [service] --remove <instance>)`);
628
628
  }
629
629
  return count;
630
630
  }
@@ -634,7 +634,7 @@ export async function computeScale(count, serviceName, opts) {
634
634
  if (opts.remove !== undefined)
635
635
  return computeRemoveInstance(removeTarget(count, serviceName, { remove: opts.remove, region: opts.region }), opts.remove, opts);
636
636
  if (count === undefined)
637
- throw new Error('a replica count is required (or --remove <instance> to drop one named instance)');
637
+ throw new Error('a replica cap is required (or --remove <instance> to drop one named instance)');
638
638
  const machineCount = parseCount(count);
639
639
  const api = await ApiClient.load();
640
640
  const p = await requireProject();
@@ -646,7 +646,7 @@ export async function computeScale(count, serviceName, opts) {
646
646
  return;
647
647
  if (opts.json)
648
648
  return printJson(res.body.service);
649
- info(`scaled compute ${svc.name} to ${machineCount} replica(s)${opts.region ? ` in ${opts.region}` : ''}`);
649
+ info(`set compute ${svc.name} replica cap to ${machineCount}${opts.region ? ` in ${opts.region}` : ''}`);
650
650
  }
651
651
  // `insta compute scale [service] --remove <instance>` — DELETE /services/:id/instances/:instance.
652
652
  async function computeRemoveInstance(serviceName, instance, opts) {
@@ -660,7 +660,7 @@ async function computeRemoveInstance(serviceName, instance, opts) {
660
660
  return;
661
661
  if (opts.json)
662
662
  return printJson(res.body.service);
663
- info(`removed ${instance} from compute ${svc.name}; ${res.body.service?.machine_count ?? '?'} replica(s) remain`);
663
+ info(`removed ${instance} from compute ${svc.name}; replica cap is now ${res.body.service?.machine_count ?? '?'}`);
664
664
  }
665
665
  // ---- limits (the resource ceiling; paid plans) ----
666
666
  // Parse a human memory value into MB: "512", "512mb", "1gb", "2g", "1.5gb".
package/dist/index.js CHANGED
@@ -375,9 +375,9 @@ compute.command('restart [service]').description("Restart a compute service by r
375
375
  .option('--json').option('--branch <branch>', 'branch (default: current)').action(guard((service, o) => computeCmd.computeRestart(service, o)));
376
376
  compute.command('status [service]').description("Show a compute service's desired vs. live state")
377
377
  .option('--json').option('--branch <branch>', 'branch (default: current)').action(guard((service, o) => computeCmd.computeStatus(service, o)));
378
- compute.command('scale [count] [service]').description('Set a compute service same-region replica count, 1 to 10 (paid plans only). --remove <instance> instead drops that one instance and runs one fewer; instance ids are the `instance` field of `insta compute logs --json`. The last instance cannot be removed')
378
+ compute.command('scale [count] [service]').description('Set a compute service same-region replica cap, 1 to 10 (paid plans only). A scale-to-zero service runs 1 up to the cap on demand; an always-on service runs exactly the cap, so turn always-on on to hold a fixed count. --remove <instance> instead drops that one instance: an always-on service runs one fewer, a scale-to-zero one keeps its cap; instance ids are the `instance` field of `insta compute logs --json`. The last instance cannot be removed')
379
379
  .option('--region <region>', 'region to scale in (default: the service region)')
380
- .option('--remove <instance>', 'drop this instance (inst-<12 hex>) and run one fewer replica')
380
+ .option('--remove <instance>', 'drop this instance (inst-<12 hex>)')
381
381
  .option('--json').option('--branch <branch>', 'branch (default: current)')
382
382
  .action(guard((count, service, o) => computeCmd.computeScale(count, service, o)));
383
383
  compute.command('limits [service]').description("Show or set a compute service's resource ceiling (any plan within the free cap; raising above it needs a paid plan). --memory is the dial; cpu derives from it unless --cpu is given. Billing is actual usage — the ceiling caps what the app may burn, it is not a price")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "insta",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "InstaCloud CLI — a thin client of the platform control-plane API.",
6
6
  "keywords": [