koigrid 0.7.0 → 0.9.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 +19 -2
- package/dist/api.js +78 -6
- package/dist/args.js +19 -0
- package/dist/commands/analytics.js +1 -1
- package/dist/commands/apps.js +369 -27
- package/dist/commands/audit.js +1 -1
- package/dist/commands/billing.js +87 -0
- package/dist/commands/bots.js +1 -1
- package/dist/commands/changelog.js +19 -0
- package/dist/commands/checks.js +4 -3
- package/dist/commands/config.js +9 -6
- package/dist/commands/connect.js +2 -2
- package/dist/commands/db.js +761 -17
- package/dist/commands/dns.js +1 -1
- package/dist/commands/errors.js +1 -1
- package/dist/commands/events.js +15 -3
- package/dist/commands/experiments.js +105 -0
- package/dist/commands/flags.js +22 -3
- package/dist/commands/heartbeats.js +3 -3
- package/dist/commands/images.js +1 -1
- package/dist/commands/jobs.js +39 -4
- package/dist/commands/links.js +59 -0
- package/dist/commands/logs.js +1 -1
- package/dist/commands/members.js +26 -1
- package/dist/commands/network.js +28 -0
- package/dist/commands/notices.js +24 -0
- package/dist/commands/notifications.js +2 -2
- package/dist/commands/otel.js +1 -1
- package/dist/commands/pricing.js +37 -0
- package/dist/commands/projects.js +1 -1
- package/dist/commands/queues.js +4 -3
- package/dist/commands/redis.js +80 -2
- package/dist/commands/registry.js +58 -3
- package/dist/commands/rewards.js +92 -14
- package/dist/commands/sandboxes.js +507 -2
- package/dist/commands/speed.js +1 -1
- package/dist/commands/spend.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/storage.js +51 -3
- package/dist/commands/support.js +47 -0
- package/dist/commands/tokens.js +7 -3
- package/dist/commands/up.js +6 -2
- package/dist/commands/waf.js +1 -1
- package/dist/commands/webhooks.js +1 -1
- package/dist/commands/wordpress.js +4 -3
- package/dist/commands/workflows.js +4 -3
- package/dist/esperar.js +41 -0
- package/dist/help.js +14 -1
- package/dist/index.js +26 -6
- package/dist/manifest.js +29 -12
- package/dist/output.js +1 -0
- package/dist/proyecto.js +6 -0
- package/dist/registry-flags.js +17 -0
- package/dist/registry.js +8 -2
- package/package.json +1 -1
- package/dist/commands/ai.js +0 -56
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { api } from '../api.js';
|
|
2
|
+
import { output, green } from '../output.js';
|
|
3
|
+
// koigrid support — hablar con el equipo de koigrid y leer sus respuestas (lo mismo que /dashboard/support).
|
|
4
|
+
// koigrid support [ls] (● = el equipo respondió y no lo has leído)
|
|
5
|
+
// koigrid support open <support|feedback> "<mensaje>"
|
|
6
|
+
// koigrid support show <id> (enseña el hilo y lo marca como leído)
|
|
7
|
+
// koigrid support reply <id> "<mensaje>"
|
|
8
|
+
export async function support(a) {
|
|
9
|
+
const json = !!a.flags.json, sub = a.sub || 'ls';
|
|
10
|
+
if (sub === 'ls' || sub === 'list') {
|
|
11
|
+
const r = await api('/support');
|
|
12
|
+
const l = r.conversations || [];
|
|
13
|
+
if (!json)
|
|
14
|
+
console.log(green(`${r.unread} conversation(s) with an unread reply`));
|
|
15
|
+
return output(l, json, { rows: l.map((c) => ({ id: String(c.id).slice(0, 8), new: c.unread ? '●' : '', kind: c.kind, status: c.status, subject: c.subject })), columns: ['id', 'new', 'kind', 'status', 'subject'] });
|
|
16
|
+
}
|
|
17
|
+
if (sub === 'open' || sub === 'new') {
|
|
18
|
+
const [kind, ...resto] = a.positionals;
|
|
19
|
+
const message = resto.join(' ');
|
|
20
|
+
if ((kind !== 'support' && kind !== 'feedback') || !message)
|
|
21
|
+
throw new Error('usage: koigrid support open <support|feedback> "<message>"');
|
|
22
|
+
const r = await api('/support', { method: 'POST', body: { kind, message } });
|
|
23
|
+
return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ conversation ${r.conversation?.id} opened`));
|
|
24
|
+
}
|
|
25
|
+
if (sub === 'show') {
|
|
26
|
+
const id = a.positionals[0];
|
|
27
|
+
if (!id)
|
|
28
|
+
throw new Error('usage: koigrid support show <id>');
|
|
29
|
+
const r = await api(`/support/${encodeURIComponent(id)}`);
|
|
30
|
+
await api(`/support/${encodeURIComponent(id)}/read`, { method: 'POST', body: {} });
|
|
31
|
+
if (json)
|
|
32
|
+
return console.log(JSON.stringify(r, null, 2));
|
|
33
|
+
console.log(green(`${r.conversation?.subject} · ${r.conversation?.status}`));
|
|
34
|
+
for (const m of r.messages || [])
|
|
35
|
+
console.log(`\n[${m.role === 'team' ? 'koigrid' : 'you'} · ${String(m.createdAt).slice(0, 16).replace('T', ' ')}]\n${m.body}`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (sub === 'reply') {
|
|
39
|
+
const [id, ...resto] = a.positionals;
|
|
40
|
+
const message = resto.join(' ');
|
|
41
|
+
if (!id || !message)
|
|
42
|
+
throw new Error('usage: koigrid support reply <id> "<message>"');
|
|
43
|
+
await api(`/support/${encodeURIComponent(id)}/messages`, { method: 'POST', body: { message } });
|
|
44
|
+
return console.log(json ? JSON.stringify({ ok: true }) : green('✓ reply sent'));
|
|
45
|
+
}
|
|
46
|
+
throw new Error(`unknown: support ${sub}`);
|
|
47
|
+
}
|
package/dist/commands/tokens.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
+
import { proyectoDeFlags } from '../proyecto.js';
|
|
3
4
|
// koigrid tokens — API tokens por API (AI-first): mintear tokens con scopes acotados + expiración + tope de coste.
|
|
4
5
|
// Anti-escalada: no puedes crear uno con más scopes que el tuyo.
|
|
5
6
|
// koigrid tokens ls
|
|
@@ -23,13 +24,16 @@ export async function tokens(a) {
|
|
|
23
24
|
body.expiresInSeconds = Number(a.flags.expires);
|
|
24
25
|
if (a.flags['max-cost'] !== undefined)
|
|
25
26
|
body.maxCostCents = Number(a.flags['max-cost']);
|
|
26
|
-
|
|
27
|
-
body.projectId = String(a.flags.project);
|
|
27
|
+
Object.assign(body, proyectoDeFlags(a));
|
|
28
28
|
const r = await api('/tokens', { method: 'POST', body });
|
|
29
29
|
if (json)
|
|
30
30
|
return console.log(JSON.stringify(r, null, 2));
|
|
31
31
|
console.log(green(`✓ Token "${name}" created — copy it now, it won't be shown again:`));
|
|
32
|
-
|
|
32
|
+
console.log(r.token?.token || '');
|
|
33
|
+
// A stderr: el token sigue saliendo solo en stdout (`TOKEN=$(koigrid tokens create …)` no se rompe).
|
|
34
|
+
for (const w of r.warnings || [])
|
|
35
|
+
console.error(`⚠ ${w}`);
|
|
36
|
+
return;
|
|
33
37
|
}
|
|
34
38
|
if (sub === 'rm' || sub === 'delete' || sub === 'revoke') {
|
|
35
39
|
const id = a.positionals[0];
|
package/dist/commands/up.js
CHANGED
|
@@ -3,7 +3,7 @@ import { parse as parseYaml } from 'yaml';
|
|
|
3
3
|
import { api } from '../api.js';
|
|
4
4
|
import { output, green, dim } from '../output.js';
|
|
5
5
|
// koigrid up / koigrid plan — cutover multi-servicio. Lee un koigrid.yaml (o .json) que declara el STACK entero
|
|
6
|
-
// (project + databases + redis + apps cableados por ${{...}}) y lo levanta en un comando (idempotente). docs/CUTOVER.md
|
|
6
|
+
// (project + databases + redis + apps cableados por ${{...}}) y lo levanta en un comando (idempotente). docs/runbooks/CUTOVER.md
|
|
7
7
|
// koigrid up (aplica koigrid.yaml/koigrid.json del directorio actual)
|
|
8
8
|
// koigrid up -f stack.yaml
|
|
9
9
|
// koigrid plan (dry-run: qué crearía/actualizaría, sin tocar nada)
|
|
@@ -24,7 +24,11 @@ function loadManifest(a) {
|
|
|
24
24
|
function render(a, r, verb) {
|
|
25
25
|
if (a.flags.json)
|
|
26
26
|
return console.log(JSON.stringify(r, null, 2));
|
|
27
|
-
|
|
27
|
+
// Muestra SIEMPRE qué pasa con el proyecto (journey Vence BUG#1): reutiliza uno existente vs CREA uno nuevo. Un
|
|
28
|
+
// "CREARÁ (nuevo)" en un cutover que esperabas reutilizar = la señal de que algo no cuadra ANTES de aplicar.
|
|
29
|
+
const paLabel = { exists: 'reutiliza el existente', created: 'CREADO (nuevo)', 'plan-noop': 'reutiliza el existente', 'plan-create': 'CREARÁ uno NUEVO' };
|
|
30
|
+
const pa = paLabel[String(r.projectAction)] ?? String(r.projectAction ?? '');
|
|
31
|
+
console.log(green(`${verb}: proyecto '${r.project}' (${String(r.projectId || '—').slice(0, 8)}) — ${pa}`));
|
|
28
32
|
output(r.resources || [], false, {
|
|
29
33
|
rows: (r.resources || []).map((x) => ({
|
|
30
34
|
kind: x.kind, name: x.name, action: x.action, id: x.id ? String(x.id).slice(0, 8) : '—', deploy: x.deploymentId ? String(x.deploymentId).slice(0, 8) : '—',
|
package/dist/commands/waf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
-
// koigrid waf — Firewall/WAF (reglas allow/block + evaluate). Ver docs/FIREWALL.md.
|
|
3
|
+
// koigrid waf — Firewall/WAF (reglas allow/block + evaluate). Ver docs/products/FIREWALL.md.
|
|
4
4
|
export async function waf(a) {
|
|
5
5
|
const json = !!a.flags.json;
|
|
6
6
|
const sub = a.sub || 'rules';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green, bold } from '../output.js';
|
|
3
|
-
// koigrid webhooks — webhooks salientes (eventos → tu URL, firmados + reintentos). Ver docs/WEBHOOKS.md.
|
|
3
|
+
// koigrid webhooks — webhooks salientes (eventos → tu URL, firmados + reintentos). Ver docs/products/WEBHOOKS.md.
|
|
4
4
|
export async function webhooks(a) {
|
|
5
5
|
const json = !!a.flags.json;
|
|
6
6
|
const sub = a.sub || 'ls';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
+
import { proyectoDeFlags } from '../proyecto.js';
|
|
3
4
|
// koigrid wp — Managed WordPress: cuentas (contenedor OLS, WP ilimitados) + 1-click install + WP-CLI por API.
|
|
4
|
-
// Ver docs/WORDPRESS-HOSTING-PLAN.md.
|
|
5
|
+
// Ver docs/products/WORDPRESS-HOSTING-PLAN.md.
|
|
5
6
|
export async function wordpress(a) {
|
|
6
7
|
const json = !!a.flags.json;
|
|
7
8
|
const sub = a.sub || 'accounts';
|
|
@@ -14,8 +15,8 @@ export async function wordpress(a) {
|
|
|
14
15
|
if (sub === 'create') {
|
|
15
16
|
const slug = a.positionals[0];
|
|
16
17
|
if (!slug)
|
|
17
|
-
throw new Error('usage: koigrid wp create <slug> --name "My hosting" [--plan pro] [--php 8.2]');
|
|
18
|
-
const body = { slug, name: String(a.flags.name || slug) };
|
|
18
|
+
throw new Error('usage: koigrid wp create <slug> --name "My hosting" [--plan pro] [--php 8.2] [--project <id>]');
|
|
19
|
+
const body = { slug, name: String(a.flags.name || slug), ...proyectoDeFlags(a) };
|
|
19
20
|
if (a.flags.plan)
|
|
20
21
|
body.planTier = String(a.flags.plan);
|
|
21
22
|
if (a.flags.php)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { api } from '../api.js';
|
|
2
2
|
import { output, green } from '../output.js';
|
|
3
|
-
|
|
3
|
+
import { proyectoDeFlags } from '../proyecto.js';
|
|
4
|
+
// koigrid workflows — durable execution (vs Step Functions/Temporal/Inngest): pasos + runs durables. docs/products/WORKFLOWS.md.
|
|
4
5
|
export async function workflows(a) {
|
|
5
6
|
const json = !!a.flags.json;
|
|
6
7
|
const sub = a.sub || 'ls';
|
|
@@ -14,8 +15,8 @@ export async function workflows(a) {
|
|
|
14
15
|
const name = a.positionals[0];
|
|
15
16
|
const steps = a.flags.steps ? String(a.flags.steps).split(',').map((s) => s.trim()).filter(Boolean) : [];
|
|
16
17
|
if (!name || !steps.length)
|
|
17
|
-
throw new Error('usage: koigrid workflows create <name> --steps step1,step2,step3');
|
|
18
|
-
const body = { name, steps };
|
|
18
|
+
throw new Error('usage: koigrid workflows create <name> --steps step1,step2,step3 [--project <id>]');
|
|
19
|
+
const body = { name, steps, ...proyectoDeFlags(a) };
|
|
19
20
|
if (a.flags['max-attempts'])
|
|
20
21
|
body.maxAttempts = Number(a.flags['max-attempts']);
|
|
21
22
|
if (a.flags['step-timeout'])
|
package/dist/esperar.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// cli/src/esperar.ts — `koigrid apps deploy` ESPERA al desenlace del despliegue (ficha f76082de).
|
|
2
|
+
// Antes volvía en cuanto el despliegue empezaba, sin URL ni resultado: un agente LLM que mudaba una app de Heroku (24-nov)
|
|
3
|
+
// tuvo que sondear GET /apps/:id/deployments a mano para saber si había terminado. Como `vercel deploy`, `railway up` o
|
|
4
|
+
// `fly deploy`: se espera, se enseña cada cambio de estado y se termina con la URL, o con el error y el final del registro.
|
|
5
|
+
// `--no-wait` vuelve al momento. La salida `--json` (guiones) sigue volviendo al momento salvo con `--wait`.
|
|
6
|
+
// La lectura (red), el reloj y la espera se inyectan: la decisión se prueba sin red (esperar.test.ts).
|
|
7
|
+
/** Estados en curso de un despliegue: cualquier otro es su desenlace (live, failed, superseded…). */
|
|
8
|
+
export const EN_CURSO = ['queued', 'building', 'deploying'];
|
|
9
|
+
export async function esperarDesenlace(o) {
|
|
10
|
+
const hasta = o.ahora() + o.plazoMs;
|
|
11
|
+
let ultimo;
|
|
12
|
+
let estado = '';
|
|
13
|
+
for (;;) {
|
|
14
|
+
// Un fallo de red al leer no es el desenlace: se reintenta hasta el plazo.
|
|
15
|
+
const d = await o.leer().catch(() => undefined);
|
|
16
|
+
if (d) {
|
|
17
|
+
ultimo = d;
|
|
18
|
+
if (d.status !== estado) {
|
|
19
|
+
estado = d.status;
|
|
20
|
+
o.alCambiar?.(estado);
|
|
21
|
+
}
|
|
22
|
+
if (!EN_CURSO.includes(d.status))
|
|
23
|
+
return { final: d, agotado: false };
|
|
24
|
+
}
|
|
25
|
+
if (o.ahora() >= hasta)
|
|
26
|
+
return { final: ultimo, agotado: true };
|
|
27
|
+
await o.dormir(o.cadaMs ?? 3000);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** Las últimas `n` líneas no vacías de un registro (lo que se enseña cuando falla). */
|
|
31
|
+
export function finalDelRegistro(logs, n = 25) {
|
|
32
|
+
return String(logs ?? '').split('\n').filter((l) => l.trim()).slice(-n).join('\n');
|
|
33
|
+
}
|
|
34
|
+
/** ¿Se espera? Personas y agentes, sí por defecto; `--json` (guiones), sólo con `--wait`; `--no-wait` nunca. */
|
|
35
|
+
export function debeEsperar(flags, json) {
|
|
36
|
+
if (flags['no-wait'] || flags.detach)
|
|
37
|
+
return false;
|
|
38
|
+
if (flags.wait)
|
|
39
|
+
return true;
|
|
40
|
+
return !json;
|
|
41
|
+
}
|
package/dist/help.js
CHANGED
|
@@ -5,7 +5,7 @@ export function buildHelp() {
|
|
|
5
5
|
const label = c.name + (c.subs.length ? ` <${c.subs.join('|')}>` : '');
|
|
6
6
|
return ` ${label.padEnd(30)} ${c.summary}`;
|
|
7
7
|
});
|
|
8
|
-
return `koigrid —
|
|
8
|
+
return `koigrid — managed cloud, pay only for what you reserve, from your terminal (or your AI agent).
|
|
9
9
|
|
|
10
10
|
USAGE
|
|
11
11
|
koigrid <command> [subcommand] [args] [--flags]
|
|
@@ -22,3 +22,16 @@ GLOBAL FLAGS
|
|
|
22
22
|
|
|
23
23
|
Everything the CLI does is the koigrid API — an AI agent can run these commands directly.`;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Ayuda de UN comando, o de uno de sus subcomandos si declara su `usage` (ficha f76082de). Sin esto, `koigrid apps deploy
|
|
27
|
+
* --help` enseñaba la ayuda global. null si el comando no existe (entonces vale la global).
|
|
28
|
+
*/
|
|
29
|
+
export function buildCommandHelp(cmd, sub) {
|
|
30
|
+
const c = CLI_COMMANDS.find((x) => x.name === cmd || x.aliases?.includes(cmd));
|
|
31
|
+
if (!c)
|
|
32
|
+
return null;
|
|
33
|
+
if (sub && c.usage?.[sub])
|
|
34
|
+
return c.usage[sub];
|
|
35
|
+
const subs = c.subs.length ? `\n\nSUBCOMMANDS\n ${c.subs.join(' · ')}\n\nRun \`koigrid ${c.name} <subcommand>\` (usage errors list each one's flags).` : '';
|
|
36
|
+
return `koigrid ${c.name} — ${c.summary}${subs}`;
|
|
37
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Entry del CLI. Dispatch data-driven desde el manifest (resolveCommand) + registro de handlers.
|
|
3
3
|
// Añadir un comando = fichero en commands/ + entrada en registry.ts + manifest.ts (los guards lo obligan).
|
|
4
|
-
import { parseArgs } from './args.js';
|
|
5
|
-
import { buildHelp } from './help.js';
|
|
4
|
+
import { parseArgs, vigilarFlags } from './args.js';
|
|
5
|
+
import { buildHelp, buildCommandHelp } from './help.js';
|
|
6
6
|
import { ApiError } from './api.js';
|
|
7
7
|
import { resolveCommand, CLI_COMMANDS } from './manifest.js';
|
|
8
8
|
import { HANDLERS } from './registry.js';
|
|
9
|
-
import { red } from './output.js';
|
|
9
|
+
import { red, yellow } from './output.js';
|
|
10
10
|
import { createRequire } from 'node:module';
|
|
11
11
|
const version = (() => { try {
|
|
12
12
|
return createRequire(import.meta.url)('../package.json').version;
|
|
@@ -16,13 +16,17 @@ catch {
|
|
|
16
16
|
} })();
|
|
17
17
|
async function main() {
|
|
18
18
|
const a = parseArgs(process.argv.slice(2));
|
|
19
|
+
const vigia = vigilarFlags(a.flags);
|
|
20
|
+
a.flags = vigia.flags;
|
|
19
21
|
if (a.flags.version || a.flags.v) {
|
|
20
22
|
console.log(version);
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
25
|
// Ayuda humana, o `help --json` → manifest completo para que un AGENTE IA introspeccione TODO el CLI.
|
|
24
26
|
if (!a.cmd || a.cmd === 'help' || a.flags.help || a.flags.h) {
|
|
25
|
-
|
|
27
|
+
// `koigrid <cmd> [sub] --help`: la ayuda de ese comando o subcomando (ficha f76082de); sin comando, la global.
|
|
28
|
+
const propia = a.cmd && a.cmd !== 'help' && !a.flags.json ? buildCommandHelp(a.cmd, a.sub) : null;
|
|
29
|
+
console.log(a.flags.json ? JSON.stringify(CLI_COMMANDS, null, 2) : propia ?? buildHelp());
|
|
26
30
|
return;
|
|
27
31
|
}
|
|
28
32
|
if (typeof a.flags.token === 'string')
|
|
@@ -34,11 +38,27 @@ async function main() {
|
|
|
34
38
|
console.error(red(`Unknown command: ${a.cmd}`) + `\nRun \`koigrid --help\`.`);
|
|
35
39
|
process.exit(1);
|
|
36
40
|
}
|
|
37
|
-
|
|
41
|
+
try {
|
|
42
|
+
await HANDLERS[name](a);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
// Pase lo que pase, se dice qué flags no usó este comando (por stderr: no ensucia una salida --json).
|
|
46
|
+
const ignorados = vigia.sinLeer();
|
|
47
|
+
if (ignorados.length)
|
|
48
|
+
console.error(yellow(`⚠ ignored (this command doesn't use them): ${ignorados.map((f) => (f.length === 1 ? `-${f}` : `--${f}`)).join(' ')}`));
|
|
49
|
+
}
|
|
38
50
|
}
|
|
39
51
|
main().catch((e) => {
|
|
40
52
|
if (e instanceof ApiError) {
|
|
41
|
-
|
|
53
|
+
// El sobre de error de la API (ficha cad2f339): motivo, si se puede reintentar, dónde se explica el código y el
|
|
54
|
+
// requestId para citarlo a soporte.
|
|
55
|
+
const b = e.body ?? {};
|
|
56
|
+
const extra = [
|
|
57
|
+
b.retryable === true ? 'retryable: yes (repeating the same command later can work)' : null,
|
|
58
|
+
typeof b.docUrl === 'string' ? `docs: ${b.docUrl}` : null,
|
|
59
|
+
typeof b.requestId === 'string' ? `requestId: ${b.requestId}` : null,
|
|
60
|
+
].filter(Boolean);
|
|
61
|
+
console.error(red(`✗ ${e.message}`) + (e.detail ? `\n ${e.detail}` : '') + (extra.length ? `\n ${extra.join(' · ')}` : ''));
|
|
42
62
|
process.exit(e.status === 401 ? 2 : 1);
|
|
43
63
|
}
|
|
44
64
|
console.error(red(`✗ ${e?.message || e}`));
|
package/dist/manifest.js
CHANGED
|
@@ -3,47 +3,64 @@ export const CLI_COMMANDS = [
|
|
|
3
3
|
{ name: 'logout', summary: 'Remove the stored credentials', subs: [], endpoints: [] },
|
|
4
4
|
{ name: 'whoami', summary: 'Show the authenticated account', subs: [], endpoints: ['me'] },
|
|
5
5
|
{ name: 'usage', summary: 'Show usage & cost', subs: [], endpoints: ['usage'] },
|
|
6
|
+
{ name: 'changelog', aliases: ['changes'], summary: "What changed recently — so you don't have to re-run every test to find out if your issue is fixed", subs: [], endpoints: ['changelog'] },
|
|
7
|
+
{ name: 'pricing', aliases: ['price'], summary: 'The price list (per reserved GB of RAM, vCPU, GB of disk) and a quote of what resources would cost before creating them', subs: ['quote'], endpoints: ['pricing', 'pricing/quote'] },
|
|
6
8
|
{ name: 'projects', aliases: ['project'], summary: 'Projects (group resources within the org)', subs: ['ls', 'create', 'rm'], endpoints: ['projects', 'projects/[id]'] },
|
|
7
9
|
{
|
|
8
10
|
name: 'apps', aliases: ['app'], product: 'apps', summary: 'Deploy and manage apps (git repo, container image, or local --dir)',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
usage: {
|
|
12
|
+
deploy: `koigrid apps deploy <name> --dir <path> | --image <img> | --repo <git-url>
|
|
13
|
+
Source --dir <path> (your folder, no git/Docker needed) · --image <img> · --repo <git-url> [--branch B] [--repo-token T]
|
|
14
|
+
Runtime --port N (default: the image's single EXPOSE port, else 3000; PORT is injected; change later: apps port <id> <n>) · --health-path /health · --memory <MB> · --cpus <n> · --ingress edge|runner
|
|
15
|
+
Build --build-cmd C · --install-cmd C · --start-cmd C · --root-dir D · --node-version V · --dockerfile PATH · --release-cmd C
|
|
16
|
+
Env --env KEY=VALUE (repeatable; references like 'DATABASE_URL=\${{db.<name>.DATABASE_URL}}') · --env-target all|production|preview
|
|
17
|
+
Waiting waits until live or failed and prints the URL or the error with the end of the log (default)
|
|
18
|
+
--no-wait (or --detach) returns at once · --timeout <min> (default 20) · with --json it returns at once unless --wait
|
|
19
|
+
Other --project <id> · --json`,
|
|
20
|
+
},
|
|
21
|
+
subs: ['ls', 'deploy', 'logs', 'http', 'rm', 'rename', 'health-path', 'port', 'release', 'build-settings', 'traffic-ramp', 'max-surge', 'deploy-analysis', 'scale', 'resize', 'autoscale', 'scale-out', 'env', 'domains', 'volumes', 'cdn', 'cache', 'protection', 'retention', 'github', 'hooks', 'rollback', 'pause', 'resume', 'restore', 'migrate', 'deployments', 'previews', 'preview', 'rules', 'rule', 'rule-rm', 'rule-toggle', 'registry', 'loadtest'],
|
|
22
|
+
endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/http', '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', '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'],
|
|
11
23
|
},
|
|
12
|
-
{ name: 'db', aliases: ['databases', 'database'], product: 'databases', summary: 'Managed Postgres (HA) — incl. SQL console (db query/tables) + branching (db branch)', subs: ['ls', 'create', 'rm', 'rename', 'url', 'connect', 'metrics', 'logs', 'backups', 'restore', 'ext', 'replicas', 'pub', 'query', 'tables', 'branch', 'roles', 'rotation', 'data', 'rpc'], endpoints: ['databases', 'databases/[id]', 'databases/[id]/connection', 'databases/[id]/backups', 'databases/[id]/restore', 'databases/[id]/metrics', 'databases/[id]/logs', 'databases/[id]/extensions', 'databases/[id]/replicas', 'databases/[id]/publications', 'databases/[id]/query', 'databases/[id]/branches', 'databases/[id]/branches/[branchId]', 'databases/[id]/branches/[branchId]/reset', 'databases/[id]/roles', 'databases/[id]/roles/[roleName]', 'databases/[id]/rotation', 'databases/[id]/rotation/rotate', 'databases/[id]/rotation/migrate', 'databases/[id]/data/[table]', 'databases/[id]/rpc/[fn]'] },
|
|
13
|
-
{ name: 'redis', aliases: ['cache'], product: 'cache', summary: 'Managed Redis (HA)', subs: ['ls', 'create', 'rm', 'rename', 'url', 'connect', 'metrics', 'backups', 'restore'], endpoints: ['redis', 'redis/[id]', 'redis/[id]/connection', 'redis/[id]/backups', 'redis/[id]/restore', 'redis/[id]/metrics'] },
|
|
14
|
-
{ name: 'storage', aliases: ['buckets'], product: 'storage', summary: 'Object storage (S3): buckets, object browser (list/upload/download/delete), versioning + restore', subs: ['ls', 'create', 'rm', 'keys', 'key', 'versions', 'restore', 'objects', 'upload-url', 'download-url', 'object-rm'], endpoints: ['buckets', 'buckets/[id]', 'buckets/[id]/versions', 'buckets/[id]/objects', 'buckets/[id]/objects/upload-url', 'buckets/[id]/objects/download-url', 'storage/keys', 'storage/keys/[id]'] },
|
|
24
|
+
{ 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', 'top-queries', 'slots', 'logs', 'backups', 'restore', 'restore-dump', 'fix-ownership', 'analyze', 'import', 'restore-status', 'ext', 'replicas', 'dr-copy', 'network', '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]/queries', 'databases/[id]/replication-slots', 'databases/[id]/logs', 'databases/[id]/extensions', 'databases/[id]/replicas', 'databases/[id]/dr-copy', 'databases/[id]/network', '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]'] },
|
|
25
|
+
{ 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'], endpoints: ['redis/[id]/apply-config', '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'] },
|
|
26
|
+
{ name: 'storage', aliases: ['buckets'], product: 'storage', summary: 'Object storage (S3): buckets, object browser (list/upload/download/delete), versioning + restore, public read (storage public)', subs: ['ls', 'create', 'rm', 'keys', 'key', 'key-scope', 'versions', 'restore', 'objects', 'upload-url', 'download-url', 'object-rm', 'replication', 'public'], endpoints: ['buckets', 'buckets/[id]', 'buckets/[id]/versions', 'buckets/[id]/objects', 'buckets/[id]/objects/upload-url', 'buckets/[id]/objects/download-url', 'buckets/[id]/public', 'storage/keys', 'storage/keys/[id]', 'storage/keys/[id]/scope'] },
|
|
15
27
|
{ name: 'jobs', aliases: ['cron'], product: 'jobs', summary: 'Cron / scheduled jobs', subs: ['ls', 'create', 'update', 'rm', 'trigger', 'runs'], endpoints: ['jobs', 'jobs/[id]', 'jobs/[id]/runs', 'jobs/[id]/trigger'] },
|
|
16
28
|
{ name: 'events', aliases: ['activity'], product: 'observability', summary: 'Events and metrics', subs: ['ls', 'metrics'], endpoints: ['events', 'metrics'] },
|
|
29
|
+
{ name: 'links', aliases: ['link'], product: 'links', summary: 'Short links + QR (create, retarget, retire)', subs: ['ls', 'create', 'update', 'rm'], endpoints: ['links', 'links/[id]'] },
|
|
30
|
+
{ name: 'share', aliases: ['files'], product: 'share', summary: 'Share files behind an expiring link', subs: ['ls', 'upload', 'rm'], endpoints: ['share', 'share/[id]'] },
|
|
17
31
|
{ name: 'alarms', product: 'observability', summary: 'Metric alarms', subs: ['ls', 'create', 'rm'], endpoints: ['alarms', 'alarms/[id]'] },
|
|
18
32
|
{ name: 'anomalies', aliases: ['anomaly'], product: 'observability', summary: 'Anomaly detection (statistical >Nσ spike alerts on cost/usage — no fixed threshold)', subs: ['ls', 'create', 'rm'], endpoints: ['anomalies', 'anomalies/[id]'] },
|
|
19
33
|
{ name: 'tokens', aliases: ['token', 'keys'], summary: 'API tokens (mint scoped/expiring tokens by API — AI-native; no scope escalation)', subs: ['ls', 'create', 'rm'], endpoints: ['tokens', 'tokens/[id]'] },
|
|
20
|
-
{ name: 'notifications', aliases: ['notify'], summary: 'Notification preferences (which alert categories you get by email: alarms/anomalies/spend)', subs: ['ls', 'set'], endpoints: ['notifications/preferences'] },
|
|
34
|
+
{ name: 'notifications', aliases: ['notify'], summary: 'Notification preferences (which alert categories you get by email: alarms/anomalies/spend/jobs/heartbeats/checks/deploys/maintenance)', subs: ['ls', 'set'], endpoints: ['notifications/preferences'] },
|
|
35
|
+
{ name: 'notices', summary: 'In-app notices (the dashboard bell) and how many support conversations have an unread reply', subs: ['ls', 'read'], endpoints: ['notices', 'notices/read'] },
|
|
36
|
+
{ name: 'support', summary: 'Talk to the koigrid team and read their replies (support/feedback conversations)', subs: ['ls', 'open', 'show', 'reply'], endpoints: ['support', 'support/[id]', 'support/[id]/read', 'support/[id]/messages'] },
|
|
21
37
|
{ name: 'connect', summary: 'Connect: agent credential broker — a grant mints only ephemeral, scope-limited tokens (STS-style)', subs: ['ls', 'grants', 'create', 'update', 'rm', 'token'], endpoints: ['connect/grants', 'connect/grants/[id]', 'connect/token'] },
|
|
22
|
-
{ name: 'rewards', product: 'rewards', summary: 'Rewards: earn
|
|
38
|
+
{ name: 'rewards', product: 'rewards', summary: 'Rewards: earn koigrid credit for using koigrid + feedback (credit only, applied to your bill)', subs: ['ls', 'lines', 'referral', 'submit', 'redeem', 'beta'], endpoints: ['rewards', 'rewards/lines', 'rewards/referral', 'rewards/redeem', 'rewards/submissions/[id]/review', 'rewards/beta', 'rewards/beta/apply', 'rewards/beta/feedback', 'rewards/beta/feedback-month', 'rewards/beta/agent-log', 'rewards/beta/wallet', 'rewards/beta/payout', 'rewards/beta/applications', 'rewards/beta/applications/[id]/review', 'rewards/crypto-payouts/[id]/sent'] },
|
|
23
39
|
{ name: 'wp', aliases: ['wordpress'], product: 'wordpress', summary: 'Managed WordPress: hosting accounts (OLS container, unlimited sites) + 1-click install + WP-CLI by API', subs: ['accounts', 'create', 'account', 'rm', 'sites', 'install', 'site', 'uninstall', 'cli', 'backups', 'backup', 'domains', 'domain-add', 'domain-check', 'domain-activate', 'domain-rm'], endpoints: ['wordpress/accounts', 'wordpress/accounts/[id]', 'wordpress/accounts/[id]/sites', 'wordpress/sites/[id]', 'wordpress/sites/[id]/wp-cli', 'wordpress/sites/[id]/backups', 'wordpress/sites/[id]/domains', 'wordpress/domains/[id]'] },
|
|
24
40
|
{ name: 'email', product: 'email', summary: 'Transactional email', subs: ['send', 'messages', 'config'], endpoints: ['email/send', 'email/messages', 'email/config'] },
|
|
25
41
|
{ name: 'checks', aliases: ['check', 'monitoring'], product: 'checks', summary: 'Uptime & synthetic monitoring (URL/API checks + alerts)', subs: ['ls', 'create', 'update', 'rm', 'run', 'runs'], endpoints: ['checks', 'checks/[id]', 'checks/[id]/run', 'checks/[id]/runs'] },
|
|
26
|
-
{ name: 'members', aliases: ['team'], summary: 'Team members & invitations (invite, roles, remove)', subs: ['ls', 'invite', 'role', 'rm', 'revoke'], endpoints: ['members', 'members/[userId]', 'members/invitations/[id]'] },
|
|
27
|
-
{ name: 'flags', aliases: ['flag'], product: 'flags', summary: 'Feature flags (toggle + rollout + targeting)', subs: ['ls', 'create', 'enable', 'disable', 'rollout', 'target', 'rm', 'eval'], endpoints: ['flags', 'flags/[key]', 'flags/evaluate'] },
|
|
42
|
+
{ name: 'members', aliases: ['team'], summary: 'Team members & invitations (invite, roles, remove)', subs: ['2fa', 'ls', 'invite', 'role', 'rm', 'revoke'], endpoints: ['members/two-factor', 'members', 'members/[userId]', 'members/invitations/[id]'] },
|
|
43
|
+
{ name: 'flags', aliases: ['flag'], product: 'flags', summary: 'Feature flags (toggle + rollout + targeting + variants)', subs: ['ls', 'create', 'enable', 'disable', 'rollout', 'target', 'variants', 'rm', 'eval'], endpoints: ['flags', 'flags/[key]', 'flags/evaluate'] },
|
|
44
|
+
{ name: 'experiments', aliases: ['exp'], product: 'flags', summary: 'A/B experiments on multivariate flags (hypothesis, metric and sample fixed before starting)', subs: ['ls', 'create', 'show', 'edit', 'start', 'stop', 'decide', 'expose', 'convert', 'results', 'rm'], endpoints: ['experiments', 'experiments/[key]', 'experiments/[key]/start', 'experiments/[key]/stop', 'experiments/[key]/decide', 'experiments/[key]/exposures', 'experiments/[key]/conversions', 'experiments/[key]/results'] },
|
|
28
45
|
{ name: 'status', aliases: ['statuspage', 'statuspages'], product: 'status', summary: 'Public status pages (from your Checks) + incidents/maintenance', subs: ['ls', 'create', 'update', 'rm', 'incidents', 'incident', 'resolve'], endpoints: ['status-pages', 'status-pages/[id]', 'status-pages/[id]/incidents', 'status-pages/[id]/incidents/[incidentId]'] },
|
|
29
46
|
{ name: 'heartbeats', aliases: ['heartbeat', 'hb'], product: 'heartbeats', summary: 'Cron monitoring / dead-man’s switch (ping a URL; alert if silent)', subs: ['ls', 'create', 'update', 'rm'], endpoints: ['heartbeats', 'heartbeats/[id]'] },
|
|
30
47
|
{ name: 'config', aliases: ['secrets', 'secret'], product: 'config', summary: 'Project config/secrets (shared, encrypted) — pull it into your app, or run a local process with it injected', subs: ['ls', 'set', 'rm', 'pull', 'run'], endpoints: ['config', 'config/pull', 'config/[key]'] },
|
|
31
48
|
{ name: 'analytics', product: 'analytics', summary: 'Privacy-first web analytics (no cookies)', subs: ['sites', 'create', 'stats', 'rm'], endpoints: ['analytics/sites', 'analytics/sites/[id]', 'analytics/sites/[id]/stats'] },
|
|
32
49
|
{ name: 'errors', aliases: ['error'], product: 'errors', summary: 'Error tracking (capture exceptions, group by fingerprint)', subs: ['ls', 'token', 'resolve', 'reopen', 'rm'], endpoints: ['errors', 'errors/groups/[id]'] },
|
|
33
50
|
{ name: 'speed', aliases: ['vitals'], product: 'speed-insights', summary: 'Speed Insights (Core Web Vitals: LCP/CLS/FCP/TTFB)', subs: ['ls'], endpoints: ['speed-insights', 'speed-insights/[id]'] },
|
|
34
|
-
{ name: 'sandboxes', aliases: ['sandbox', 'sb'], product: 'sandboxes', summary: 'Ephemeral
|
|
35
|
-
{ name: 'ai', product: 'ai-gateway', summary: 'AI Gateway — unified LLM chat with BYO keys + usage tracking', subs: ['chat', 'providers', 'usage'], endpoints: ['ai/chat', 'ai/providers', 'ai/providers/[name]', 'ai/usage'] },
|
|
51
|
+
{ name: 'sandboxes', aliases: ['sandbox', 'sb'], product: 'sandboxes', summary: 'Ephemeral runs (image+command once) and persistent agent VMs (sandboxes vm …: pause with memory, fork, exec, ssh, environment, VM-scoped tokens)', subs: ['run', 'ls', 'get', 'vm'], endpoints: ['sandboxes', 'sandboxes/[id]', 'sandboxes/vms', 'sandboxes/vms/[id]', 'sandboxes/vms/[id]/exec', 'sandboxes/vms/[id]/pause', 'sandboxes/vms/[id]/resume', 'sandboxes/vms/[id]/stop', 'sandboxes/vms/[id]/start', 'sandboxes/vms/[id]/fork', 'sandboxes/vms/[id]/ssh-keys', 'sandboxes/vms/[id]/environment', 'sandboxes/vms/[id]/tokens', 'sandboxes/vms/[id]/usage', 'sandboxes/vms/limits', 'sandboxes/vms/[id]/snapshots', 'sandboxes/vms/[id]/commands', 'sandboxes/vms/[id]/commands/[cmd]', 'sandboxes/vms/[id]/commands/[cmd]/stream', 'sandboxes/vms/[id]/files', 'sandboxes/vms/[id]/files/content', 'sandboxes/vms/[id]/files/move', 'sandboxes/vms/[id]/files/mkdir', 'sandboxes/vms/[id]/files/chmod', 'sandboxes/vms/[id]/files/replace', 'sandboxes/vms/[id]/files/upload-url', 'sandboxes/vms/[id]/files/upload-complete', 'sandboxes/vms/[id]/files/download-url'] },
|
|
36
52
|
{ name: 'images', aliases: ['image', 'img'], product: 'images', summary: 'Image optimization (resize/re-encode on the fly, allowlisted)', subs: ['config', 'allow', 'usage'], endpoints: ['images/config', 'images/usage'] },
|
|
37
53
|
{ name: 'waf', aliases: ['firewall'], product: 'firewall', summary: 'Firewall/WAF — allow/block rules (IP/country/path…) + evaluate', subs: ['rules', 'add', 'rm', 'evaluate'], endpoints: ['waf/rules', 'waf/rules/[id]', 'waf/evaluate'] },
|
|
38
54
|
{ name: 'webhooks', aliases: ['webhook', 'hooks'], product: 'webhooks', summary: 'Outbound webhooks — platform events → your URL, signed + retried', subs: ['ls', 'create', 'enable', 'disable', 'deliveries', 'rm'], endpoints: ['webhooks', 'webhooks/[id]', 'webhooks/[id]/deliveries'] },
|
|
39
55
|
{ name: 'logs', aliases: ['logdrains', 'log-drains'], product: 'log-drains', summary: 'Log Drains — forward logs to an HTTP/Datadog sink + ingest/query the buffer', subs: ['tail', 'push', 'drains', 'drain-add', 'enable', 'disable', 'drain-rm'], endpoints: ['log-drains', 'log-drains/[id]', 'logs'] },
|
|
56
|
+
{ name: 'billing', aliases: ['plan'], summary: 'Cómo paga la organización (prepago o factura mensual), lo reservado este mes, el monedero prepagado (saldo, recargas, recarga automática, movimientos) y el enlace para guardar una tarjeta', subs: ['show', 'card', 'mode', 'wallet', 'topup', 'auto-topup', 'entries'], endpoints: ['billing', 'billing/checkout-session', 'billing/mode', 'billing/wallet', 'billing/wallet/topup', 'billing/wallet/auto-topup', 'billing/wallet/entries'] },
|
|
40
57
|
{ name: 'spend', aliases: ['budget'], product: 'spend', summary: 'Spend Management — monthly cap + threshold alerts + optional hard stop', subs: ['show', 'set', 'rm'], endpoints: ['spend'] },
|
|
41
58
|
{ name: 'bots', aliases: ['bot'], product: 'bots', summary: 'Bot Management — classify UA + allow/challenge/block + proof-of-work challenge', subs: ['policy', 'set', 'evaluate', 'challenge', 'verify'], endpoints: ['bots/policy', 'bots/evaluate', 'bots/challenge', 'bots/verify'] },
|
|
42
59
|
{ name: 'otel', aliases: ['opentelemetry'], product: 'otel', summary: 'OpenTelemetry export — ship metrics in OTLP to any OTEL backend', subs: ['show', 'set', 'rm'], endpoints: ['otel'] },
|
|
43
60
|
{ name: 'dns', product: 'dns', summary: 'DNS Management (BYO) — connect your zone + CRUD records', subs: ['zones', 'connect', 'disconnect', 'records', 'add', 'update', 'del'], endpoints: ['dns/zones', 'dns/zones/[id]', 'dns/zones/[id]/records', 'dns/zones/[id]/records/[recordId]'] },
|
|
44
61
|
{ name: 'queues', aliases: ['queue', 'sqs'], product: 'queues', summary: 'Queues — durable message queue (SQS-like): send/receive/ack + visibility timeout + dead-letter', subs: ['ls', 'create', 'show', 'update', 'send', 'receive', 'ack', 'rm'], endpoints: ['queues', 'queues/[id]', 'queues/[id]/messages', 'queues/[id]/receive', 'queues/[id]/ack'] },
|
|
45
62
|
{ name: 'workflows', aliases: ['workflow', 'wf'], product: 'workflows', summary: 'Workflows — durable execution (Step-Functions-like): ordered steps + journal + durable sleep + retries', subs: ['ls', 'create', 'rm', 'update', 'start', 'runs', 'run', 'next', 'complete', 'fail', 'sleep'], endpoints: ['workflows', 'workflows/[id]', 'workflows/[id]/runs', 'workflows/[id]/runs/[runId]', 'workflows/[id]/runs/[runId]/next', 'workflows/[id]/runs/[runId]/complete', 'workflows/[id]/runs/[runId]/fail', 'workflows/[id]/runs/[runId]/sleep'] },
|
|
46
|
-
{ name: 'registry', aliases: ['ecr', 'cr'], product: 'container-registry', summary: 'Container Registry (OCI, ECR-like) — docker push/pull; list repos + tags (digest/size/pushed)', subs: ['repos', 'tags', 'login'], endpoints: ['registry/repositories', 'registry/repositories/[name]/tags'] },
|
|
63
|
+
{ name: 'registry', aliases: ['ecr', 'cr'], product: 'container-registry', summary: 'Container Registry (OCI, ECR-like) — docker push/pull; list repos + tags (digest/size/pushed); CVE scan (Trivy)', subs: ['repos', 'tags', 'rm-tag', 'gc', 'login', 'scan', 'policy'], endpoints: ['registry/repositories', 'registry/repositories/[name]/tags', 'registry/repositories/[name]/policy', 'registry/repositories/[name]/tags/[tag]', 'registry/gc'] },
|
|
47
64
|
{ name: 'audit', aliases: ['audit-log', 'cloudtrail'], product: 'audit', summary: 'Audit Log — who did what (security/config changes), with IP + CSV export (owner/admin only)', subs: ['ls', 'export'], endpoints: ['audit', 'audit/export'] },
|
|
48
65
|
{ name: 'up', aliases: ['apply', 'cutover'], summary: 'Cutover manifest — bring up a WHOLE stack (apps+db+redis, wired by ${{...}}) from koigrid.yaml in one command', subs: [], endpoints: ['manifest'] },
|
|
49
66
|
{ name: 'plan', summary: 'Dry-run a cutover manifest (koigrid.yaml): what would be created/updated, without mutating', subs: [], endpoints: ['manifest/plan'] },
|
package/dist/output.js
CHANGED
|
@@ -3,6 +3,7 @@ const c = (n, s) => (process.stdout.isTTY ? `\x1b[${n}m${s}\x1b[0m` : s);
|
|
|
3
3
|
export const dim = (s) => c(2, s);
|
|
4
4
|
export const green = (s) => c(32, s);
|
|
5
5
|
export const red = (s) => c(31, s);
|
|
6
|
+
export const yellow = (s) => c(33, s);
|
|
6
7
|
export const bold = (s) => c(1, s);
|
|
7
8
|
/** Tabla alineada de filas (objetos con las mismas claves). PURA. */
|
|
8
9
|
export function formatTable(rows, columns) {
|
package/dist/proyecto.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function credencialRegistryDeFlags(a) {
|
|
2
|
+
const registry = a.flags.registry;
|
|
3
|
+
const registryUsername = a.flags['registry-user'];
|
|
4
|
+
const registryPassword = a.flags['registry-password'];
|
|
5
|
+
const registryAwsRegion = a.flags['registry-aws-region'];
|
|
6
|
+
const registryAwsAccessKeyId = a.flags['registry-aws-key'];
|
|
7
|
+
const registryAwsSecretKey = a.flags['registry-aws-secret'];
|
|
8
|
+
if (registry && registryUsername && registryPassword)
|
|
9
|
+
return { registry, registryUsername, registryPassword };
|
|
10
|
+
if (registry && registryAwsRegion && registryAwsAccessKeyId && registryAwsSecretKey)
|
|
11
|
+
return { registry, registryAwsRegion, registryAwsAccessKeyId, registryAwsSecretKey };
|
|
12
|
+
if (registry || registryUsername || registryPassword || registryAwsRegion || registryAwsAccessKeyId || registryAwsSecretKey) {
|
|
13
|
+
throw new Error('incomplete registry credentials: --registry with (--registry-user + --registry-password) or (--registry-aws-region + --registry-aws-key + --registry-aws-secret)');
|
|
14
|
+
}
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
export const AYUDA_REGISTRY = '[--registry <host> (--registry-user <u> --registry-password <p> | --registry-aws-region <r> --registry-aws-key <k> --registry-aws-secret <s>)]';
|
package/dist/registry.js
CHANGED
|
@@ -7,11 +7,15 @@ import { jobs } from './commands/jobs.js';
|
|
|
7
7
|
import { events } from './commands/events.js';
|
|
8
8
|
import { email } from './commands/email.js';
|
|
9
9
|
import { alarms } from './commands/alarms.js';
|
|
10
|
+
import { links, share } from './commands/links.js';
|
|
10
11
|
import { usage } from './commands/usage.js';
|
|
12
|
+
import { changelog } from './commands/changelog.js';
|
|
13
|
+
import { pricing } from './commands/pricing.js';
|
|
11
14
|
import { projects } from './commands/projects.js';
|
|
12
15
|
import { checks } from './commands/checks.js';
|
|
13
16
|
import { members } from './commands/members.js';
|
|
14
17
|
import { flags } from './commands/flags.js';
|
|
18
|
+
import { experiments } from './commands/experiments.js';
|
|
15
19
|
import { status } from './commands/status.js';
|
|
16
20
|
import { heartbeats } from './commands/heartbeats.js';
|
|
17
21
|
import { config } from './commands/config.js';
|
|
@@ -19,12 +23,12 @@ import { analytics } from './commands/analytics.js';
|
|
|
19
23
|
import { errors } from './commands/errors.js';
|
|
20
24
|
import { speed } from './commands/speed.js';
|
|
21
25
|
import { sandboxes } from './commands/sandboxes.js';
|
|
22
|
-
import { ai } from './commands/ai.js';
|
|
23
26
|
import { images } from './commands/images.js';
|
|
24
27
|
import { waf } from './commands/waf.js';
|
|
25
28
|
import { webhooks } from './commands/webhooks.js';
|
|
26
29
|
import { logs } from './commands/logs.js';
|
|
27
30
|
import { spend } from './commands/spend.js';
|
|
31
|
+
import { billing } from './commands/billing.js';
|
|
28
32
|
import { bots } from './commands/bots.js';
|
|
29
33
|
import { otel } from './commands/otel.js';
|
|
30
34
|
import { dns } from './commands/dns.js';
|
|
@@ -36,6 +40,8 @@ import { audit } from './commands/audit.js';
|
|
|
36
40
|
import { anomalies } from './commands/anomalies.js';
|
|
37
41
|
import { tokens } from './commands/tokens.js';
|
|
38
42
|
import { notifications } from './commands/notifications.js';
|
|
43
|
+
import { notices } from './commands/notices.js';
|
|
44
|
+
import { support } from './commands/support.js';
|
|
39
45
|
import { connect } from './commands/connect.js';
|
|
40
46
|
import { rewards } from './commands/rewards.js';
|
|
41
47
|
import { up, plan } from './commands/up.js';
|
|
@@ -43,5 +49,5 @@ export const HANDLERS = {
|
|
|
43
49
|
login: (a) => auth.login(a.flags),
|
|
44
50
|
logout: () => auth.logout(),
|
|
45
51
|
whoami: (a) => auth.whoami(!!a.flags.json),
|
|
46
|
-
usage, projects, apps, db, redis, storage, jobs, events, alarms, email, checks, members, flags, status, heartbeats, config, analytics, errors, speed, sandboxes,
|
|
52
|
+
usage, changelog, pricing, billing, projects, apps, links, share, db, redis, storage, jobs, events, alarms, email, checks, members, flags, experiments, status, heartbeats, config, analytics, errors, speed, sandboxes, images, waf, webhooks, logs, spend, bots, otel, dns, queues, workflows, registry, audit, anomalies, tokens, notifications, notices, support, connect, rewards, up, plan, wp: wordpress,
|
|
47
53
|
};
|
package/package.json
CHANGED
package/dist/commands/ai.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { api } from '../api.js';
|
|
2
|
-
import { output, green } from '../output.js';
|
|
3
|
-
// koigrid ai — AI Gateway (chat unificado a LLMs, BYO keys). Ver docs/AI-GATEWAY.md.
|
|
4
|
-
export async function ai(a) {
|
|
5
|
-
const json = !!a.flags.json;
|
|
6
|
-
const sub = a.sub || 'usage';
|
|
7
|
-
if (sub === 'chat') {
|
|
8
|
-
const model = a.positionals[0];
|
|
9
|
-
// prompt como posicional (koigrid ai chat <model> "hi") o vía --message/--prompt
|
|
10
|
-
const message = (a.positionals[1] || a.flags.message || a.flags.prompt);
|
|
11
|
-
if (!model || !message)
|
|
12
|
-
throw new Error('usage: koigrid ai chat <model> "your prompt" (or --message "…")');
|
|
13
|
-
const r = await api('/ai/chat', { method: 'POST', body: { model, messages: [{ role: 'user', content: message }] } });
|
|
14
|
-
if (json)
|
|
15
|
-
return console.log(JSON.stringify(r, null, 2));
|
|
16
|
-
console.log(r.content);
|
|
17
|
-
console.log(green(`\n— ${r.provider}/${r.model} · ${r.usage?.promptTokens}+${r.usage?.completionTokens} tok · ${r.runner}`));
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (sub === 'providers' || sub === 'provider') {
|
|
21
|
-
const act = a.positionals[0];
|
|
22
|
-
if (!act || act === 'ls') {
|
|
23
|
-
const r = await api('/ai/providers');
|
|
24
|
-
const l = r.providers || [];
|
|
25
|
-
return output(l, json, { rows: l.map((x) => ({ name: x.name, configured: x.configuredAt ? 'yes' : '' })), columns: ['name', 'configured'] });
|
|
26
|
-
}
|
|
27
|
-
if (act === 'set') {
|
|
28
|
-
const name = a.positionals[1], key = a.positionals[2];
|
|
29
|
-
if (!name || !key)
|
|
30
|
-
throw new Error('usage: koigrid ai providers set <openai|anthropic> <API_KEY>');
|
|
31
|
-
await api('/ai/providers', { method: 'POST', body: { name, apiKey: key } });
|
|
32
|
-
return console.log(green(`✓ ${name} key saved (encrypted)`));
|
|
33
|
-
}
|
|
34
|
-
if (act === 'rm') {
|
|
35
|
-
const name = a.positionals[1];
|
|
36
|
-
if (!name)
|
|
37
|
-
throw new Error('need <name>');
|
|
38
|
-
await api(`/ai/providers/${encodeURIComponent(name)}`, { method: 'DELETE' });
|
|
39
|
-
return console.log(green(`✓ Removed ${name}`));
|
|
40
|
-
}
|
|
41
|
-
throw new Error('usage: koigrid ai providers ls | set <name> <key> | rm <name>');
|
|
42
|
-
}
|
|
43
|
-
// usage
|
|
44
|
-
const days = a.flags.days ? Number(a.flags.days) : 30;
|
|
45
|
-
const r = await api(`/ai/usage?days=${days}`);
|
|
46
|
-
if (json)
|
|
47
|
-
return console.log(JSON.stringify(r, null, 2));
|
|
48
|
-
const t = r.usage?.total || {};
|
|
49
|
-
console.log(`Requests: ${t.requests} Tokens: ${t.promptTokens}+${t.completionTokens} Cost: ${((t.costMicroCents || 0) / 1e6).toFixed(4)}¢ (last ${days}d)`);
|
|
50
|
-
const byModel = r.usage?.byModel || [];
|
|
51
|
-
if (byModel.length) {
|
|
52
|
-
console.log('\nBy model:');
|
|
53
|
-
for (const m of byModel)
|
|
54
|
-
console.log(` ${m.requests}\t${m.model}`);
|
|
55
|
-
}
|
|
56
|
-
}
|