@cortexmemory/cli 0.1.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/README.md +325 -0
- package/dist/commands/conversations.d.ts +16 -0
- package/dist/commands/conversations.d.ts.map +1 -0
- package/dist/commands/conversations.js +421 -0
- package/dist/commands/conversations.js.map +1 -0
- package/dist/commands/convex.d.ts +17 -0
- package/dist/commands/convex.d.ts.map +1 -0
- package/dist/commands/convex.js +442 -0
- package/dist/commands/convex.js.map +1 -0
- package/dist/commands/db.d.ts +16 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +371 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/dev.d.ts +16 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +558 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/facts.d.ts +17 -0
- package/dist/commands/facts.d.ts.map +1 -0
- package/dist/commands/facts.js +386 -0
- package/dist/commands/facts.js.map +1 -0
- package/dist/commands/memory.d.ts +18 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +486 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/setup.d.ts +14 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +494 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/spaces.d.ts +18 -0
- package/dist/commands/spaces.d.ts.map +1 -0
- package/dist/commands/spaces.js +553 -0
- package/dist/commands/spaces.js.map +1 -0
- package/dist/commands/users.d.ts +18 -0
- package/dist/commands/users.d.ts.map +1 -0
- package/dist/commands/users.js +486 -0
- package/dist/commands/users.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +144 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/__tests__/config.test.d.ts +5 -0
- package/dist/utils/__tests__/config.test.d.ts.map +1 -0
- package/dist/utils/__tests__/config.test.js +127 -0
- package/dist/utils/__tests__/config.test.js.map +1 -0
- package/dist/utils/__tests__/formatting.test.d.ts +5 -0
- package/dist/utils/__tests__/formatting.test.d.ts.map +1 -0
- package/dist/utils/__tests__/formatting.test.js +132 -0
- package/dist/utils/__tests__/formatting.test.js.map +1 -0
- package/dist/utils/__tests__/validation.test.d.ts +5 -0
- package/dist/utils/__tests__/validation.test.d.ts.map +1 -0
- package/dist/utils/__tests__/validation.test.js +207 -0
- package/dist/utils/__tests__/validation.test.js.map +1 -0
- package/dist/utils/client.d.ts +42 -0
- package/dist/utils/client.d.ts.map +1 -0
- package/dist/utils/client.js +108 -0
- package/dist/utils/client.js.map +1 -0
- package/dist/utils/config.d.ts +67 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +261 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/formatting.d.ts +81 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +239 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/validation.d.ts +83 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +243 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +72 -0
- package/templates/.cortexrc.template +15 -0
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convex Deployment Management Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for managing Convex deployments:
|
|
5
|
+
* - deploy: Deploy schema updates
|
|
6
|
+
* - status: Check deployment status
|
|
7
|
+
* - logs: View logs
|
|
8
|
+
* - update-sdk: Update SDK version
|
|
9
|
+
* - schema: Schema operations
|
|
10
|
+
*/
|
|
11
|
+
import ora from "ora";
|
|
12
|
+
import { spawn } from "child_process";
|
|
13
|
+
import { resolveConfig } from "../utils/config.js";
|
|
14
|
+
import { getDeploymentInfo } from "../utils/client.js";
|
|
15
|
+
import { printSuccess, printError, printWarning, printSection, printInfo, } from "../utils/formatting.js";
|
|
16
|
+
import pc from "picocolors";
|
|
17
|
+
/**
|
|
18
|
+
* Execute a command and return the output
|
|
19
|
+
*/
|
|
20
|
+
async function execCommand(command, args, options) {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
let stdout = "";
|
|
23
|
+
let stderr = "";
|
|
24
|
+
const child = spawn(command, args, {
|
|
25
|
+
cwd: options?.cwd,
|
|
26
|
+
shell: true,
|
|
27
|
+
});
|
|
28
|
+
child.stdout?.on("data", (data) => {
|
|
29
|
+
const str = data.toString();
|
|
30
|
+
stdout += str;
|
|
31
|
+
if (!options?.quiet) {
|
|
32
|
+
process.stdout.write(str);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
child.stderr?.on("data", (data) => {
|
|
36
|
+
const str = data.toString();
|
|
37
|
+
stderr += str;
|
|
38
|
+
if (!options?.quiet) {
|
|
39
|
+
process.stderr.write(str);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
child.on("close", (code) => {
|
|
43
|
+
resolve({ stdout, stderr, exitCode: code ?? 0 });
|
|
44
|
+
});
|
|
45
|
+
child.on("error", (error) => {
|
|
46
|
+
stderr += error.message;
|
|
47
|
+
resolve({ stdout, stderr, exitCode: 1 });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Execute a command with live output
|
|
53
|
+
*/
|
|
54
|
+
async function execCommandLive(command, args, options) {
|
|
55
|
+
return new Promise((resolve) => {
|
|
56
|
+
const child = spawn(command, args, {
|
|
57
|
+
cwd: options?.cwd,
|
|
58
|
+
stdio: "inherit",
|
|
59
|
+
shell: true,
|
|
60
|
+
});
|
|
61
|
+
child.on("close", (code) => {
|
|
62
|
+
resolve(code ?? 0);
|
|
63
|
+
});
|
|
64
|
+
child.on("error", () => {
|
|
65
|
+
resolve(1);
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Register Convex management commands
|
|
71
|
+
*/
|
|
72
|
+
export function registerConvexCommands(program, config) {
|
|
73
|
+
const convex = program
|
|
74
|
+
.command("convex")
|
|
75
|
+
.description("Manage Convex deployments");
|
|
76
|
+
// convex status
|
|
77
|
+
convex
|
|
78
|
+
.command("status")
|
|
79
|
+
.description("Check Convex deployment status")
|
|
80
|
+
.action(async () => {
|
|
81
|
+
const globalOpts = program.opts();
|
|
82
|
+
const spinner = ora("Checking deployment status...").start();
|
|
83
|
+
try {
|
|
84
|
+
const info = getDeploymentInfo(config, globalOpts);
|
|
85
|
+
spinner.stop();
|
|
86
|
+
printSection("Convex Deployment Status", {
|
|
87
|
+
URL: info.url,
|
|
88
|
+
Deployment: info.deployment ?? "-",
|
|
89
|
+
"Deploy Key": info.hasKey ? "✓ Configured" : "✗ Not set",
|
|
90
|
+
Mode: info.isLocal ? "Local" : "Cloud",
|
|
91
|
+
});
|
|
92
|
+
// Try to get more info from Convex CLI
|
|
93
|
+
const result = await execCommand("npx", ["convex", "dashboard", "--print-url"], {
|
|
94
|
+
quiet: true,
|
|
95
|
+
});
|
|
96
|
+
if (result.exitCode === 0 && result.stdout.trim()) {
|
|
97
|
+
console.log(` Dashboard: ${result.stdout.trim()}`);
|
|
98
|
+
}
|
|
99
|
+
// Test connection
|
|
100
|
+
const { testConnection } = await import("../utils/client.js");
|
|
101
|
+
const connectionResult = await testConnection(config, globalOpts);
|
|
102
|
+
console.log();
|
|
103
|
+
if (connectionResult.connected) {
|
|
104
|
+
printSuccess(`Connection OK (${connectionResult.latency}ms latency)`);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
printError(`Connection failed: ${connectionResult.error}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
spinner.stop();
|
|
112
|
+
printError(error instanceof Error ? error.message : "Status check failed");
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
// convex deploy
|
|
117
|
+
convex
|
|
118
|
+
.command("deploy")
|
|
119
|
+
.description("Deploy schema and functions to Convex")
|
|
120
|
+
.option("-l, --local", "Deploy to local Convex instance")
|
|
121
|
+
.option("-p, --prod", "Deploy to production")
|
|
122
|
+
.option("--push", "Push without prompts", false)
|
|
123
|
+
.action(async (options) => {
|
|
124
|
+
const globalOpts = program.opts();
|
|
125
|
+
try {
|
|
126
|
+
const info = getDeploymentInfo(config, globalOpts);
|
|
127
|
+
console.log();
|
|
128
|
+
printInfo(`Deploying to ${info.isLocal ? "local" : "cloud"} Convex...`);
|
|
129
|
+
console.log();
|
|
130
|
+
const args = ["convex", "deploy"];
|
|
131
|
+
if (options.local || info.isLocal) {
|
|
132
|
+
const resolved = resolveConfig(config, globalOpts);
|
|
133
|
+
args.push("--url", resolved.url);
|
|
134
|
+
}
|
|
135
|
+
if (options.prod) {
|
|
136
|
+
args.push("--prod");
|
|
137
|
+
}
|
|
138
|
+
if (options.push) {
|
|
139
|
+
args.push("--yes");
|
|
140
|
+
}
|
|
141
|
+
const exitCode = await execCommandLive("npx", args);
|
|
142
|
+
if (exitCode === 0) {
|
|
143
|
+
console.log();
|
|
144
|
+
printSuccess("Deployment complete!");
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
console.log();
|
|
148
|
+
printError("Deployment failed");
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
printError(error instanceof Error ? error.message : "Deploy failed");
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
// convex dev
|
|
158
|
+
convex
|
|
159
|
+
.command("dev")
|
|
160
|
+
.description("Start Convex in development mode")
|
|
161
|
+
.option("-l, --local", "Use local Convex instance")
|
|
162
|
+
.option("--once", "Run once and exit", false)
|
|
163
|
+
.action(async (options) => {
|
|
164
|
+
const globalOpts = program.opts();
|
|
165
|
+
try {
|
|
166
|
+
const info = getDeploymentInfo(config, globalOpts);
|
|
167
|
+
console.log();
|
|
168
|
+
printInfo(`Starting Convex dev server (${info.isLocal ? "local" : "cloud"})...`);
|
|
169
|
+
console.log();
|
|
170
|
+
const args = ["convex", "dev"];
|
|
171
|
+
if (options.local || info.isLocal) {
|
|
172
|
+
const resolved = resolveConfig(config, globalOpts);
|
|
173
|
+
args.push("--url", resolved.url);
|
|
174
|
+
}
|
|
175
|
+
if (options.once) {
|
|
176
|
+
args.push("--once", "--until-success");
|
|
177
|
+
}
|
|
178
|
+
await execCommandLive("npx", args);
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
printError(error instanceof Error ? error.message : "Dev server failed");
|
|
182
|
+
process.exit(1);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
// convex logs
|
|
186
|
+
convex
|
|
187
|
+
.command("logs")
|
|
188
|
+
.description("View Convex deployment logs")
|
|
189
|
+
.option("-l, --local", "View local logs")
|
|
190
|
+
.option("-p, --prod", "View production logs")
|
|
191
|
+
.option("-t, --tail", "Tail logs continuously")
|
|
192
|
+
.option("-n, --lines <number>", "Number of lines to show", "50")
|
|
193
|
+
.action(async (options) => {
|
|
194
|
+
const globalOpts = program.opts();
|
|
195
|
+
try {
|
|
196
|
+
const info = getDeploymentInfo(config, globalOpts);
|
|
197
|
+
console.log();
|
|
198
|
+
printInfo(`Viewing ${info.isLocal ? "local" : "cloud"} logs...`);
|
|
199
|
+
console.log();
|
|
200
|
+
const args = ["convex", "logs"];
|
|
201
|
+
if (options.local || info.isLocal) {
|
|
202
|
+
const resolved = resolveConfig(config, globalOpts);
|
|
203
|
+
args.push("--url", resolved.url);
|
|
204
|
+
}
|
|
205
|
+
if (options.prod) {
|
|
206
|
+
args.push("--prod");
|
|
207
|
+
}
|
|
208
|
+
await execCommandLive("npx", args);
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
printError(error instanceof Error ? error.message : "Logs failed");
|
|
212
|
+
process.exit(1);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
// convex dashboard
|
|
216
|
+
convex
|
|
217
|
+
.command("dashboard")
|
|
218
|
+
.description("Open Convex dashboard in browser")
|
|
219
|
+
.option("-l, --local", "Open local dashboard")
|
|
220
|
+
.option("-p, --prod", "Open production dashboard")
|
|
221
|
+
.action(async (options) => {
|
|
222
|
+
const globalOpts = program.opts();
|
|
223
|
+
try {
|
|
224
|
+
const info = getDeploymentInfo(config, globalOpts);
|
|
225
|
+
printInfo("Opening Convex dashboard...");
|
|
226
|
+
const args = ["convex", "dashboard"];
|
|
227
|
+
if (options.local || info.isLocal) {
|
|
228
|
+
const resolved = resolveConfig(config, globalOpts);
|
|
229
|
+
args.push("--url", resolved.url);
|
|
230
|
+
}
|
|
231
|
+
if (options.prod) {
|
|
232
|
+
args.push("--prod");
|
|
233
|
+
}
|
|
234
|
+
await execCommandLive("npx", args);
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
printError(error instanceof Error ? error.message : "Dashboard failed");
|
|
238
|
+
process.exit(1);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
// convex update-sdk
|
|
242
|
+
convex
|
|
243
|
+
.command("update-sdk")
|
|
244
|
+
.description("Update @cortexmemory/sdk to latest version")
|
|
245
|
+
.option("-v, --version <version>", "Specific version to install")
|
|
246
|
+
.option("--latest", "Install latest version", true)
|
|
247
|
+
.action(async (options) => {
|
|
248
|
+
const spinner = ora("Checking for SDK updates...").start();
|
|
249
|
+
try {
|
|
250
|
+
// Get current version
|
|
251
|
+
let currentVersion = "unknown";
|
|
252
|
+
try {
|
|
253
|
+
const result = await execCommand("npm", ["list", "@cortexmemory/sdk", "--json"], { quiet: true });
|
|
254
|
+
const data = JSON.parse(result.stdout);
|
|
255
|
+
currentVersion =
|
|
256
|
+
data.dependencies?.["@cortexmemory/sdk"]?.version ??
|
|
257
|
+
"not installed";
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
// Ignore errors
|
|
261
|
+
}
|
|
262
|
+
// Get latest version from npm
|
|
263
|
+
let latestVersion = "unknown";
|
|
264
|
+
try {
|
|
265
|
+
const result = await execCommand("npm", ["view", "@cortexmemory/sdk", "version"], { quiet: true });
|
|
266
|
+
latestVersion = result.stdout.trim();
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
// Ignore errors
|
|
270
|
+
}
|
|
271
|
+
spinner.stop();
|
|
272
|
+
console.log();
|
|
273
|
+
printSection("Cortex SDK Version", {
|
|
274
|
+
Current: currentVersion,
|
|
275
|
+
Latest: latestVersion,
|
|
276
|
+
});
|
|
277
|
+
const targetVersion = options.version ?? latestVersion;
|
|
278
|
+
if (currentVersion === targetVersion) {
|
|
279
|
+
printSuccess("SDK is already up to date!");
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
console.log();
|
|
283
|
+
printInfo(`Installing @cortexmemory/sdk@${targetVersion}...`);
|
|
284
|
+
console.log();
|
|
285
|
+
const exitCode = await execCommandLive("npm", [
|
|
286
|
+
"install",
|
|
287
|
+
`@cortexmemory/sdk@${targetVersion}`,
|
|
288
|
+
]);
|
|
289
|
+
if (exitCode === 0) {
|
|
290
|
+
console.log();
|
|
291
|
+
printSuccess(`Updated SDK to version ${targetVersion}`);
|
|
292
|
+
// Check if Convex peer dependency is satisfied
|
|
293
|
+
printInfo("Checking Convex peer dependency...");
|
|
294
|
+
const convexResult = await execCommand("npm", ["list", "convex", "--json"], { quiet: true });
|
|
295
|
+
const convexData = JSON.parse(convexResult.stdout);
|
|
296
|
+
const convexVersion = convexData.dependencies?.convex?.version ?? "not found";
|
|
297
|
+
console.log(` Convex version: ${convexVersion}`);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
printError("SDK update failed");
|
|
301
|
+
process.exit(1);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
spinner.stop();
|
|
306
|
+
printError(error instanceof Error ? error.message : "Update failed");
|
|
307
|
+
process.exit(1);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
// convex schema
|
|
311
|
+
convex
|
|
312
|
+
.command("schema")
|
|
313
|
+
.description("View schema information")
|
|
314
|
+
.action(async () => {
|
|
315
|
+
const spinner = ora("Loading schema info...").start();
|
|
316
|
+
try {
|
|
317
|
+
// Run convex to get schema info
|
|
318
|
+
spinner.stop();
|
|
319
|
+
console.log();
|
|
320
|
+
printInfo("Cortex SDK Schema Tables:");
|
|
321
|
+
console.log();
|
|
322
|
+
const tables = [
|
|
323
|
+
{
|
|
324
|
+
name: "conversations",
|
|
325
|
+
description: "Immutable conversation history",
|
|
326
|
+
layer: "Layer 1a",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
name: "immutable",
|
|
330
|
+
description: "Versioned immutable data store",
|
|
331
|
+
layer: "Layer 1b",
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
name: "mutable",
|
|
335
|
+
description: "Live operational data",
|
|
336
|
+
layer: "Layer 1c",
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
name: "memories",
|
|
340
|
+
description: "Vector-searchable memories",
|
|
341
|
+
layer: "Layer 2",
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "facts",
|
|
345
|
+
description: "LLM-extracted facts",
|
|
346
|
+
layer: "Layer 3",
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
name: "memorySpaces",
|
|
350
|
+
description: "Memory space registry",
|
|
351
|
+
layer: "Coordination",
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "contexts",
|
|
355
|
+
description: "Hierarchical context chains",
|
|
356
|
+
layer: "Coordination",
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: "agents",
|
|
360
|
+
description: "Agent registry (deprecated)",
|
|
361
|
+
layer: "Coordination",
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: "governancePolicies",
|
|
365
|
+
description: "Data retention policies",
|
|
366
|
+
layer: "Governance",
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
name: "governanceEnforcement",
|
|
370
|
+
description: "Enforcement audit log",
|
|
371
|
+
layer: "Governance",
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: "graphSyncQueue",
|
|
375
|
+
description: "Graph sync queue",
|
|
376
|
+
layer: "Sync",
|
|
377
|
+
},
|
|
378
|
+
];
|
|
379
|
+
for (const table of tables) {
|
|
380
|
+
console.log(` ${pc.cyan(table.name.padEnd(22))} ${pc.dim(table.layer.padEnd(14))} ${table.description}`);
|
|
381
|
+
}
|
|
382
|
+
console.log();
|
|
383
|
+
printInfo("Run 'cortex convex dashboard' to view full schema in Convex dashboard");
|
|
384
|
+
}
|
|
385
|
+
catch (error) {
|
|
386
|
+
spinner.stop();
|
|
387
|
+
printError(error instanceof Error ? error.message : "Schema info failed");
|
|
388
|
+
process.exit(1);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
// convex init
|
|
392
|
+
convex
|
|
393
|
+
.command("init")
|
|
394
|
+
.description("Initialize Convex in current project")
|
|
395
|
+
.action(async () => {
|
|
396
|
+
console.log();
|
|
397
|
+
printInfo("Initializing Convex...");
|
|
398
|
+
console.log();
|
|
399
|
+
const exitCode = await execCommandLive("npx", [
|
|
400
|
+
"convex",
|
|
401
|
+
"dev",
|
|
402
|
+
"--once",
|
|
403
|
+
]);
|
|
404
|
+
if (exitCode === 0) {
|
|
405
|
+
console.log();
|
|
406
|
+
printSuccess("Convex initialized successfully!");
|
|
407
|
+
printInfo("Run 'cortex convex dev' to start the development server");
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
console.log();
|
|
411
|
+
printWarning("Convex initialization may require additional setup. Check the output above.");
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
// convex env
|
|
415
|
+
convex
|
|
416
|
+
.command("env")
|
|
417
|
+
.description("Manage environment variables")
|
|
418
|
+
.option("-l, --list", "List environment variables")
|
|
419
|
+
.option("-s, --set <key=value>", "Set environment variable")
|
|
420
|
+
.option("-p, --prod", "Use production environment")
|
|
421
|
+
.action(async (options) => {
|
|
422
|
+
try {
|
|
423
|
+
const args = ["convex", "env"];
|
|
424
|
+
if (options.list) {
|
|
425
|
+
args.push("list");
|
|
426
|
+
}
|
|
427
|
+
else if (options.set) {
|
|
428
|
+
const [key, value] = options.set.split("=");
|
|
429
|
+
args.push("set", key, value);
|
|
430
|
+
}
|
|
431
|
+
if (options.prod) {
|
|
432
|
+
args.push("--prod");
|
|
433
|
+
}
|
|
434
|
+
await execCommandLive("npx", args);
|
|
435
|
+
}
|
|
436
|
+
catch (error) {
|
|
437
|
+
printError(error instanceof Error ? error.message : "Env command failed");
|
|
438
|
+
process.exit(1);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
//# sourceMappingURL=convex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.js","sourceRoot":"","sources":["../../src/commands/convex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,GACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B;;GAEG;AACH,KAAK,UAAU,WAAW,CACxB,OAAe,EACf,IAAc,EACd,OAA2C;IAE3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,MAAM,KAAK,G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,GAAG,EAAE,CAAC;gBACvB,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAC5C,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAC/B,CAAC;YAED,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;gBACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtB,CAAC;YAED,MAAM,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,UAAU,CACR,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAC9D,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database Commands
|
|
3
|
+
*
|
|
4
|
+
* Commands for database-wide operations:
|
|
5
|
+
* - stats: Show database statistics
|
|
6
|
+
* - clear: Clear entire database
|
|
7
|
+
* - backup: Backup database
|
|
8
|
+
* - restore: Restore from backup
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import type { CLIConfig } from "../types.js";
|
|
12
|
+
/**
|
|
13
|
+
* Register database commands
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerDbCommands(program: Command, config: CLIConfig): void;
|
|
16
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../src/commands/db.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EACV,SAAS,EAIV,MAAM,aAAa,CAAC;AAoBrB;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CA6a5E"}
|