koigrid 0.24.0 → 0.26.0

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to the koigrid CLI are documented here. Format: [Keep a Chan
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.26.0] — 2026-12-01
8
+
9
+ ### Added
10
+
11
+ - `koigrid apps oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]`: the app's OIDC identity, so it
12
+ can reach your AWS or GCP without static cloud keys. `on` enables it, `show` prints the issuer and subject to trust in
13
+ your cloud, and `token` issues a 1-hour token to test `aws sts assume-role-with-web-identity`.
14
+
15
+ ## [0.25.0] — 2026-11-30
16
+
17
+ ### Changed
18
+
19
+ - `koigrid apps domains --help` says which DNS record each domain needs: a subdomain (`www.example.com`) → CNAME to `<slug>.apps…`; a root domain (`example.com`) cannot hold a CNAME → ALIAS/ANAME to the same name (Cloudflare flattens a CNAME at the root), or CNAME `www` and redirect the root to it. `koigrid apps domains <id> add <root>` now also prints that note, which the API returns in English.
20
+
7
21
  ## [0.24.0] — 2026-11-30
8
22
 
9
23
  ### Added
@@ -477,7 +477,7 @@ export async function apps(a) {
477
477
  if (!d)
478
478
  throw new Error('need <domain>');
479
479
  const r = await api(`/apps/${encodeURIComponent(id)}/domains`, { method: 'POST', body: { domain: d } });
480
- return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Added ${d} — create DNS: ${r.instructions}`) + (r.acme?.record ? `\n zero-downtime migration (optional): CNAME ${r.acme.record.name} → ${r.acme.record.value} (cert is issued before your DNS points here)` : ''));
480
+ return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Added ${d} — create DNS: ${r.instructions}`) + (r.record?.note ? `\n ${r.record.note}` : '') + (r.acme?.record ? `\n zero-downtime migration (optional): CNAME ${r.acme.record.name} → ${r.acme.record.value} (cert is issued before your DNS points here)` : ''));
481
481
  }
