koigrid 0.4.0 → 0.6.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 +24 -0
- package/dist/api.js +13 -0
- package/dist/args.js +28 -5
- package/dist/commands/ai.js +56 -0
- package/dist/commands/analytics.js +52 -0
- package/dist/commands/anomalies.js +38 -0
- package/dist/commands/apps.js +215 -13
- package/dist/commands/audit.js +45 -0
- package/dist/commands/bots.js +47 -0
- package/dist/commands/checks.js +87 -0
- package/dist/commands/config.js +52 -0
- package/dist/commands/connect.js +86 -0
- package/dist/commands/db.js +240 -0
- package/dist/commands/dns.js +79 -0
- package/dist/commands/email.js +16 -2
- package/dist/commands/errors.js +34 -0
- package/dist/commands/flags.js +85 -0
- package/dist/commands/heartbeats.js +51 -0
- package/dist/commands/images.js +31 -0
- package/dist/commands/logs.js +69 -0
- package/dist/commands/members.js +54 -0
- package/dist/commands/notifications.js +21 -0
- package/dist/commands/otel.js +35 -0
- package/dist/commands/projects.js +38 -0
- package/dist/commands/queues.js +90 -0
- package/dist/commands/redis.js +18 -0
- package/dist/commands/registry.js +31 -0
- package/dist/commands/rewards.js +57 -0
- package/dist/commands/sandboxes.js +46 -0
- package/dist/commands/speed.js +33 -0
- package/dist/commands/spend.js +33 -0
- package/dist/commands/status.js +81 -0
- package/dist/commands/storage.js +53 -0
- package/dist/commands/tokens.js +42 -0
- package/dist/commands/up.js +44 -0
- package/dist/commands/waf.js +57 -0
- package/dist/commands/webhooks.js +54 -0
- package/dist/commands/wordpress.js +153 -0
- package/dist/commands/workflows.js +95 -0
- package/dist/config.js +4 -2
- package/dist/manifest.js +37 -5
- package/dist/registry.js +32 -1
- package/package.json +6 -3
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { api } from '../api.js';
|
|
2
|
+
import { output, green } from '../output.js';
|
|
3
|
+
// koigrid workflows — durable execution (vs Step Functions/Temporal/Inngest): pasos + runs durables. docs/WORKFLOWS.md.
|
|
4
|
+
export async function workflows(a) {
|
|
5
|
+
const json = !!a.flags.json;
|
|
6
|
+
const sub = a.sub || 'ls';
|
|
7
|
+
const id = a.positionals[0];
|
|
8
|
+
if (sub === 'ls' || sub === 'list') {
|
|
9
|
+
const r = await api('/workflows');
|
|
10
|
+
const l = r.workflows || [];
|
|
11
|
+
return output(l, json, { rows: l.map((w) => ({ id: String(w.id).slice(0, 8), name: w.name, steps: (w.steps || []).join('→') })), columns: ['id', 'name', 'steps'] });
|
|
12
|
+
}
|
|
13
|
+
if (sub === 'create') {
|
|
14
|
+
const name = a.positionals[0];
|
|
15
|
+
const steps = a.flags.steps ? String(a.flags.steps).split(',').map((s) => s.trim()).filter(Boolean) : [];
|
|
16
|
+
if (!name || !steps.length)
|
|
17
|
+
throw new Error('usage: koigrid workflows create <name> --steps step1,step2,step3');
|
|
18
|
+
const body = { name, steps };
|
|
19
|
+
if (a.flags['max-attempts'])
|
|
20
|
+
body.maxAttempts = Number(a.flags['max-attempts']);
|
|
21
|
+
if (a.flags['step-timeout'])
|
|
22
|
+
body.stepTimeoutSec = Number(a.flags['step-timeout']);
|
|
23
|
+
const r = await api('/workflows', { method: 'POST', body });
|
|
24
|
+
return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Workflow "${name}" created (${r.workflow?.id})`));
|
|
25
|
+
}
|
|
26
|
+
if (sub === 'rm' || sub === 'delete') {
|
|
27
|
+
if (!id)
|
|
28
|
+
throw new Error('usage: koigrid workflows rm <id>');
|
|
29
|
+
await api(`/workflows/${encodeURIComponent(id)}`, { method: 'DELETE' });
|
|
30
|
+
return console.log(green(`✓ Deleted ${id}`));
|
|
31
|
+
}
|
|
32
|
+
if (sub === 'start') {
|
|
33
|
+
if (!id)
|
|
34
|
+
throw new Error('usage: koigrid workflows start <id> [--input <json>]');
|
|
35
|
+
const body = {};
|
|
36
|
+
if (a.flags.input)
|
|
37
|
+
body.input = String(a.flags.input);
|
|
38
|
+
const r = await api(`/workflows/${encodeURIComponent(id)}/runs`, { method: 'POST', body });
|
|
39
|
+
return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Run started (${r.run?.id})`));
|
|
40
|
+
}
|
|
41
|
+
if (sub === 'runs') {
|
|
42
|
+
if (!id)
|
|
43
|
+
throw new Error('usage: koigrid workflows runs <workflow-id>');
|
|
44
|
+
const r = await api(`/workflows/${encodeURIComponent(id)}/runs`);
|
|
45
|
+
const l = r.runs || [];
|
|
46
|
+
return output(l, json, { rows: l.map((x) => ({ id: String(x.id).slice(0, 8), status: x.status, step: x.currentStep })), columns: ['id', 'status', 'step'] });
|
|
47
|
+
}
|
|
48
|
+
if (sub === 'run') {
|
|
49
|
+
const runId = a.positionals[1];
|
|
50
|
+
if (!id || !runId)
|
|
51
|
+
throw new Error('usage: koigrid workflows run <workflow-id> <run-id>');
|
|
52
|
+
const r = await api(`/workflows/${encodeURIComponent(id)}/runs/${encodeURIComponent(runId)}`);
|
|
53
|
+
if (json)
|
|
54
|
+
return console.log(JSON.stringify(r, null, 2));
|
|
55
|
+
return console.log(`${r.run?.status} · step ${r.run?.currentStep} (${r.run?.step ?? 'done'})`);
|
|
56
|
+
}
|
|
57
|
+
// primitivas del worker: next / complete / fail / sleep
|
|
58
|
+
const runId = a.positionals[1];
|
|
59
|
+
const wfRun = (path, body) => api(`/workflows/${encodeURIComponent(id)}/runs/${encodeURIComponent(runId)}/${path}`, { method: 'POST', body: body ?? {} });
|
|
60
|
+
if (sub === 'next') {
|
|
61
|
+
if (!id || !runId)
|
|
62
|
+
throw new Error('usage: koigrid workflows next <workflow-id> <run-id>');
|
|
63
|
+
return console.log(JSON.stringify(await wfRun('next'), null, 2));
|
|
64
|
+
}
|
|
65
|
+
if (sub === 'complete') {
|
|
66
|
+
if (!id || !runId || !a.flags.lease)
|
|
67
|
+
throw new Error('usage: koigrid workflows complete <workflow-id> <run-id> --step <name> --lease <token-from-next> [--output <json>]');
|
|
68
|
+
const body = { step: a.flags.step, lease: a.flags.lease };
|
|
69
|
+
if (a.flags.output)
|
|
70
|
+
body.output = a.flags.output;
|
|
71
|
+
const r = await wfRun('complete', body); // SIEMPRE envía (el ternario no debe esconder la llamada en la rama no-json)
|
|
72
|
+
return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Step completed${r?.done ? ' (run done)' : ''}`));
|
|
73
|
+
}
|
|
74
|
+
if (sub === 'fail') {
|
|
75
|
+
if (!id || !runId || !a.flags.lease)
|
|
76
|
+
throw new Error('usage: koigrid workflows fail <workflow-id> <run-id> --step <name> --lease <token-from-next> [--error <msg>]');
|
|
77
|
+
return console.log(JSON.stringify(await wfRun('fail', { step: a.flags.step, lease: a.flags.lease, error: a.flags.error }), null, 2));
|
|
78
|
+
}
|
|
79
|
+
if (sub === 'sleep') {
|
|
80
|
+
if (!id || !runId || !a.flags.lease)
|
|
81
|
+
throw new Error('usage: koigrid workflows sleep <workflow-id> <run-id> --seconds N --lease <token-from-next>');
|
|
82
|
+
return console.log(JSON.stringify(await wfRun('sleep', { seconds: Number(a.flags.seconds), lease: a.flags.lease }), null, 2));
|
|
83
|
+
}
|
|
84
|
+
if (sub === 'update') {
|
|
85
|
+
const id = a.positionals[0];
|
|
86
|
+
if (!id)
|
|
87
|
+
throw new Error('usage: koigrid workflows update <id> --max-attempts N');
|
|
88
|
+
const body = {};
|
|
89
|
+
if (a.flags['max-attempts'] !== undefined)
|
|
90
|
+
body.maxAttempts = Number(a.flags['max-attempts']);
|
|
91
|
+
const r = await api(`/workflows/${encodeURIComponent(id)}`, { method: 'PATCH', body });
|
|
92
|
+
return console.log(json ? JSON.stringify(r, null, 2) : green(`✓ Workflow ${id} reconfigured`));
|
|
93
|
+
}
|
|
94
|
+
throw new Error(`unknown: workflows ${sub}`);
|
|
95
|
+
}
|
package/dist/config.js
CHANGED
|
@@ -15,8 +15,10 @@ export function loadConfig() {
|
|
|
15
15
|
return { token: process.env.KOIGRID_TOKEN || file.token, api: process.env.KOIGRID_API || file.api || DEFAULT_API };
|
|
16
16
|
}
|
|
17
17
|
export function saveConfig(c) {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// El token es un secreto: crea el dir 0700 y ESCRIBE el fichero ya con modo 0600 (mode en writeFileSync) para
|
|
19
|
+
// que NUNCA exista una ventana world-readable entre el write y un chmod posterior. chmod extra por si acaso.
|
|
20
|
+
mkdirSync(DIR, { recursive: true, mode: 0o700 });
|
|
21
|
+
writeFileSync(FILE, JSON.stringify(c, null, 2), { mode: 0o600 });
|
|
20
22
|
try {
|
|
21
23
|
chmodSync(FILE, 0o600);
|
|
22
24
|
}
|
package/dist/manifest.js
CHANGED
|
@@ -3,18 +3,50 @@ 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: 'projects', aliases: ['project'], summary: 'Projects (group resources within the org)', subs: ['ls', 'create', 'rm'], endpoints: ['projects', 'projects/[id]'] },
|
|
6
7
|
{
|
|
7
8
|
name: 'apps', aliases: ['app'], product: 'apps', summary: 'Deploy and manage apps (git repo, container image, or local --dir)',
|
|
8
|
-
subs: ['ls', 'deploy', 'logs', 'rm', 'scale', 'resize', 'autoscale', 'env', 'domains', 'volumes', 'cdn', 'github', 'rollback', 'deployments'],
|
|
9
|
-
endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/scale', 'apps/[id]/resources', 'apps/[id]/autoscale', 'apps/[id]/env', 'apps/[id]/domains', 'apps/[id]/volumes', 'apps/[id]/volumes/[volId]', 'apps/[id]/cdn', 'apps/[id]/github', 'apps/[id]/rollback'],
|
|
9
|
+
subs: ['ls', 'deploy', 'logs', 'rm', 'rename', 'scale', 'resize', 'autoscale', 'env', 'domains', 'volumes', 'cdn', 'protection', 'retention', 'github', 'hooks', 'rollback', 'restore', 'migrate', 'deployments', 'previews', 'preview', 'rules', 'rule', 'rule-rm', 'rule-toggle'],
|
|
10
|
+
endpoints: ['apps', 'apps/[id]', 'apps/[id]/deployments', 'apps/[id]/source-upload', 'apps/[id]/logs', 'apps/[id]/scale', 'apps/[id]/resources', 'apps/[id]/autoscale', 'apps/[id]/env', '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]/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]/restore', 'apps/[id]/migrate', 'apps/[id]/previews', 'apps/[id]/rules', 'apps/[id]/rules/[ruleId]', 'apps/[id]/registry'],
|
|
10
11
|
},
|
|
11
|
-
{ name: 'db', aliases: ['databases', 'database'], product: 'databases', summary: 'Managed Postgres (HA)', subs: ['ls', 'create', 'rm', 'url', 'metrics', 'backups', 'restore', 'ext', 'replicas', 'pub'], endpoints: ['databases', 'databases/[id]', 'databases/[id]/connection', 'databases/[id]/backups', 'databases/[id]/restore', 'databases/[id]/metrics', 'databases/[id]/extensions', 'databases/[id]/replicas', 'databases/[id]/publications'] },
|
|
12
|
-
{ name: 'redis', aliases: ['cache'], product: 'cache', summary: 'Managed Redis (HA)', subs: ['ls', 'create', 'rm', 'url', 'metrics', 'backups', 'restore'], endpoints: ['redis', 'redis/[id]', 'redis/[id]/connection', 'redis/[id]/backups', 'redis/[id]/restore', 'redis/[id]/metrics'] },
|
|
13
|
-
{ name: 'storage', aliases: ['buckets'], product: 'storage', summary: 'Object storage (S3)', subs: ['ls', 'create', 'rm', 'keys', 'key'], endpoints: ['buckets', 'buckets/[id]', 'storage/keys', 'storage/keys/[id]'] },
|
|
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]'] },
|
|
14
15
|
{ 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'] },
|
|
15
16
|
{ name: 'events', aliases: ['activity'], product: 'observability', summary: 'Events and metrics', subs: ['ls', 'metrics'], endpoints: ['events', 'metrics'] },
|
|
16
17
|
{ name: 'alarms', product: 'observability', summary: 'Metric alarms', subs: ['ls', 'create', 'rm'], endpoints: ['alarms', 'alarms/[id]'] },
|
|
18
|
+
{ 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
|
+
{ 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'] },
|
|
21
|
+
{ 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 balance for using koigrid + feedback; redeem as infra credit or gift card', subs: ['ls', 'lines', 'referral', 'submit', 'redeem'], endpoints: ['rewards', 'rewards/lines', 'rewards/referral', 'rewards/redeem', 'rewards/submissions/[id]/review'] },
|
|
23
|
+
{ 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]'] },
|
|
17
24
|
{ name: 'email', product: 'email', summary: 'Transactional email', subs: ['send', 'messages', 'config'], endpoints: ['email/send', 'email/messages', 'email/config'] },
|
|
25
|
+
{ 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'] },
|
|
28
|
+
{ 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
|
+
{ 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
|
+
{ 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
|
+
{ 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
|
+
{ 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
|
+
{ 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 compute — run an image+command once, get the output', subs: ['run', 'ls', 'get'], endpoints: ['sandboxes', 'sandboxes/[id]'] },
|
|
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'] },
|
|
36
|
+
{ 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
|
+
{ 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
|
+
{ 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
|
+
{ 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'] },
|
|
40
|
+
{ name: 'spend', aliases: ['budget'], product: 'spend', summary: 'Spend Management — monthly cap + threshold alerts + optional hard stop', subs: ['show', 'set', 'rm'], endpoints: ['spend'] },
|
|
41
|
+
{ 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
|
+
{ name: 'otel', aliases: ['opentelemetry'], product: 'otel', summary: 'OpenTelemetry export — ship metrics in OTLP to any OTEL backend', subs: ['show', 'set', 'rm'], endpoints: ['otel'] },
|
|
43
|
+
{ 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
|
+
{ 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
|
+
{ 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'] },
|
|
47
|
+
{ 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
|
+
{ 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
|
+
{ name: 'plan', summary: 'Dry-run a cutover manifest (koigrid.yaml): what would be created/updated, without mutating', subs: [], endpoints: ['manifest/plan'] },
|
|
18
50
|
];
|
|
19
51
|
export function resolveCommand(input) {
|
|
20
52
|
for (const c of CLI_COMMANDS)
|
package/dist/registry.js
CHANGED
|
@@ -8,9 +8,40 @@ import { events } from './commands/events.js';
|
|
|
8
8
|
import { email } from './commands/email.js';
|
|
9
9
|
import { alarms } from './commands/alarms.js';
|
|
10
10
|
import { usage } from './commands/usage.js';
|
|
11
|
+
import { projects } from './commands/projects.js';
|
|
12
|
+
import { checks } from './commands/checks.js';
|
|
13
|
+
import { members } from './commands/members.js';
|
|
14
|
+
import { flags } from './commands/flags.js';
|
|
15
|
+
import { status } from './commands/status.js';
|
|
16
|
+
import { heartbeats } from './commands/heartbeats.js';
|
|
17
|
+
import { config } from './commands/config.js';
|
|
18
|
+
import { analytics } from './commands/analytics.js';
|
|
19
|
+
import { errors } from './commands/errors.js';
|
|
20
|
+
import { speed } from './commands/speed.js';
|
|
21
|
+
import { sandboxes } from './commands/sandboxes.js';
|
|
22
|
+
import { ai } from './commands/ai.js';
|
|
23
|
+
import { images } from './commands/images.js';
|
|
24
|
+
import { waf } from './commands/waf.js';
|
|
25
|
+
import { webhooks } from './commands/webhooks.js';
|
|
26
|
+
import { logs } from './commands/logs.js';
|
|
27
|
+
import { spend } from './commands/spend.js';
|
|
28
|
+
import { bots } from './commands/bots.js';
|
|
29
|
+
import { otel } from './commands/otel.js';
|
|
30
|
+
import { dns } from './commands/dns.js';
|
|
31
|
+
import { queues } from './commands/queues.js';
|
|
32
|
+
import { workflows } from './commands/workflows.js';
|
|
33
|
+
import { wordpress } from './commands/wordpress.js';
|
|
34
|
+
import { registry } from './commands/registry.js';
|
|
35
|
+
import { audit } from './commands/audit.js';
|
|
36
|
+
import { anomalies } from './commands/anomalies.js';
|
|
37
|
+
import { tokens } from './commands/tokens.js';
|
|
38
|
+
import { notifications } from './commands/notifications.js';
|
|
39
|
+
import { connect } from './commands/connect.js';
|
|
40
|
+
import { rewards } from './commands/rewards.js';
|
|
41
|
+
import { up, plan } from './commands/up.js';
|
|
11
42
|
export const HANDLERS = {
|
|
12
43
|
login: (a) => auth.login(a.flags),
|
|
13
44
|
logout: () => auth.logout(),
|
|
14
45
|
whoami: (a) => auth.whoami(!!a.flags.json),
|
|
15
|
-
usage, apps, db, redis, storage, jobs, events, alarms, email,
|
|
46
|
+
usage, projects, apps, db, redis, storage, jobs, events, alarms, email, checks, members, flags, status, heartbeats, config, analytics, errors, speed, sandboxes, ai, images, waf, webhooks, logs, spend, bots, otel, dns, queues, workflows, registry, audit, anomalies, tokens, notifications, connect, rewards, up, plan, wp: wordpress,
|
|
16
47
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koigrid",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "koigrid CLI
|
|
3
|
+
"version": "0.6.0",
|
|
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"
|
|
7
7
|
},
|
|
@@ -33,5 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://koigrid.com",
|
|
35
35
|
"bugs": "https://koigrid.com",
|
|
36
|
-
"author": "koigrid"
|
|
36
|
+
"author": "koigrid",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"yaml": "^2.9.0"
|
|
39
|
+
}
|
|
37
40
|
}
|