rekor-cli 0.1.2 → 0.1.4
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/dist/index.js +151 -33
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/program.ts
|
|
4
|
-
import { Command as
|
|
4
|
+
import { Command as Command14 } from "commander";
|
|
5
5
|
|
|
6
6
|
// src/commands/login.ts
|
|
7
7
|
import { Command } from "commander";
|
|
@@ -45,14 +45,128 @@ function login(token, apiUrl) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// src/browser-login.ts
|
|
49
|
+
import { createServer } from "http";
|
|
50
|
+
import { randomBytes } from "crypto";
|
|
51
|
+
var DEFAULT_APP_URL = "https://app.rekor.dev";
|
|
52
|
+
var TIMEOUT_MS = 12e4;
|
|
53
|
+
async function browserLogin(apiUrl) {
|
|
54
|
+
const open = await import("open").then((m) => m.default);
|
|
55
|
+
const state = randomBytes(32).toString("hex");
|
|
56
|
+
const config = loadConfig();
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
const server = createServer((req, res) => {
|
|
59
|
+
const url = new URL(req.url, `http://127.0.0.1`);
|
|
60
|
+
if (url.pathname !== "/callback") {
|
|
61
|
+
res.writeHead(404);
|
|
62
|
+
res.end();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const token = url.searchParams.get("token");
|
|
66
|
+
const returnedState = url.searchParams.get("state");
|
|
67
|
+
if (returnedState !== state) {
|
|
68
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
69
|
+
res.end(errorPage("Authentication failed: state mismatch. Please try again."));
|
|
70
|
+
cleanup();
|
|
71
|
+
reject(new Error("State mismatch \u2014 possible CSRF attempt"));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!token) {
|
|
75
|
+
res.writeHead(400, { "Content-Type": "text/html" });
|
|
76
|
+
res.end(errorPage("Authentication failed: no token received."));
|
|
77
|
+
cleanup();
|
|
78
|
+
reject(new Error("No token in callback"));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
saveConfig({
|
|
82
|
+
...config,
|
|
83
|
+
token,
|
|
84
|
+
api_url: apiUrl ?? config.api_url
|
|
85
|
+
});
|
|
86
|
+
res.writeHead(200, { "Content-Type": "text/html" });
|
|
87
|
+
res.end(successPage());
|
|
88
|
+
cleanup();
|
|
89
|
+
resolve();
|
|
90
|
+
});
|
|
91
|
+
const timeout = setTimeout(() => {
|
|
92
|
+
cleanup();
|
|
93
|
+
reject(new Error("Login timed out \u2014 no response from browser within 2 minutes"));
|
|
94
|
+
}, TIMEOUT_MS);
|
|
95
|
+
function cleanup() {
|
|
96
|
+
clearTimeout(timeout);
|
|
97
|
+
server.close();
|
|
98
|
+
}
|
|
99
|
+
server.listen(0, "127.0.0.1", () => {
|
|
100
|
+
const addr = server.address();
|
|
101
|
+
if (!addr || typeof addr === "string") {
|
|
102
|
+
cleanup();
|
|
103
|
+
reject(new Error("Failed to start local server"));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const port = addr.port;
|
|
107
|
+
const appUrl = process.env["REKOR_APP_URL"] || DEFAULT_APP_URL;
|
|
108
|
+
const authUrl = `${appUrl}/cli-auth?port=${port}&state=${state}`;
|
|
109
|
+
console.log("Opening browser for authentication...");
|
|
110
|
+
console.log(`If the browser doesn't open, visit: ${authUrl}`);
|
|
111
|
+
open(authUrl).catch(() => {
|
|
112
|
+
console.log("Could not open browser automatically.");
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function successPage() {
|
|
118
|
+
return `<!DOCTYPE html>
|
|
119
|
+
<html>
|
|
120
|
+
<head><title>Rekor CLI</title></head>
|
|
121
|
+
<body style="font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background: #fafafa;">
|
|
122
|
+
<div style="text-align: center;">
|
|
123
|
+
<h1 style="font-size: 1.25rem; font-weight: 600;">Authentication successful</h1>
|
|
124
|
+
<p style="color: #666; margin-top: 0.5rem;">You can close this tab and return to your terminal.</p>
|
|
125
|
+
</div>
|
|
126
|
+
</body>
|
|
127
|
+
</html>`;
|
|
128
|
+
}
|
|
129
|
+
function errorPage(message) {
|
|
130
|
+
return `<!DOCTYPE html>
|
|
131
|
+
<html>
|
|
132
|
+
<head><title>Rekor CLI</title></head>
|
|
133
|
+
<body style="font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background: #fafafa;">
|
|
134
|
+
<div style="text-align: center;">
|
|
135
|
+
<h1 style="font-size: 1.25rem; font-weight: 600; color: #dc2626;">Authentication failed</h1>
|
|
136
|
+
<p style="color: #666; margin-top: 0.5rem;">${message}</p>
|
|
137
|
+
</div>
|
|
138
|
+
</body>
|
|
139
|
+
</html>`;
|
|
140
|
+
}
|
|
141
|
+
|
|
48
142
|
// src/commands/login.ts
|
|
49
|
-
var loginCommand = new Command("login").description("Authenticate with
|
|
50
|
-
|
|
51
|
-
|
|
143
|
+
var loginCommand = new Command("login").description("Authenticate with Rekor").option("--token <token>", "API key for headless/CI authentication (rec_...)").option("--api-url <url>", "API base URL").action(async (opts) => {
|
|
144
|
+
if (opts.token) {
|
|
145
|
+
login(opts.token, opts.apiUrl);
|
|
146
|
+
console.log("Authenticated successfully");
|
|
147
|
+
} else {
|
|
148
|
+
try {
|
|
149
|
+
await browserLogin(opts.apiUrl);
|
|
150
|
+
console.log("Authenticated successfully");
|
|
151
|
+
} catch (err) {
|
|
152
|
+
console.error(
|
|
153
|
+
`Login failed: ${err instanceof Error ? err.message : "Unknown error"}`
|
|
154
|
+
);
|
|
155
|
+
process.exit(1);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
52
158
|
});
|
|
53
159
|
|
|
54
|
-
// src/commands/
|
|
160
|
+
// src/commands/logout.ts
|
|
55
161
|
import { Command as Command2 } from "commander";
|
|
162
|
+
var logoutCommand = new Command2("logout").description("Remove stored authentication credentials").action(() => {
|
|
163
|
+
const config = loadConfig();
|
|
164
|
+
saveConfig({ ...config, token: "" });
|
|
165
|
+
console.log("Logged out successfully");
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// src/commands/workspaces.ts
|
|
169
|
+
import { Command as Command3 } from "commander";
|
|
56
170
|
|
|
57
171
|
// src/client.ts
|
|
58
172
|
var ApiClient = class {
|
|
@@ -128,19 +242,21 @@ function parseData(data) {
|
|
|
128
242
|
return JSON.parse(data);
|
|
129
243
|
}
|
|
130
244
|
function getWorkspace(cmd) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
245
|
+
let current = cmd;
|
|
246
|
+
while (current) {
|
|
247
|
+
const ws = current.opts().workspace;
|
|
248
|
+
if (ws) return ws;
|
|
249
|
+
current = current.parent;
|
|
135
250
|
}
|
|
136
|
-
|
|
251
|
+
console.error("Error: --workspace is required");
|
|
252
|
+
return process.exit(1);
|
|
137
253
|
}
|
|
138
254
|
function getFormat(cmd) {
|
|
139
255
|
return cmd.parent?.parent?.opts().output ?? cmd.parent?.opts().output ?? "table";
|
|
140
256
|
}
|
|
141
257
|
|
|
142
258
|
// src/commands/workspaces.ts
|
|
143
|
-
var workspacesCommand = new
|
|
259
|
+
var workspacesCommand = new Command3("workspaces").description("Manage workspaces");
|
|
144
260
|
workspacesCommand.command("list").description("List all workspaces").action(async function() {
|
|
145
261
|
const client = new ApiClient();
|
|
146
262
|
const data = await client.request("GET", "/v1/workspaces");
|
|
@@ -202,8 +318,8 @@ workspacesCommand.command("promotions <production-id>").description("List promot
|
|
|
202
318
|
});
|
|
203
319
|
|
|
204
320
|
// src/commands/collections.ts
|
|
205
|
-
import { Command as
|
|
206
|
-
var collectionsCommand = new
|
|
321
|
+
import { Command as Command4 } from "commander";
|
|
322
|
+
var collectionsCommand = new Command4("collections").description("Manage collections");
|
|
207
323
|
collectionsCommand.command("list").description("List all collections in a workspace").action(async function() {
|
|
208
324
|
const ws = getWorkspace(this);
|
|
209
325
|
const client = new ApiClient();
|
|
@@ -236,8 +352,8 @@ collectionsCommand.command("delete <id>").description("Delete a collection").act
|
|
|
236
352
|
});
|
|
237
353
|
|
|
238
354
|
// src/commands/records.ts
|
|
239
|
-
import { Command as
|
|
240
|
-
var recordsCommand = new
|
|
355
|
+
import { Command as Command5 } from "commander";
|
|
356
|
+
var recordsCommand = new Command5("records").description("Manage records");
|
|
241
357
|
recordsCommand.command("upsert <collection>").description("Create or update a record").requiredOption("--data <json>", "Record data (inline JSON or @filename)").option("--id <id>", "Internal record ID (UUID) to update a known record").option("--external-id <id>", "External/agent-supplied ID for idempotent upsert").option("--external-source <source>", "Source system for external_id (e.g. stripe)").action(async function(collection, opts) {
|
|
242
358
|
const ws = getWorkspace(this);
|
|
243
359
|
const client = new ApiClient();
|
|
@@ -262,8 +378,8 @@ recordsCommand.command("delete <collection> <id>").description("Delete a record"
|
|
|
262
378
|
});
|
|
263
379
|
|
|
264
380
|
// src/commands/query.ts
|
|
265
|
-
import { Command as
|
|
266
|
-
var queryCommand = new
|
|
381
|
+
import { Command as Command6 } from "commander";
|
|
382
|
+
var queryCommand = new Command6("query").description("Query records in a collection").argument("<collection>", "Collection to query").option("--filter <json>", "Filter expression (JSON)").option("--sort <json>", "Sort expression (JSON)").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").option("--fields <fields>", "Comma-separated list of fields to return").option("--aggregate", "Run aggregation query instead of search").option("--aggregations <json>", "Aggregation expressions (JSON array)").option("--group-by <fields>", "Comma-separated fields to group by").action(async function(collection, opts) {
|
|
267
383
|
const ws = getWorkspace(this);
|
|
268
384
|
const client = new ApiClient();
|
|
269
385
|
if (opts.aggregate) {
|
|
@@ -289,8 +405,8 @@ var queryCommand = new Command5("query").description("Query records in a collect
|
|
|
289
405
|
});
|
|
290
406
|
|
|
291
407
|
// src/commands/relationships.ts
|
|
292
|
-
import { Command as
|
|
293
|
-
var relationshipsCommand = new
|
|
408
|
+
import { Command as Command7 } from "commander";
|
|
409
|
+
var relationshipsCommand = new Command7("relationships").description("Manage relationships between records");
|
|
294
410
|
relationshipsCommand.command("upsert").description("Create or update a relationship").requiredOption("--source <collection/id>", "Source record (collection/id)").requiredOption("--target <collection/id>", "Target record (collection/id)").requiredOption("--type <type>", "Relationship type").option("--id <id>", "Relationship ID").option("--data <json>", "Relationship metadata (inline JSON or @filename)").action(async function(opts) {
|
|
295
411
|
const ws = getWorkspace(this);
|
|
296
412
|
const client = new ApiClient();
|
|
@@ -323,13 +439,14 @@ relationshipsCommand.command("delete <id>").description("Delete a relationship")
|
|
|
323
439
|
});
|
|
324
440
|
|
|
325
441
|
// src/commands/query-relationships.ts
|
|
326
|
-
import { Command as
|
|
327
|
-
var queryRelationshipsCommand = new
|
|
442
|
+
import { Command as Command8 } from "commander";
|
|
443
|
+
var queryRelationshipsCommand = new Command8("query-relationships").description("Query related records").argument("<collection>", "Collection of the source record").argument("<id>", "Source record ID").option("--type <type>", "Filter by relationship type").option("--direction <dir>", "Direction: outgoing, incoming, or both", "both").option("--limit <n>", "Max results", "50").option("--offset <n>", "Skip results", "0").action(async function(collection, id, opts) {
|
|
328
444
|
const ws = getWorkspace(this);
|
|
329
445
|
const client = new ApiClient();
|
|
330
446
|
const params = new URLSearchParams();
|
|
331
447
|
if (opts.type) params.set("rel_type", opts.type);
|
|
332
|
-
|
|
448
|
+
const directionMap = { outgoing: "source", incoming: "target", both: "both" };
|
|
449
|
+
params.set("direction", directionMap[opts.direction] ?? opts.direction);
|
|
333
450
|
params.set("limit", opts.limit);
|
|
334
451
|
params.set("offset", opts.offset);
|
|
335
452
|
const data = await client.request("GET", `/v1/${ws}/records/${collection}/${id}/related?${params.toString()}`);
|
|
@@ -337,8 +454,8 @@ var queryRelationshipsCommand = new Command7("query-relationships").description(
|
|
|
337
454
|
});
|
|
338
455
|
|
|
339
456
|
// src/commands/attachments.ts
|
|
340
|
-
import { Command as
|
|
341
|
-
var attachmentsCommand = new
|
|
457
|
+
import { Command as Command9 } from "commander";
|
|
458
|
+
var attachmentsCommand = new Command9("attachments").description("Manage record attachments");
|
|
342
459
|
attachmentsCommand.command("upload <collection> <id>").description("Get a presigned upload URL for a record attachment").requiredOption("--filename <name>", "File name or path (e.g. docs/guide.md)").option("--content-type <type>", "MIME type", "application/octet-stream").action(async function(collection, id, opts) {
|
|
343
460
|
const ws = getWorkspace(this);
|
|
344
461
|
const client = new ApiClient();
|
|
@@ -369,8 +486,8 @@ attachmentsCommand.command("delete <collection> <id> <attachment-id>").descripti
|
|
|
369
486
|
});
|
|
370
487
|
|
|
371
488
|
// src/commands/hooks.ts
|
|
372
|
-
import { Command as
|
|
373
|
-
var hooksCommand = new
|
|
489
|
+
import { Command as Command10 } from "commander";
|
|
490
|
+
var hooksCommand = new Command10("hooks").description("Manage inbound webhook endpoints");
|
|
374
491
|
hooksCommand.command("create").description("Create a new inbound hook").requiredOption("--name <name>", "Hook name").requiredOption("--secret <secret>", "HMAC shared secret").option("--collection-scope <collections>", "Comma-separated collection scope").action(async function(opts) {
|
|
375
492
|
const ws = getWorkspace(this);
|
|
376
493
|
const client = new ApiClient();
|
|
@@ -405,8 +522,8 @@ hooksCommand.command("delete <id>").description("Delete a hook").action(async fu
|
|
|
405
522
|
});
|
|
406
523
|
|
|
407
524
|
// src/commands/triggers.ts
|
|
408
|
-
import { Command as
|
|
409
|
-
var triggersCommand = new
|
|
525
|
+
import { Command as Command11 } from "commander";
|
|
526
|
+
var triggersCommand = new Command11("triggers").description("Manage outbound triggers");
|
|
410
527
|
triggersCommand.command("create").description("Create an outbound trigger").requiredOption("--name <name>", "Trigger name").requiredOption("--url <url>", "Target URL").requiredOption("--secret <secret>", "HMAC signing secret").requiredOption("--events <events>", "Comma-separated event types").option("--collection-scope <collections>", "Comma-separated collection scope").option("--filter <json>", "Filter expression (JSON)").action(async function(opts) {
|
|
411
528
|
const ws = getWorkspace(this);
|
|
412
529
|
const client = new ApiClient();
|
|
@@ -446,8 +563,8 @@ triggersCommand.command("delete <id>").description("Delete a trigger").action(as
|
|
|
446
563
|
});
|
|
447
564
|
|
|
448
565
|
// src/commands/batch.ts
|
|
449
|
-
import { Command as
|
|
450
|
-
var batchCommand = new
|
|
566
|
+
import { Command as Command12 } from "commander";
|
|
567
|
+
var batchCommand = new Command12("batch").description("Execute atomic batch operations (up to 100 operations)").requiredOption("--operations <json>", "Operations array (inline JSON or @filename)").action(async function(opts) {
|
|
451
568
|
const ws = getWorkspace(this);
|
|
452
569
|
const client = new ApiClient();
|
|
453
570
|
const operations = parseData(opts.operations);
|
|
@@ -458,9 +575,9 @@ var batchCommand = new Command11("batch").description("Execute atomic batch oper
|
|
|
458
575
|
});
|
|
459
576
|
|
|
460
577
|
// src/commands/providers.ts
|
|
461
|
-
import { Command as
|
|
578
|
+
import { Command as Command13 } from "commander";
|
|
462
579
|
var VALID_PROVIDERS = "openai, anthropic, google, mcp";
|
|
463
|
-
var providersCommand = new
|
|
580
|
+
var providersCommand = new Command13("providers").description("Import/export tool definitions between LLM providers and Record collections");
|
|
464
581
|
providersCommand.command("import <provider>").description(`Import tool definitions as collections. Providers: ${VALID_PROVIDERS}`).requiredOption("--tools <json>", "Tool definitions (inline JSON or @filename)").action(async function(provider, opts) {
|
|
465
582
|
const ws = getWorkspace(this);
|
|
466
583
|
const client = new ApiClient();
|
|
@@ -496,8 +613,9 @@ providersCommand.command("import-call <provider> <collection>").description(`Cre
|
|
|
496
613
|
});
|
|
497
614
|
|
|
498
615
|
// src/program.ts
|
|
499
|
-
var program = new
|
|
616
|
+
var program = new Command14("rekor").description("Rekor CLI \u2014 System of Record for AI agents").version("0.1.0").option("--workspace <id>", "Workspace ID").option("--output <format>", "Output format: json or table", "table");
|
|
500
617
|
program.addCommand(loginCommand);
|
|
618
|
+
program.addCommand(logoutCommand);
|
|
501
619
|
program.addCommand(workspacesCommand);
|
|
502
620
|
program.addCommand(collectionsCommand);
|
|
503
621
|
program.addCommand(recordsCommand);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/program.ts","../src/commands/login.ts","../src/config.ts","../src/auth.ts","../src/commands/workspaces.ts","../src/client.ts","../src/output.ts","../src/helpers.ts","../src/commands/collections.ts","../src/commands/records.ts","../src/commands/query.ts","../src/commands/relationships.ts","../src/commands/query-relationships.ts","../src/commands/attachments.ts","../src/commands/hooks.ts","../src/commands/triggers.ts","../src/commands/batch.ts","../src/commands/providers.ts","../src/index.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { loginCommand } from './commands/login.js';\nimport { workspacesCommand } from './commands/workspaces.js';\nimport { collectionsCommand } from './commands/collections.js';\nimport { recordsCommand } from './commands/records.js';\nimport { queryCommand } from './commands/query.js';\nimport { relationshipsCommand } from './commands/relationships.js';\nimport { queryRelationshipsCommand } from './commands/query-relationships.js';\nimport { attachmentsCommand } from './commands/attachments.js';\nimport { hooksCommand } from './commands/hooks.js';\nimport { triggersCommand } from './commands/triggers.js';\nimport { batchCommand } from './commands/batch.js';\nimport { providersCommand } from './commands/providers.js';\n\nexport const program = new Command('rekor')\n .description('Rekor CLI — System of Record for AI agents')\n .version('0.1.0')\n .option('--workspace <id>', 'Workspace ID')\n .option('--output <format>', 'Output format: json or table', 'table');\n\nprogram.addCommand(loginCommand);\nprogram.addCommand(workspacesCommand);\nprogram.addCommand(collectionsCommand);\nprogram.addCommand(recordsCommand);\nprogram.addCommand(queryCommand);\nprogram.addCommand(relationshipsCommand);\nprogram.addCommand(queryRelationshipsCommand);\nprogram.addCommand(attachmentsCommand);\nprogram.addCommand(hooksCommand);\nprogram.addCommand(triggersCommand);\nprogram.addCommand(batchCommand);\nprogram.addCommand(providersCommand);\n","import { Command } from 'commander';\nimport { login } from '../auth.js';\n\nexport const loginCommand = new Command('login')\n .description('Authenticate with a Record API key')\n .requiredOption('--token <token>', 'API key (rec_...)')\n .option('--api-url <url>', 'API base URL')\n .action((opts: { token: string; apiUrl?: string }) => {\n login(opts.token, opts.apiUrl);\n console.log('Authenticated successfully');\n });\n","import { readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\n\nconst CONFIG_DIR = join(homedir(), '.config', 'rekor');\nconst CONFIG_FILE = join(CONFIG_DIR, 'config.json');\n\nexport interface Config {\n api_url: string;\n token: string;\n default_workspace?: string;\n}\n\nexport function loadConfig(): Config {\n const envToken = process.env['REKOR_TOKEN'];\n const envUrl = process.env['REKOR_API_URL'];\n\n try {\n const raw = readFileSync(CONFIG_FILE, 'utf-8');\n const config = JSON.parse(raw) as Config;\n return {\n ...config,\n token: envToken ?? config.token,\n api_url: envUrl ?? config.api_url,\n };\n } catch {\n return {\n api_url: envUrl ?? 'http://localhost:8787',\n token: envToken ?? '',\n };\n }\n}\n\nexport function saveConfig(config: Config): void {\n mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });\n writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), { mode: 0o600 });\n}\n\nexport { CONFIG_DIR, CONFIG_FILE };\n","import { loadConfig, saveConfig } from './config.js';\n\nexport function login(token: string, apiUrl?: string): void {\n const config = loadConfig();\n saveConfig({\n ...config,\n token,\n api_url: apiUrl ?? config.api_url,\n });\n}\n\nexport function isAuthenticated(): boolean {\n const config = loadConfig();\n return !!config.token;\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getFormat } from '../helpers.js';\n\nexport const workspacesCommand = new Command('workspaces')\n .description('Manage workspaces');\n\nworkspacesCommand.command('list')\n .description('List all workspaces')\n .action(async function (this: Command) {\n const client = new ApiClient();\n const data = await client.request('GET', '/v1/workspaces');\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('get <id>')\n .description('Get a workspace')\n .action(async function (this: Command, id: string) {\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/workspaces/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('create <id>')\n .description('Create a workspace')\n .requiredOption('--name <name>', 'Workspace name')\n .option('--description <desc>', 'Description')\n .action(async function (this: Command, id: string, opts: { name: string; description?: string }) {\n const client = new ApiClient();\n const data = await client.request('PUT', `/v1/workspaces/${id}`, {\n name: opts.name,\n description: opts.description,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('delete <id>')\n .description('Delete a workspace')\n .action(async (_id: string) => {\n const client = new ApiClient();\n await client.request('DELETE', `/v1/workspaces/${_id}`);\n console.log('Deleted');\n });\n\n// --- Environment commands ---\n\nworkspacesCommand.command('create-preview <production-id>')\n .description('Create a preview workspace linked to a production workspace')\n .requiredOption('--name <name>', 'Preview workspace name')\n .option('--description <desc>', 'Description')\n .action(async function (this: Command, productionId: string, opts: { name: string; description?: string }) {\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${productionId}/preview`, {\n name: opts.name,\n description: opts.description,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('list-previews <production-id>')\n .description('List preview workspaces for a production workspace')\n .action(async function (this: Command, productionId: string) {\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${productionId}/previews`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('promote <production-id>')\n .description('Promote config from a preview workspace to production (human-only)')\n .requiredOption('--from <preview-id>', 'Source preview workspace ID')\n .option('--dry-run', 'Show what would change without applying')\n .option('--collections <ids>', 'Comma-separated collection IDs to promote', (v: string) => v.split(','))\n .option('--triggers <ids>', 'Comma-separated trigger IDs to promote', (v: string) => v.split(','))\n .option('--hooks <ids>', 'Comma-separated hook IDs to promote', (v: string) => v.split(','))\n .action(async function (\n this: Command,\n productionId: string,\n opts: { from: string; dryRun?: boolean; collections?: string[]; triggers?: string[]; hooks?: string[] },\n ) {\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${productionId}/promote`, {\n source_workspace_id: opts.from,\n dry_run: opts.dryRun ?? false,\n collections: opts.collections,\n triggers: opts.triggers,\n hooks: opts.hooks,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('rollback <production-id>')\n .description('Rollback a promotion (human-only)')\n .requiredOption('--promotion <promotion-id>', 'Promotion ID to rollback')\n .action(async function (this: Command, productionId: string, opts: { promotion: string }) {\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${productionId}/promote/rollback`, {\n promotion_id: opts.promotion,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('promotions <production-id>')\n .description('List promotion history for a production workspace')\n .action(async function (this: Command, productionId: string) {\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${productionId}/promotions`);\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { loadConfig } from './config.js';\n\nexport class ApiClient {\n private baseUrl: string;\n private token: string;\n\n constructor() {\n const config = loadConfig();\n this.baseUrl = config.api_url;\n this.token = config.token;\n }\n\n async request<T = unknown>(method: string, path: string, body?: unknown): Promise<T> {\n const res = await fetch(`${this.baseUrl}${path}`, {\n method,\n headers: {\n 'Authorization': `Bearer ${this.token}`,\n 'Content-Type': 'application/json',\n },\n body: body ? JSON.stringify(body) : undefined,\n });\n\n const json = await res.json() as { data?: T; error?: { message: string } };\n if (!res.ok) {\n throw new Error(json.error?.message ?? `HTTP ${res.status}`);\n }\n return json.data as T;\n }\n}\n","import chalk from 'chalk';\nimport Table from 'cli-table3';\n\nexport type OutputFormat = 'json' | 'table';\n\nexport function formatOutput(data: unknown, format: OutputFormat): string {\n if (format === 'json') {\n return JSON.stringify(data, null, 2);\n }\n\n if (Array.isArray(data)) {\n return formatTable(data as Record<string, unknown>[]);\n }\n\n if (typeof data === 'object' && data !== null) {\n return formatKeyValue(data as Record<string, unknown>);\n }\n\n return String(data);\n}\n\nfunction formatTable(rows: Record<string, unknown>[]): string {\n if (rows.length === 0) return chalk.dim('No results');\n\n const keys = Object.keys(rows[0]!);\n const table = new Table({ head: keys.map(k => chalk.bold(k)) });\n\n for (const row of rows) {\n table.push(keys.map(k => {\n const val = row[k];\n if (val === null || val === undefined) return '';\n if (typeof val === 'object') return JSON.stringify(val);\n return String(val);\n }));\n }\n\n return table.toString();\n}\n\nfunction formatKeyValue(obj: Record<string, unknown>): string {\n const table = new Table();\n for (const [key, value] of Object.entries(obj)) {\n const displayValue = typeof value === 'object' ? JSON.stringify(value) : String(value ?? '');\n table.push({ [chalk.bold(key)]: displayValue });\n }\n return table.toString();\n}\n","import { readFileSync } from 'fs';\nimport { Command } from 'commander';\nimport { type OutputFormat } from './output.js';\n\nexport function parseData(data: string): Record<string, unknown> {\n if (data.startsWith('@')) {\n const content = readFileSync(data.slice(1), 'utf-8');\n return JSON.parse(content) as Record<string, unknown>;\n }\n return JSON.parse(data) as Record<string, unknown>;\n}\n\nexport function getWorkspace(cmd: Command): string {\n const ws = cmd.parent?.opts().workspace as string | undefined;\n if (!ws) {\n console.error('Error: --workspace is required');\n return process.exit(1);\n }\n return ws;\n}\n\nexport function getFormat(cmd: Command): OutputFormat {\n return (cmd.parent?.parent?.opts().output ?? cmd.parent?.opts().output ?? 'table') as OutputFormat;\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const collectionsCommand = new Command('collections')\n .description('Manage collections');\n\ncollectionsCommand.command('list')\n .description('List all collections in a workspace')\n .action(async function (this: Command) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/collections`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ncollectionsCommand.command('get <id>')\n .description('Get a collection')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/collections/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ncollectionsCommand.command('upsert <id>')\n .description('Create or update a collection')\n .requiredOption('--name <name>', 'Collection name')\n .option('--description <desc>', 'Description')\n .option('--schema <json>', 'JSON Schema (inline JSON or @filename)')\n .option('--icon <icon>', 'Icon name')\n .option('--color <color>', 'Hex color')\n .option('--sources <json>', 'External sources config (inline JSON or @filename)')\n .action(async function (this: Command, id: string, opts: { name: string; description?: string; schema?: string; icon?: string; color?: string; sources?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = { name: opts.name };\n if (opts.description) body['description'] = opts.description;\n if (opts.schema) body['json_schema'] = parseData(opts.schema);\n if (opts.icon) body['icon'] = opts.icon;\n if (opts.color) body['color'] = opts.color;\n if (opts.sources) body['sources'] = parseData(opts.sources);\n const data = await client.request('PUT', `/v1/${ws}/collections/${id}`, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ncollectionsCommand.command('delete <id>')\n .description('Delete a collection')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/collections/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const recordsCommand = new Command('records')\n .description('Manage records');\n\nrecordsCommand.command('upsert <collection>')\n .description('Create or update a record')\n .requiredOption('--data <json>', 'Record data (inline JSON or @filename)')\n .option('--id <id>', 'Internal record ID (UUID) to update a known record')\n .option('--external-id <id>', 'External/agent-supplied ID for idempotent upsert')\n .option('--external-source <source>', 'Source system for external_id (e.g. stripe)')\n .action(async function (this: Command, collection: string, opts: { data: string; id?: string; externalId?: string; externalSource?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = { data: parseData(opts.data) };\n if (opts.externalId) body['external_id'] = opts.externalId;\n if (opts.externalSource) body['external_source'] = opts.externalSource;\n const path = opts.id\n ? `/v1/${ws}/records/${collection}/${opts.id}`\n : `/v1/${ws}/records/${collection}`;\n const data = await client.request('PUT', path, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrecordsCommand.command('get <collection> <id>')\n .description('Get a record by ID')\n .action(async function (this: Command, collection: string, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrecordsCommand.command('delete <collection> <id>')\n .description('Delete a record')\n .action(async function (this: Command, collection: string, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/records/${collection}/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const queryCommand = new Command('query')\n .description('Query records in a collection')\n .argument('<collection>', 'Collection to query')\n .option('--filter <json>', 'Filter expression (JSON)')\n .option('--sort <json>', 'Sort expression (JSON)')\n .option('--limit <n>', 'Max results', '50')\n .option('--offset <n>', 'Skip results', '0')\n .option('--fields <fields>', 'Comma-separated list of fields to return')\n .option('--aggregate', 'Run aggregation query instead of search')\n .option('--aggregations <json>', 'Aggregation expressions (JSON array)')\n .option('--group-by <fields>', 'Comma-separated fields to group by')\n .action(async function (this: Command, collection: string, opts: { filter?: string; sort?: string; limit: string; offset: string; fields?: string; aggregate?: boolean; aggregations?: string; groupBy?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n\n if (opts.aggregate) {\n const body: Record<string, unknown> = {};\n if (opts.aggregations) body.aggregations = JSON.parse(opts.aggregations);\n if (opts.groupBy) body.group_by = opts.groupBy.split(',');\n if (opts.filter) body.filter = JSON.parse(opts.filter);\n if (opts.sort) body.sort = JSON.parse(opts.sort);\n body.limit = parseInt(opts.limit);\n body.offset = parseInt(opts.offset);\n\n const data = await client.request('POST', `/v1/${ws}/records/${collection}/aggregate`, body);\n console.log(formatOutput(data, getFormat(this)));\n } else {\n const params = new URLSearchParams();\n if (opts.filter) params.set('filter', opts.filter);\n if (opts.sort) params.set('sort', opts.sort);\n params.set('limit', opts.limit);\n params.set('offset', opts.offset);\n if (opts.fields) params.set('fields', opts.fields);\n const data = await client.request('GET', `/v1/${ws}/records/${collection}?${params.toString()}`);\n console.log(formatOutput(data, getFormat(this)));\n }\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const relationshipsCommand = new Command('relationships')\n .description('Manage relationships between records');\n\nrelationshipsCommand.command('upsert')\n .description('Create or update a relationship')\n .requiredOption('--source <collection/id>', 'Source record (collection/id)')\n .requiredOption('--target <collection/id>', 'Target record (collection/id)')\n .requiredOption('--type <type>', 'Relationship type')\n .option('--id <id>', 'Relationship ID')\n .option('--data <json>', 'Relationship metadata (inline JSON or @filename)')\n .action(async function (this: Command, opts: { source: string; target: string; type: string; id?: string; data?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const [sourceCollection, sourceId] = opts.source.split('/');\n const [targetCollection, targetId] = opts.target.split('/');\n const body: Record<string, unknown> = {\n rel_type: opts.type,\n source_collection: sourceCollection,\n source_id: sourceId,\n target_collection: targetCollection,\n target_id: targetId,\n };\n if (opts.id) body['id'] = opts.id;\n if (opts.data) body['data'] = parseData(opts.data);\n const path = opts.id ? `/v1/${ws}/relationships/${opts.id}` : `/v1/${ws}/relationships`;\n const data = await client.request('PUT', path, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrelationshipsCommand.command('get <id>')\n .description('Get a relationship by ID')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/relationships/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrelationshipsCommand.command('delete <id>')\n .description('Delete a relationship')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/relationships/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const queryRelationshipsCommand = new Command('query-relationships')\n .description('Query related records')\n .argument('<collection>', 'Collection of the source record')\n .argument('<id>', 'Source record ID')\n .option('--type <type>', 'Filter by relationship type')\n .option('--direction <dir>', 'Direction: outgoing, incoming, or both', 'both')\n .option('--limit <n>', 'Max results', '50')\n .option('--offset <n>', 'Skip results', '0')\n .action(async function (this: Command, collection: string, id: string, opts: { type?: string; direction: string; limit: string; offset: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const params = new URLSearchParams();\n if (opts.type) params.set('rel_type', opts.type);\n params.set('direction', opts.direction);\n params.set('limit', opts.limit);\n params.set('offset', opts.offset);\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}/related?${params.toString()}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const attachmentsCommand = new Command('attachments')\n .description('Manage record attachments');\n\nattachmentsCommand.command('upload <collection> <id>')\n .description('Get a presigned upload URL for a record attachment')\n .requiredOption('--filename <name>', 'File name or path (e.g. docs/guide.md)')\n .option('--content-type <type>', 'MIME type', 'application/octet-stream')\n .action(async function (this: Command, collection: string, id: string, opts: { filename: string; contentType: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${ws}/records/${collection}/${id}/attachments`, {\n filename: opts.filename,\n content_type: opts.contentType,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nattachmentsCommand.command('url <collection> <id>')\n .description('Get a presigned download URL for an attachment')\n .requiredOption('--filename <name>', 'File name or path (e.g. docs/guide.md)')\n .action(async function (this: Command, collection: string, id: string, opts: { filename: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}/attachments/${opts.filename}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nattachmentsCommand.command('list <collection> <id>')\n .description('List attachments for a record')\n .option('--prefix <path>', 'Filter by path prefix (e.g. docs/)')\n .action(async function (this: Command, collection: string, id: string, opts: { prefix?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const query = opts.prefix ? `?prefix=${encodeURIComponent(opts.prefix)}` : '';\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}/attachments${query}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nattachmentsCommand.command('delete <collection> <id> <attachment-id>')\n .description('Delete an attachment')\n .action(async function (this: Command, collection: string, id: string, attachmentId: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/records/${collection}/${id}/attachments/${attachmentId}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const hooksCommand = new Command('hooks')\n .description('Manage inbound webhook endpoints');\n\nhooksCommand.command('create')\n .description('Create a new inbound hook')\n .requiredOption('--name <name>', 'Hook name')\n .requiredOption('--secret <secret>', 'HMAC shared secret')\n .option('--collection-scope <collections>', 'Comma-separated collection scope')\n .action(async function (this: Command, opts: { name: string; secret: string; collectionScope?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = {\n name: opts.name,\n secret: opts.secret,\n enabled: true,\n };\n if (opts.collectionScope) {\n body['collection_scope'] = opts.collectionScope.split(',');\n }\n const data = await client.request('PUT', `/v1/${ws}/hooks`, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nhooksCommand.command('get <id>')\n .description('Get a hook')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/hooks/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nhooksCommand.command('list')\n .description('List all hooks')\n .action(async function (this: Command) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/hooks`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nhooksCommand.command('delete <id>')\n .description('Delete a hook')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/hooks/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const triggersCommand = new Command('triggers')\n .description('Manage outbound triggers');\n\ntriggersCommand.command('create')\n .description('Create an outbound trigger')\n .requiredOption('--name <name>', 'Trigger name')\n .requiredOption('--url <url>', 'Target URL')\n .requiredOption('--secret <secret>', 'HMAC signing secret')\n .requiredOption('--events <events>', 'Comma-separated event types')\n .option('--collection-scope <collections>', 'Comma-separated collection scope')\n .option('--filter <json>', 'Filter expression (JSON)')\n .action(async function (this: Command, opts: { name: string; url: string; secret: string; events: string; collectionScope?: string; filter?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = {\n name: opts.name,\n url: opts.url,\n secret: opts.secret,\n events: opts.events.split(','),\n enabled: true,\n };\n if (opts.collectionScope) {\n body['collection_scope'] = opts.collectionScope.split(',');\n }\n if (opts.filter) {\n body['filter'] = JSON.parse(opts.filter);\n }\n const data = await client.request('PUT', `/v1/${ws}/triggers`, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ntriggersCommand.command('get <id>')\n .description('Get a trigger')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/triggers/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ntriggersCommand.command('list')\n .description('List all triggers')\n .action(async function (this: Command) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/triggers`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ntriggersCommand.command('delete <id>')\n .description('Delete a trigger')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/triggers/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const batchCommand = new Command('batch')\n .description('Execute atomic batch operations (up to 100 operations)')\n .requiredOption('--operations <json>', 'Operations array (inline JSON or @filename)')\n .action(async function (this: Command, opts: { operations: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const operations = parseData(opts.operations);\n const data = await client.request('POST', `/v1/${ws}/batch`, {\n operations: Array.isArray(operations) ? operations : [operations],\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\nconst VALID_PROVIDERS = 'openai, anthropic, google, mcp';\n\nexport const providersCommand = new Command('providers')\n .description('Import/export tool definitions between LLM providers and Record collections');\n\nprovidersCommand.command('import <provider>')\n .description(`Import tool definitions as collections. Providers: ${VALID_PROVIDERS}`)\n .requiredOption('--tools <json>', 'Tool definitions (inline JSON or @filename)')\n .action(async function (this: Command, provider: string, opts: { tools: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const tools = parseData(opts.tools);\n const data = await client.request('POST', `/v1/${ws}/providers/${provider}/import`, {\n tools: Array.isArray(tools) ? tools : [tools],\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nprovidersCommand.command('export <provider>')\n .description(`Export collections as tool definitions. Providers: ${VALID_PROVIDERS}`)\n .option('--collections <ids>', 'Comma-separated collection IDs (omit for all)')\n .option('--output <file>', 'Write output to file')\n .action(async function (this: Command, provider: string, opts: { collections?: string; output?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const query = opts.collections ? `?collections=${opts.collections}` : '';\n const data = await client.request('GET', `/v1/${ws}/providers/${provider}/export${query}`);\n\n if (opts.output) {\n const { writeFileSync } = await import('fs');\n writeFileSync(opts.output, JSON.stringify(data, null, 2));\n console.log(`Written to ${opts.output}`);\n } else {\n console.log(formatOutput(data, getFormat(this)));\n }\n });\n\nprovidersCommand.command('import-call <provider> <collection>')\n .description(`Create a record from a tool call in provider format. Providers: ${VALID_PROVIDERS}`)\n .requiredOption('--data <json>', 'Tool call data in provider format (inline JSON or @filename)')\n .option('--external-id <id>', 'External ID for idempotent upsert')\n .option('--external-source <source>', 'External source identifier')\n .action(async function (this: Command, provider: string, collection: string, opts: { data: string; externalId?: string; externalSource?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const callData = parseData(opts.data);\n const queryParts: string[] = [];\n if (opts.externalId) queryParts.push(`external_id=${encodeURIComponent(opts.externalId)}`);\n if (opts.externalSource) queryParts.push(`external_source=${encodeURIComponent(opts.externalSource)}`);\n const qs = queryParts.length ? `?${queryParts.join('&')}` : '';\n const data = await client.request('POST', `/v1/${ws}/providers/${provider}/records/${collection}${qs}`, callData);\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { program } from './program.js';\n\nprogram.parse();\n"],"mappings":";;;AAAA,SAAS,WAAAA,iBAAe;;;ACAxB,SAAS,eAAe;;;ACAxB,SAAS,cAAc,eAAe,iBAAiB;AACvD,SAAS,YAAY;AACrB,SAAS,eAAe;AAExB,IAAM,aAAa,KAAK,QAAQ,GAAG,WAAW,OAAO;AACrD,IAAM,cAAc,KAAK,YAAY,aAAa;AAQ3C,SAAS,aAAqB;AACnC,QAAM,WAAW,QAAQ,IAAI,aAAa;AAC1C,QAAM,SAAS,QAAQ,IAAI,eAAe;AAE1C,MAAI;AACF,UAAM,MAAM,aAA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f,OAAO,oBAAoB,cAAc,EACzC,OAAO,qBAAqB,gCAAgC,OAAO;AAEtE,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,iBAAiB;AACpC,QAAQ,WAAW,kBAAkB;AACrC,QAAQ,WAAW,cAAc;AACjC,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,oBAAoB;AACvC,QAAQ,WAAW,yBAAyB;AAC5C,QAAQ,WAAW,kBAAkB;AACrC,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,eAAe;AAClC,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,gBAAgB;;;AkB7BnC,QAAQ,MAAM;","names":["Command","Command","readFileSync","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","writeFileSync","Command"]}
|
|
1
|
+
{"version":3,"sources":["../src/program.ts","../src/commands/login.ts","../src/config.ts","../src/auth.ts","../src/browser-login.ts","../src/commands/logout.ts","../src/commands/workspaces.ts","../src/client.ts","../src/output.ts","../src/helpers.ts","../src/commands/collections.ts","../src/commands/records.ts","../src/commands/query.ts","../src/commands/relationships.ts","../src/commands/query-relationships.ts","../src/commands/attachments.ts","../src/commands/hooks.ts","../src/commands/triggers.ts","../src/commands/batch.ts","../src/commands/providers.ts","../src/index.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { loginCommand } from './commands/login.js';\nimport { logoutCommand } from './commands/logout.js';\nimport { workspacesCommand } from './commands/workspaces.js';\nimport { collectionsCommand } from './commands/collections.js';\nimport { recordsCommand } from './commands/records.js';\nimport { queryCommand } from './commands/query.js';\nimport { relationshipsCommand } from './commands/relationships.js';\nimport { queryRelationshipsCommand } from './commands/query-relationships.js';\nimport { attachmentsCommand } from './commands/attachments.js';\nimport { hooksCommand } from './commands/hooks.js';\nimport { triggersCommand } from './commands/triggers.js';\nimport { batchCommand } from './commands/batch.js';\nimport { providersCommand } from './commands/providers.js';\n\nexport const program = new Command('rekor')\n .description('Rekor CLI — System of Record for AI agents')\n .version('0.1.0')\n .option('--workspace <id>', 'Workspace ID')\n .option('--output <format>', 'Output format: json or table', 'table');\n\nprogram.addCommand(loginCommand);\nprogram.addCommand(logoutCommand);\nprogram.addCommand(workspacesCommand);\nprogram.addCommand(collectionsCommand);\nprogram.addCommand(recordsCommand);\nprogram.addCommand(queryCommand);\nprogram.addCommand(relationshipsCommand);\nprogram.addCommand(queryRelationshipsCommand);\nprogram.addCommand(attachmentsCommand);\nprogram.addCommand(hooksCommand);\nprogram.addCommand(triggersCommand);\nprogram.addCommand(batchCommand);\nprogram.addCommand(providersCommand);\n","import { Command } from 'commander';\nimport { login } from '../auth.js';\nimport { browserLogin } from '../browser-login.js';\n\nexport const loginCommand = new Command('login')\n .description('Authenticate with Rekor')\n .option('--token <token>', 'API key for headless/CI authentication (rec_...)')\n .option('--api-url <url>', 'API base URL')\n .action(async (opts: { token?: string; apiUrl?: string }) => {\n if (opts.token) {\n login(opts.token, opts.apiUrl);\n console.log('Authenticated successfully');\n } else {\n try {\n await browserLogin(opts.apiUrl);\n console.log('Authenticated successfully');\n } catch (err) {\n console.error(\n `Login failed: ${err instanceof Error ? err.message : 'Unknown error'}`,\n );\n process.exit(1);\n }\n }\n });\n","import { readFileSync, writeFileSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { homedir } from 'os';\n\nconst CONFIG_DIR = join(homedir(), '.config', 'rekor');\nconst CONFIG_FILE = join(CONFIG_DIR, 'config.json');\n\nexport interface Config {\n api_url: string;\n token: string;\n default_workspace?: string;\n}\n\nexport function loadConfig(): Config {\n const envToken = process.env['REKOR_TOKEN'];\n const envUrl = process.env['REKOR_API_URL'];\n\n try {\n const raw = readFileSync(CONFIG_FILE, 'utf-8');\n const config = JSON.parse(raw) as Config;\n return {\n ...config,\n token: envToken ?? config.token,\n api_url: envUrl ?? config.api_url,\n };\n } catch {\n return {\n api_url: envUrl ?? 'http://localhost:8787',\n token: envToken ?? '',\n };\n }\n}\n\nexport function saveConfig(config: Config): void {\n mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 });\n writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2), { mode: 0o600 });\n}\n\nexport { CONFIG_DIR, CONFIG_FILE };\n","import { loadConfig, saveConfig } from './config.js';\n\nexport function login(token: string, apiUrl?: string): void {\n const config = loadConfig();\n saveConfig({\n ...config,\n token,\n api_url: apiUrl ?? config.api_url,\n });\n}\n\nexport function isAuthenticated(): boolean {\n const config = loadConfig();\n return !!config.token;\n}\n","import { createServer } from 'node:http';\nimport { randomBytes } from 'node:crypto';\nimport { loadConfig, saveConfig } from './config.js';\n\nconst DEFAULT_APP_URL = 'https://app.rekor.dev';\nconst TIMEOUT_MS = 120_000;\n\nexport async function browserLogin(apiUrl?: string): Promise<void> {\n const open = await import('open').then((m) => m.default);\n\n const state = randomBytes(32).toString('hex');\n const config = loadConfig();\n\n return new Promise<void>((resolve, reject) => {\n const server = createServer((req, res) => {\n const url = new URL(req.url!, `http://127.0.0.1`);\n\n if (url.pathname !== '/callback') {\n res.writeHead(404);\n res.end();\n return;\n }\n\n const token = url.searchParams.get('token');\n const returnedState = url.searchParams.get('state');\n\n if (returnedState !== state) {\n res.writeHead(400, { 'Content-Type': 'text/html' });\n res.end(errorPage('Authentication failed: state mismatch. Please try again.'));\n cleanup();\n reject(new Error('State mismatch — possible CSRF attempt'));\n return;\n }\n\n if (!token) {\n res.writeHead(400, { 'Content-Type': 'text/html' });\n res.end(errorPage('Authentication failed: no token received.'));\n cleanup();\n reject(new Error('No token in callback'));\n return;\n }\n\n saveConfig({\n ...config,\n token,\n api_url: apiUrl ?? config.api_url,\n });\n\n res.writeHead(200, { 'Content-Type': 'text/html' });\n res.end(successPage());\n cleanup();\n resolve();\n });\n\n const timeout = setTimeout(() => {\n cleanup();\n reject(new Error('Login timed out — no response from browser within 2 minutes'));\n }, TIMEOUT_MS);\n\n function cleanup() {\n clearTimeout(timeout);\n server.close();\n }\n\n server.listen(0, '127.0.0.1', () => {\n const addr = server.address();\n if (!addr || typeof addr === 'string') {\n cleanup();\n reject(new Error('Failed to start local server'));\n return;\n }\n\n const port = addr.port;\n const appUrl = process.env['REKOR_APP_URL'] || DEFAULT_APP_URL;\n const authUrl = `${appUrl}/cli-auth?port=${port}&state=${state}`;\n\n console.log('Opening browser for authentication...');\n console.log(`If the browser doesn't open, visit: ${authUrl}`);\n\n open(authUrl).catch(() => {\n console.log('Could not open browser automatically.');\n });\n });\n });\n}\n\nfunction successPage(): string {\n return `<!DOCTYPE html>\n<html>\n<head><title>Rekor CLI</title></head>\n<body style=\"font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background: #fafafa;\">\n <div style=\"text-align: center;\">\n <h1 style=\"font-size: 1.25rem; font-weight: 600;\">Authentication successful</h1>\n <p style=\"color: #666; margin-top: 0.5rem;\">You can close this tab and return to your terminal.</p>\n </div>\n</body>\n</html>`;\n}\n\nfunction errorPage(message: string): string {\n return `<!DOCTYPE html>\n<html>\n<head><title>Rekor CLI</title></head>\n<body style=\"font-family: system-ui, sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background: #fafafa;\">\n <div style=\"text-align: center;\">\n <h1 style=\"font-size: 1.25rem; font-weight: 600; color: #dc2626;\">Authentication failed</h1>\n <p style=\"color: #666; margin-top: 0.5rem;\">${message}</p>\n </div>\n</body>\n</html>`;\n}\n","import { Command } from 'commander';\nimport { loadConfig, saveConfig } from '../config.js';\n\nexport const logoutCommand = new Command('logout')\n .description('Remove stored authentication credentials')\n .action(() => {\n const config = loadConfig();\n saveConfig({ ...config, token: '' });\n console.log('Logged out successfully');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getFormat } from '../helpers.js';\n\nexport const workspacesCommand = new Command('workspaces')\n .description('Manage workspaces');\n\nworkspacesCommand.command('list')\n .description('List all workspaces')\n .action(async function (this: Command) {\n const client = new ApiClient();\n const data = await client.request('GET', '/v1/workspaces');\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('get <id>')\n .description('Get a workspace')\n .action(async function (this: Command, id: string) {\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/workspaces/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('create <id>')\n .description('Create a workspace')\n .requiredOption('--name <name>', 'Workspace name')\n .option('--description <desc>', 'Description')\n .action(async function (this: Command, id: string, opts: { name: string; description?: string }) {\n const client = new ApiClient();\n const data = await client.request('PUT', `/v1/workspaces/${id}`, {\n name: opts.name,\n description: opts.description,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('delete <id>')\n .description('Delete a workspace')\n .action(async (_id: string) => {\n const client = new ApiClient();\n await client.request('DELETE', `/v1/workspaces/${_id}`);\n console.log('Deleted');\n });\n\n// --- Environment commands ---\n\nworkspacesCommand.command('create-preview <production-id>')\n .description('Create a preview workspace linked to a production workspace')\n .requiredOption('--name <name>', 'Preview workspace name')\n .option('--description <desc>', 'Description')\n .action(async function (this: Command, productionId: string, opts: { name: string; description?: string }) {\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${productionId}/preview`, {\n name: opts.name,\n description: opts.description,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('list-previews <production-id>')\n .description('List preview workspaces for a production workspace')\n .action(async function (this: Command, productionId: string) {\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${productionId}/previews`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('promote <production-id>')\n .description('Promote config from a preview workspace to production (human-only)')\n .requiredOption('--from <preview-id>', 'Source preview workspace ID')\n .option('--dry-run', 'Show what would change without applying')\n .option('--collections <ids>', 'Comma-separated collection IDs to promote', (v: string) => v.split(','))\n .option('--triggers <ids>', 'Comma-separated trigger IDs to promote', (v: string) => v.split(','))\n .option('--hooks <ids>', 'Comma-separated hook IDs to promote', (v: string) => v.split(','))\n .action(async function (\n this: Command,\n productionId: string,\n opts: { from: string; dryRun?: boolean; collections?: string[]; triggers?: string[]; hooks?: string[] },\n ) {\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${productionId}/promote`, {\n source_workspace_id: opts.from,\n dry_run: opts.dryRun ?? false,\n collections: opts.collections,\n triggers: opts.triggers,\n hooks: opts.hooks,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('rollback <production-id>')\n .description('Rollback a promotion (human-only)')\n .requiredOption('--promotion <promotion-id>', 'Promotion ID to rollback')\n .action(async function (this: Command, productionId: string, opts: { promotion: string }) {\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${productionId}/promote/rollback`, {\n promotion_id: opts.promotion,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nworkspacesCommand.command('promotions <production-id>')\n .description('List promotion history for a production workspace')\n .action(async function (this: Command, productionId: string) {\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${productionId}/promotions`);\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { loadConfig } from './config.js';\n\nexport class ApiClient {\n private baseUrl: string;\n private token: string;\n\n constructor() {\n const config = loadConfig();\n this.baseUrl = config.api_url;\n this.token = config.token;\n }\n\n async request<T = unknown>(method: string, path: string, body?: unknown): Promise<T> {\n const res = await fetch(`${this.baseUrl}${path}`, {\n method,\n headers: {\n 'Authorization': `Bearer ${this.token}`,\n 'Content-Type': 'application/json',\n },\n body: body ? JSON.stringify(body) : undefined,\n });\n\n const json = await res.json() as { data?: T; error?: { message: string } };\n if (!res.ok) {\n throw new Error(json.error?.message ?? `HTTP ${res.status}`);\n }\n return json.data as T;\n }\n}\n","import chalk from 'chalk';\nimport Table from 'cli-table3';\n\nexport type OutputFormat = 'json' | 'table';\n\nexport function formatOutput(data: unknown, format: OutputFormat): string {\n if (format === 'json') {\n return JSON.stringify(data, null, 2);\n }\n\n if (Array.isArray(data)) {\n return formatTable(data as Record<string, unknown>[]);\n }\n\n if (typeof data === 'object' && data !== null) {\n return formatKeyValue(data as Record<string, unknown>);\n }\n\n return String(data);\n}\n\nfunction formatTable(rows: Record<string, unknown>[]): string {\n if (rows.length === 0) return chalk.dim('No results');\n\n const keys = Object.keys(rows[0]!);\n const table = new Table({ head: keys.map(k => chalk.bold(k)) });\n\n for (const row of rows) {\n table.push(keys.map(k => {\n const val = row[k];\n if (val === null || val === undefined) return '';\n if (typeof val === 'object') return JSON.stringify(val);\n return String(val);\n }));\n }\n\n return table.toString();\n}\n\nfunction formatKeyValue(obj: Record<string, unknown>): string {\n const table = new Table();\n for (const [key, value] of Object.entries(obj)) {\n const displayValue = typeof value === 'object' ? JSON.stringify(value) : String(value ?? '');\n table.push({ [chalk.bold(key)]: displayValue });\n }\n return table.toString();\n}\n","import { readFileSync } from 'fs';\nimport { Command } from 'commander';\nimport { type OutputFormat } from './output.js';\n\nexport function parseData(data: string): Record<string, unknown> {\n if (data.startsWith('@')) {\n const content = readFileSync(data.slice(1), 'utf-8');\n return JSON.parse(content) as Record<string, unknown>;\n }\n return JSON.parse(data) as Record<string, unknown>;\n}\n\nexport function getWorkspace(cmd: Command): string {\n // Walk up the command chain to find --workspace on the root program\n let current: Command | null = cmd;\n while (current) {\n const ws = current.opts().workspace as string | undefined;\n if (ws) return ws;\n current = current.parent;\n }\n console.error('Error: --workspace is required');\n return process.exit(1);\n}\n\nexport function getFormat(cmd: Command): OutputFormat {\n return (cmd.parent?.parent?.opts().output ?? cmd.parent?.opts().output ?? 'table') as OutputFormat;\n}\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const collectionsCommand = new Command('collections')\n .description('Manage collections');\n\ncollectionsCommand.command('list')\n .description('List all collections in a workspace')\n .action(async function (this: Command) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/collections`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ncollectionsCommand.command('get <id>')\n .description('Get a collection')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/collections/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ncollectionsCommand.command('upsert <id>')\n .description('Create or update a collection')\n .requiredOption('--name <name>', 'Collection name')\n .option('--description <desc>', 'Description')\n .option('--schema <json>', 'JSON Schema (inline JSON or @filename)')\n .option('--icon <icon>', 'Icon name')\n .option('--color <color>', 'Hex color')\n .option('--sources <json>', 'External sources config (inline JSON or @filename)')\n .action(async function (this: Command, id: string, opts: { name: string; description?: string; schema?: string; icon?: string; color?: string; sources?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = { name: opts.name };\n if (opts.description) body['description'] = opts.description;\n if (opts.schema) body['json_schema'] = parseData(opts.schema);\n if (opts.icon) body['icon'] = opts.icon;\n if (opts.color) body['color'] = opts.color;\n if (opts.sources) body['sources'] = parseData(opts.sources);\n const data = await client.request('PUT', `/v1/${ws}/collections/${id}`, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ncollectionsCommand.command('delete <id>')\n .description('Delete a collection')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/collections/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const recordsCommand = new Command('records')\n .description('Manage records');\n\nrecordsCommand.command('upsert <collection>')\n .description('Create or update a record')\n .requiredOption('--data <json>', 'Record data (inline JSON or @filename)')\n .option('--id <id>', 'Internal record ID (UUID) to update a known record')\n .option('--external-id <id>', 'External/agent-supplied ID for idempotent upsert')\n .option('--external-source <source>', 'Source system for external_id (e.g. stripe)')\n .action(async function (this: Command, collection: string, opts: { data: string; id?: string; externalId?: string; externalSource?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = { data: parseData(opts.data) };\n if (opts.externalId) body['external_id'] = opts.externalId;\n if (opts.externalSource) body['external_source'] = opts.externalSource;\n const path = opts.id\n ? `/v1/${ws}/records/${collection}/${opts.id}`\n : `/v1/${ws}/records/${collection}`;\n const data = await client.request('PUT', path, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrecordsCommand.command('get <collection> <id>')\n .description('Get a record by ID')\n .action(async function (this: Command, collection: string, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrecordsCommand.command('delete <collection> <id>')\n .description('Delete a record')\n .action(async function (this: Command, collection: string, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/records/${collection}/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const queryCommand = new Command('query')\n .description('Query records in a collection')\n .argument('<collection>', 'Collection to query')\n .option('--filter <json>', 'Filter expression (JSON)')\n .option('--sort <json>', 'Sort expression (JSON)')\n .option('--limit <n>', 'Max results', '50')\n .option('--offset <n>', 'Skip results', '0')\n .option('--fields <fields>', 'Comma-separated list of fields to return')\n .option('--aggregate', 'Run aggregation query instead of search')\n .option('--aggregations <json>', 'Aggregation expressions (JSON array)')\n .option('--group-by <fields>', 'Comma-separated fields to group by')\n .action(async function (this: Command, collection: string, opts: { filter?: string; sort?: string; limit: string; offset: string; fields?: string; aggregate?: boolean; aggregations?: string; groupBy?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n\n if (opts.aggregate) {\n const body: Record<string, unknown> = {};\n if (opts.aggregations) body.aggregations = JSON.parse(opts.aggregations);\n if (opts.groupBy) body.group_by = opts.groupBy.split(',');\n if (opts.filter) body.filter = JSON.parse(opts.filter);\n if (opts.sort) body.sort = JSON.parse(opts.sort);\n body.limit = parseInt(opts.limit);\n body.offset = parseInt(opts.offset);\n\n const data = await client.request('POST', `/v1/${ws}/records/${collection}/aggregate`, body);\n console.log(formatOutput(data, getFormat(this)));\n } else {\n const params = new URLSearchParams();\n if (opts.filter) params.set('filter', opts.filter);\n if (opts.sort) params.set('sort', opts.sort);\n params.set('limit', opts.limit);\n params.set('offset', opts.offset);\n if (opts.fields) params.set('fields', opts.fields);\n const data = await client.request('GET', `/v1/${ws}/records/${collection}?${params.toString()}`);\n console.log(formatOutput(data, getFormat(this)));\n }\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const relationshipsCommand = new Command('relationships')\n .description('Manage relationships between records');\n\nrelationshipsCommand.command('upsert')\n .description('Create or update a relationship')\n .requiredOption('--source <collection/id>', 'Source record (collection/id)')\n .requiredOption('--target <collection/id>', 'Target record (collection/id)')\n .requiredOption('--type <type>', 'Relationship type')\n .option('--id <id>', 'Relationship ID')\n .option('--data <json>', 'Relationship metadata (inline JSON or @filename)')\n .action(async function (this: Command, opts: { source: string; target: string; type: string; id?: string; data?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const [sourceCollection, sourceId] = opts.source.split('/');\n const [targetCollection, targetId] = opts.target.split('/');\n const body: Record<string, unknown> = {\n rel_type: opts.type,\n source_collection: sourceCollection,\n source_id: sourceId,\n target_collection: targetCollection,\n target_id: targetId,\n };\n if (opts.id) body['id'] = opts.id;\n if (opts.data) body['data'] = parseData(opts.data);\n const path = opts.id ? `/v1/${ws}/relationships/${opts.id}` : `/v1/${ws}/relationships`;\n const data = await client.request('PUT', path, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrelationshipsCommand.command('get <id>')\n .description('Get a relationship by ID')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/relationships/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nrelationshipsCommand.command('delete <id>')\n .description('Delete a relationship')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/relationships/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const queryRelationshipsCommand = new Command('query-relationships')\n .description('Query related records')\n .argument('<collection>', 'Collection of the source record')\n .argument('<id>', 'Source record ID')\n .option('--type <type>', 'Filter by relationship type')\n .option('--direction <dir>', 'Direction: outgoing, incoming, or both', 'both')\n .option('--limit <n>', 'Max results', '50')\n .option('--offset <n>', 'Skip results', '0')\n .action(async function (this: Command, collection: string, id: string, opts: { type?: string; direction: string; limit: string; offset: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const params = new URLSearchParams();\n if (opts.type) params.set('rel_type', opts.type);\n // Map user-friendly direction names to backend API terms\n const directionMap: Record<string, string> = { outgoing: 'source', incoming: 'target', both: 'both' };\n params.set('direction', directionMap[opts.direction] ?? opts.direction);\n params.set('limit', opts.limit);\n params.set('offset', opts.offset);\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}/related?${params.toString()}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const attachmentsCommand = new Command('attachments')\n .description('Manage record attachments');\n\nattachmentsCommand.command('upload <collection> <id>')\n .description('Get a presigned upload URL for a record attachment')\n .requiredOption('--filename <name>', 'File name or path (e.g. docs/guide.md)')\n .option('--content-type <type>', 'MIME type', 'application/octet-stream')\n .action(async function (this: Command, collection: string, id: string, opts: { filename: string; contentType: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('POST', `/v1/${ws}/records/${collection}/${id}/attachments`, {\n filename: opts.filename,\n content_type: opts.contentType,\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nattachmentsCommand.command('url <collection> <id>')\n .description('Get a presigned download URL for an attachment')\n .requiredOption('--filename <name>', 'File name or path (e.g. docs/guide.md)')\n .action(async function (this: Command, collection: string, id: string, opts: { filename: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}/attachments/${opts.filename}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nattachmentsCommand.command('list <collection> <id>')\n .description('List attachments for a record')\n .option('--prefix <path>', 'Filter by path prefix (e.g. docs/)')\n .action(async function (this: Command, collection: string, id: string, opts: { prefix?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const query = opts.prefix ? `?prefix=${encodeURIComponent(opts.prefix)}` : '';\n const data = await client.request('GET', `/v1/${ws}/records/${collection}/${id}/attachments${query}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nattachmentsCommand.command('delete <collection> <id> <attachment-id>')\n .description('Delete an attachment')\n .action(async function (this: Command, collection: string, id: string, attachmentId: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/records/${collection}/${id}/attachments/${attachmentId}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const hooksCommand = new Command('hooks')\n .description('Manage inbound webhook endpoints');\n\nhooksCommand.command('create')\n .description('Create a new inbound hook')\n .requiredOption('--name <name>', 'Hook name')\n .requiredOption('--secret <secret>', 'HMAC shared secret')\n .option('--collection-scope <collections>', 'Comma-separated collection scope')\n .action(async function (this: Command, opts: { name: string; secret: string; collectionScope?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = {\n name: opts.name,\n secret: opts.secret,\n enabled: true,\n };\n if (opts.collectionScope) {\n body['collection_scope'] = opts.collectionScope.split(',');\n }\n const data = await client.request('PUT', `/v1/${ws}/hooks`, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nhooksCommand.command('get <id>')\n .description('Get a hook')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/hooks/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nhooksCommand.command('list')\n .description('List all hooks')\n .action(async function (this: Command) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/hooks`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\nhooksCommand.command('delete <id>')\n .description('Delete a hook')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/hooks/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { getWorkspace, getFormat } from '../helpers.js';\n\nexport const triggersCommand = new Command('triggers')\n .description('Manage outbound triggers');\n\ntriggersCommand.command('create')\n .description('Create an outbound trigger')\n .requiredOption('--name <name>', 'Trigger name')\n .requiredOption('--url <url>', 'Target URL')\n .requiredOption('--secret <secret>', 'HMAC signing secret')\n .requiredOption('--events <events>', 'Comma-separated event types')\n .option('--collection-scope <collections>', 'Comma-separated collection scope')\n .option('--filter <json>', 'Filter expression (JSON)')\n .action(async function (this: Command, opts: { name: string; url: string; secret: string; events: string; collectionScope?: string; filter?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const body: Record<string, unknown> = {\n name: opts.name,\n url: opts.url,\n secret: opts.secret,\n events: opts.events.split(','),\n enabled: true,\n };\n if (opts.collectionScope) {\n body['collection_scope'] = opts.collectionScope.split(',');\n }\n if (opts.filter) {\n body['filter'] = JSON.parse(opts.filter);\n }\n const data = await client.request('PUT', `/v1/${ws}/triggers`, body);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ntriggersCommand.command('get <id>')\n .description('Get a trigger')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/triggers/${id}`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ntriggersCommand.command('list')\n .description('List all triggers')\n .action(async function (this: Command) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const data = await client.request('GET', `/v1/${ws}/triggers`);\n console.log(formatOutput(data, getFormat(this)));\n });\n\ntriggersCommand.command('delete <id>')\n .description('Delete a trigger')\n .action(async function (this: Command, id: string) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n await client.request('DELETE', `/v1/${ws}/triggers/${id}`);\n console.log('Deleted');\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\n\nexport const batchCommand = new Command('batch')\n .description('Execute atomic batch operations (up to 100 operations)')\n .requiredOption('--operations <json>', 'Operations array (inline JSON or @filename)')\n .action(async function (this: Command, opts: { operations: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const operations = parseData(opts.operations);\n const data = await client.request('POST', `/v1/${ws}/batch`, {\n operations: Array.isArray(operations) ? operations : [operations],\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { Command } from 'commander';\nimport { ApiClient } from '../client.js';\nimport { formatOutput } from '../output.js';\nimport { parseData, getWorkspace, getFormat } from '../helpers.js';\nconst VALID_PROVIDERS = 'openai, anthropic, google, mcp';\n\nexport const providersCommand = new Command('providers')\n .description('Import/export tool definitions between LLM providers and Record collections');\n\nprovidersCommand.command('import <provider>')\n .description(`Import tool definitions as collections. Providers: ${VALID_PROVIDERS}`)\n .requiredOption('--tools <json>', 'Tool definitions (inline JSON or @filename)')\n .action(async function (this: Command, provider: string, opts: { tools: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const tools = parseData(opts.tools);\n const data = await client.request('POST', `/v1/${ws}/providers/${provider}/import`, {\n tools: Array.isArray(tools) ? tools : [tools],\n });\n console.log(formatOutput(data, getFormat(this)));\n });\n\nprovidersCommand.command('export <provider>')\n .description(`Export collections as tool definitions. Providers: ${VALID_PROVIDERS}`)\n .option('--collections <ids>', 'Comma-separated collection IDs (omit for all)')\n .option('--output <file>', 'Write output to file')\n .action(async function (this: Command, provider: string, opts: { collections?: string; output?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const query = opts.collections ? `?collections=${opts.collections}` : '';\n const data = await client.request('GET', `/v1/${ws}/providers/${provider}/export${query}`);\n\n if (opts.output) {\n const { writeFileSync } = await import('fs');\n writeFileSync(opts.output, JSON.stringify(data, null, 2));\n console.log(`Written to ${opts.output}`);\n } else {\n console.log(formatOutput(data, getFormat(this)));\n }\n });\n\nprovidersCommand.command('import-call <provider> <collection>')\n .description(`Create a record from a tool call in provider format. Providers: ${VALID_PROVIDERS}`)\n .requiredOption('--data <json>', 'Tool call data in provider format (inline JSON or @filename)')\n .option('--external-id <id>', 'External ID for idempotent upsert')\n .option('--external-source <source>', 'External source identifier')\n .action(async function (this: Command, provider: string, collection: string, opts: { data: string; externalId?: string; externalSource?: string }) {\n const ws = getWorkspace(this);\n const client = new ApiClient();\n const callData = parseData(opts.data);\n const queryParts: string[] = [];\n if (opts.externalId) queryParts.push(`external_id=${encodeURIComponent(opts.externalId)}`);\n if (opts.externalSource) queryParts.push(`external_source=${encodeURIComponent(opts.externalSource)}`);\n const qs = queryParts.length ? `?${queryParts.join('&')}` : '';\n const data = await client.request('POST', `/v1/${ws}/providers/${provider}/records/${collection}${qs}`, callData);\n console.log(formatOutput(data, getFormat(this)));\n });\n","import { program } from './program.js';\n\nprogram.parse();\n"],"mappings":";;;AAAA,SAAS,WAAAA,iBAAe;;;ACAxB,SAAS,eAAe;;;ACAxB,SAAS,cA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,KAAK,eAAe,mBAAmB,KAAK,UAAU,CAAC,EAAE;AACzF,MAAI,KAAK,eAAgB,YAAW,KAAK,mBAAmB,mBAAmB,KAAK,cAAc,CAAC,EAAE;AACrG,QAAM,KAAK,WAAW,SAAS,IAAI,WAAW,KAAK,GAAG,CAAC,KAAK;AAC5D,QAAM,OAAO,MAAM,OAAO,QAAQ,QAAQ,OAAO,EAAE,cAAc,QAAQ,YAAY,UAAU,GAAG,EAAE,IAAI,QAAQ;AAChH,UAAQ,IAAI,aAAa,MAAM,UAAU,IAAI,CAAC,CAAC;AACjD,CAAC;;;AnBzCI,IAAM,UAAU,IAAIC,UAAQ,OAAO,EACvC,YAAY,iDAA4C,EACxD,QAAQ,OAAO,EACf,OAAO,oBAAoB,cAAc,EACzC,OAAO,qBAAqB,gCAAgC,OAAO;AAEtE,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,aAAa;AAChC,QAAQ,WAAW,iBAAiB;AACpC,QAAQ,WAAW,kBAAkB;AACrC,QAAQ,WAAW,cAAc;AACjC,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,oBAAoB;AACvC,QAAQ,WAAW,yBAAyB;AAC5C,QAAQ,WAAW,kBAAkB;AACrC,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,eAAe;AAClC,QAAQ,WAAW,YAAY;AAC/B,QAAQ,WAAW,gBAAgB;;;AoB/BnC,QAAQ,MAAM;","names":["Command","Command","Command","Command","readFileSync","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","Command","writeFileSync","Command"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rekor-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rekor": "dist/index.js"
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"chalk": "^5.4.1",
|
|
19
19
|
"cli-table3": "^0.6.5",
|
|
20
|
-
"commander": "^13.1.0"
|
|
20
|
+
"commander": "^13.1.0",
|
|
21
|
+
"open": "^11.0.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/node": "^25.5.0",
|