482
482
  if (act === 'rm') {
483
483
  const d = a.positionals[2];
@@ -584,6 +584,31 @@ export async function apps(a) {
584
584
  const r = await api(`/apps/${encodeURIComponent(id)}/retention`, { method: 'PUT', body: { keepLast } });
585
585
  return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Retention: keep last ${r.retention?.keepLast ?? 'all'}${r.pruned ? ` (pruned ${r.pruned})` : ''}`));
586
586
  }
587
+ case 'oidc': {
588
+ // Identidad OIDC de la app (ficha ef39289f): koigrid como emisor para entrar en la nube del cliente sin claves fijas.
589
+ need(' [show|on|off|token] [--audience <aud>] [--role-arn <arn>]');
590
+ const act = a.positionals[1] || 'show';
591
+ const base = `/apps/${encodeURIComponent(id)}/oidc`;
592
+ if (act === 'token') {
593
+ const r = await api(`/apps/${encodeURIComponent(id)}/oidc/token`, { method: 'POST' });
594
+ return console.log(json ? JSON.stringify(r, null, 2) : r.token);
595
+ }
596
+ if (act === 'show' && a.flags.audience === undefined && a.flags['role-arn'] === undefined) {
597
+ const r = await api(base);
598
+ return console.log(json ? JSON.stringify(r, null, 2) : `oidc: ${r.oidc?.enabled ? 'on' : 'off'}\nissuer: ${r.oidc?.issuer}\nsubject: ${r.oidc?.subject}\naudience: ${r.oidc?.audience}${r.oidc?.roleArn ? `\nrole: ${r.oidc.roleArn}` : ''}`);
599
+ }
600
+ if (!['show', 'on', 'off'].includes(act))
601
+ throw new Error('usage: koigrid apps oidc <id> [show|on|off|token] [--audience <aud>] [--role-arn <arn>]');
602
+ const body = {};
603
+ if (act === 'on' || act === 'off')
604
+ body.enabled = act === 'on';
605
+ if (a.flags.audience !== undefined)
606
+ body.audience = a.flags.audience === 'default' ? null : String(a.flags.audience);
607
+ if (a.flags['role-arn'] !== undefined)
608
+ body.roleArn = a.flags['role-arn'] === 'none' ? null : String(a.flags['role-arn']);
609
+ const r = await api(base, { method: 'PUT', body });
610
+ return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ OIDC ${r.oidc?.enabled ? 'on' : 'off'} · issuer ${r.oidc?.issuer} · audience ${r.oidc?.audience}`));
611
+ }
587
612
  case 'protection': {
588
613
  need(' [show|password|ips|off]');
589
614
  const act = a.positionals[1] || 'show';
package/dist/manifest.js CHANGED
@@ -20,11 +20,14 @@ export const CLI_COMMANDS = [
20
20
  --no-wait (or --detach) returns at once · --timeout <min> (default 20) · with --json it returns at once unless --wait
21
21
  Other --project <id> · --json`,
22
22
  domains: `koigrid apps domains <app-id> add <domain> | move <domain> | rm <domain> | ls | verify
23
- Custom domain on your app: add it, create the DNS record it prints (CNAME to <slug>.apps…), and koigrid issues the
24
- TLS certificate. move <domain> takes it from another of your apps, keeping its certificate. verify re-checks the DNS.`,
23
+ Custom domain on your app: add it, create the DNS record it prints, and koigrid issues the TLS certificate.
24
+ Subdomain (www.example.com, app.example.com) → CNAME to <slug>.apps…
25
+ Root domain (example.com) → a root cannot hold a CNAME: ALIAS/ANAME (Cloudflare flattens a CNAME at the root) to the
26
+ same <slug>.apps… name; if your DNS has no ALIAS, CNAME www and redirect the root to www.
27
+ move <domain> takes it from another of your apps, keeping its certificate. verify re-checks the DNS.`,
25
28
  },
26
- subs: ['ls', 'deploy', 'logs', 'http', 'requests', 'rm', 'rename', 'health-path', 'port', 'release', 'build-settings', 'traffic-ramp', 'max-surge', 'min-ready', 'deploy-analysis', 'scale', 'resize', 'autoscale', 'scale-out', 'env', 'domains', 'volumes', 'cdn', 'cache', 'protection', 'retention', 'github', 'github-repos', 'hooks', 'rollback', 'pause', 'resume', 'restore', 'migrate', 'deployments', 'previews', 'preview', 'rules', 'rule', 'rule-rm', 'rule-toggle', 'registry', 'loadtest'],
27
- endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/http', 'apps/[id]/requests', 'apps/[id]/scale', 'apps/[id]/resources', 'apps/[id]/autoscale', 'apps/[id]/scale-out', 'apps/[id]/env', 'apps/[id]/env/verify', 'apps/[id]/domains', 'apps/[id]/domains/verify', 'apps/[id]/volumes', 'apps/[id]/volumes/[volId]', 'apps/[id]/volumes/[volId]/backups', 'apps/[id]/volumes/[volId]/backups/[backupId]/restore', 'apps/[id]/cdn', 'apps/[id]/cache', 'apps/[id]/cache/purge', 'apps/[id]/protection', 'apps/[id]/protection/evaluate', 'apps/[id]/retention', 'apps/[id]/github', 'github/repos', 'apps/[id]/deploy-hooks', 'apps/[id]/deploy-hooks/[hookId]', 'apps/[id]/rollback', 'apps/[id]/pause', 'apps/[id]/resume', 'apps/[id]/restore', 'apps/[id]/migrate', 'apps/[id]/previews', 'apps/[id]/rules', 'apps/[id]/rules/[ruleId]', 'apps/[id]/registry', 'apps/[id]/loadtest'],
29
+ subs: ['ls', 'deploy', 'logs', 'http', 'requests', 'rm', 'rename', 'health-path', 'port', 'release', 'build-settings', 'traffic-ramp', 'max-surge', 'min-ready', 'deploy-analysis', 'scale', 'resize', 'autoscale', 'scale-out', 'env', 'domains', 'volumes', 'cdn', 'cache', 'protection', 'retention', 'oidc', 'github', 'github-repos', 'hooks', 'rollback', 'pause', 'resume', 'restore', 'migrate', 'deployments', 'previews', 'preview', 'rules', 'rule', 'rule-rm', 'rule-toggle', 'registry', 'loadtest'],
30
+ endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/http', 'apps/[id]/requests', 'apps/[id]/scale', 'apps/[id]/resources', 'apps/[id]/autoscale', 'apps/[id]/scale-out', 'apps/[id]/env', 'apps/[id]/env/verify', 'apps/[id]/domains', 'apps/[id]/domains/verify', 'apps/[id]/volumes', 'apps/[id]/volumes/[volId]', 'apps/[id]/volumes/[volId]/backups', 'apps/[id]/volumes/[volId]/backups/[backupId]/restore', 'apps/[id]/cdn', 'apps/[id]/cache', 'apps/[id]/cache/purge', 'apps/[id]/protection', 'apps/[id]/protection/evaluate', 'apps/[id]/retention', 'apps/[id]/oidc', 'apps/[id]/oidc/token', 'apps/[id]/github', 'github/repos', 'apps/[id]/deploy-hooks', 'apps/[id]/deploy-hooks/[hookId]', 'apps/[id]/rollback', 'apps/[id]/pause', 'apps/[id]/resume', 'apps/[id]/restore', 'apps/[id]/migrate', 'apps/[id]/previews', 'apps/[id]/rules', 'apps/[id]/rules/[ruleId]', 'apps/[id]/registry', 'apps/[id]/loadtest'],
28
31
  },
29
32
  { name: 'db', aliases: ['databases', 'database'], product: 'databases', summary: 'Managed Postgres (HA) — incl. SQL console (db query/tables) + branching (db branch) + managed restore (db restore-dump)', subs: ['ls', 'info', 'create', 'rm', 'rename', 'pause', 'resume', 'retention', 'weekly', 'monthly', 'url', 'connect', 'metrics', 'events', 'top-queries', 'slots', 'logs', 'backups', 'restore', 'restore-dump', 'fix-ownership', 'analyze', 'import', 'restore-status', 'ext', 'replicas', 'dr-copy', 'network', 'recovery-cert', 'backup-key', 'backup-access', 'pub', 'query', 'tables', 'branch', 'roles', 'params', 'pooler', 'rotation', 'patching', 'sync', 'slot-cap', 'resize', 'apply-config', 'maintenance', 'subs', 'data', 'rpc'], endpoints: ['databases', 'databases/[id]', 'databases/[id]/pause', 'databases/[id]/resume', 'databases/[id]/connection', 'databases/[id]/backups', 'databases/[id]/restore', 'databases/[id]/restore-dump', 'databases/[id]/restore-dump/upload-url', 'databases/[id]/restore-dump/[jobId]', 'databases/[id]/fix-ownership', 'databases/[id]/analyze', 'databases/[id]/metrics', 'databases/[id]/events', 'databases/[id]/queries', 'databases/[id]/replication-slots', 'databases/[id]/logs', 'databases/[id]/extensions', 'databases/[id]/replicas', 'databases/[id]/dr-copy', 'databases/[id]/network', 'databases/recovery-certificate', 'databases/[id]/backups/encryption-key', 'databases/[id]/backups/access', 'databases/[id]/publications', 'databases/[id]/subscriptions', 'databases/[id]/subscriptions/preflight', 'databases/[id]/subscriptions/verify', 'databases/[id]/subscriptions/verify/[verificationId]', 'databases/[id]/subscriptions/sync-sequences', 'databases/[id]/apply-config', 'databases/[id]/maintenance/apply', 'databases/[id]/maintenance/defer', 'databases/[id]/query', 'databases/[id]/branches', 'databases/[id]/branches/[branchId]', 'databases/[id]/branches/[branchId]/reset', 'databases/[id]/roles', 'databases/[id]/roles/[roleName]', 'databases/[id]/parameters', 'databases/[id]/pooler', 'databases/[id]/rotation', 'databases/[id]/rotation/rotate', 'databases/[id]/rotation/migrate', 'databases/[id]/data/[table]', 'databases/[id]/rpc/[fn]'] },
30
33
  { name: 'redis', aliases: ['cache'], product: 'cache', summary: 'Managed Redis (HA)', subs: ['apply-config', 'ls', 'create', 'rm', 'rename', 'resize', 'url', 'connect', 'metrics', 'backups', 'restore', 'dr-copy', 'network', 'password', 'maintenance'], endpoints: ['redis/[id]/apply-config', 'redis/[id]/maintenance/defer', 'redis/[id]/password', 'redis', 'redis/[id]', 'redis/[id]/connection', 'redis/[id]/backups', 'redis/[id]/restore', 'redis/[id]/metrics', 'redis/[id]/dr-copy', 'redis/[id]/network'] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koigrid",
3
- "version": "0.24.0",
3
+ "version": "0.26.0",
4
4
  "description": "koigrid CLI — deploy apps, databases, redis, storage and more from your terminal (or your AI agent).",
5
5
  "bin": {
6
6
  "koigrid": "dist/index.js"