@cortex-context/cli 0.0.6 → 0.0.7
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 +30 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18225,10 +18225,13 @@ async function deployLocalStack(workspacePath) {
|
|
|
18225
18225
|
(0, import_fs5.cpSync)(templatePath, destPath);
|
|
18226
18226
|
}
|
|
18227
18227
|
try {
|
|
18228
|
-
(0, import_child_process.execSync)(
|
|
18229
|
-
|
|
18230
|
-
|
|
18231
|
-
|
|
18228
|
+
(0, import_child_process.execSync)(
|
|
18229
|
+
`docker compose --project-name cortex-local -f "${destPath}" up -d`,
|
|
18230
|
+
{
|
|
18231
|
+
cwd: workspacePath,
|
|
18232
|
+
stdio: "inherit"
|
|
18233
|
+
}
|
|
18234
|
+
);
|
|
18232
18235
|
return { started: true };
|
|
18233
18236
|
} catch (err) {
|
|
18234
18237
|
return {
|
|
@@ -28027,6 +28030,8 @@ async function serveCommand() {
|
|
|
28027
28030
|
|
|
28028
28031
|
// src/commands/server.ts
|
|
28029
28032
|
var import_os4 = require("os");
|
|
28033
|
+
var import_fs12 = require("fs");
|
|
28034
|
+
var import_path13 = require("path");
|
|
28030
28035
|
var import_prompts3 = __toESM(require_prompts3());
|
|
28031
28036
|
var CORTEX_URL2 = "http://localhost:8082";
|
|
28032
28037
|
var NEO4J_URL = "http://localhost:7474";
|
|
@@ -28039,7 +28044,9 @@ async function serverCommand(options) {
|
|
|
28039
28044
|
)
|
|
28040
28045
|
);
|
|
28041
28046
|
console.log("");
|
|
28042
|
-
const
|
|
28047
|
+
const defaultDir = (0, import_path13.join)((0, import_os4.homedir)(), ".cortex-context");
|
|
28048
|
+
const workDir = options.dir ?? defaultDir;
|
|
28049
|
+
(0, import_fs12.mkdirSync)(workDir, { recursive: true });
|
|
28043
28050
|
console.log(source_default.bold(" Step 1: Docker"));
|
|
28044
28051
|
const dockerReady = isDockerAvailable();
|
|
28045
28052
|
if (dockerReady) {
|
|
@@ -28187,8 +28194,8 @@ async function serverCommand(options) {
|
|
|
28187
28194
|
}
|
|
28188
28195
|
|
|
28189
28196
|
// src/commands/uninstall.ts
|
|
28190
|
-
var
|
|
28191
|
-
var
|
|
28197
|
+
var import_path14 = require("path");
|
|
28198
|
+
var import_fs13 = require("fs");
|
|
28192
28199
|
var import_prompts4 = __toESM(require_prompts3());
|
|
28193
28200
|
var CORTEX_SKILLS = [
|
|
28194
28201
|
"cortex-research",
|
|
@@ -28201,20 +28208,20 @@ async function uninstallCommand(options) {
|
|
|
28201
28208
|
console.log(source_default.bold.cyan(" \u25C6 Cortex Context \u2014 Uninstall"));
|
|
28202
28209
|
console.log(source_default.dim(" Removes Cortex Context from your workspace."));
|
|
28203
28210
|
console.log("");
|
|
28204
|
-
const workspacePath = (0,
|
|
28211
|
+
const workspacePath = (0, import_path14.resolve)(options.workspace ?? process.cwd());
|
|
28205
28212
|
console.log(source_default.dim(` Workspace: ${workspacePath}`));
|
|
28206
28213
|
console.log("");
|
|
28207
|
-
const skillsPath = (0,
|
|
28214
|
+
const skillsPath = (0, import_path14.join)(workspacePath, ".github", "skills");
|
|
28208
28215
|
const skillsToRemove = CORTEX_SKILLS.filter(
|
|
28209
|
-
(s) => (0,
|
|
28216
|
+
(s) => (0, import_fs13.existsSync)((0, import_path14.join)(skillsPath, s))
|
|
28210
28217
|
);
|
|
28211
|
-
const hasMcp = (0,
|
|
28212
|
-
const hasCursorMcp = (0,
|
|
28213
|
-
const hasHook = (0,
|
|
28214
|
-
(0,
|
|
28218
|
+
const hasMcp = (0, import_fs13.existsSync)((0, import_path14.join)(workspacePath, ".vscode", "mcp.json"));
|
|
28219
|
+
const hasCursorMcp = (0, import_fs13.existsSync)((0, import_path14.join)(workspacePath, ".cursor", "mcp.json"));
|
|
28220
|
+
const hasHook = (0, import_fs13.existsSync)(
|
|
28221
|
+
(0, import_path14.join)(workspacePath, ".git", "hooks", "post-commit")
|
|
28215
28222
|
);
|
|
28216
|
-
const hasConfig = (0,
|
|
28217
|
-
(0,
|
|
28223
|
+
const hasConfig = (0, import_fs13.existsSync)(
|
|
28224
|
+
(0, import_path14.join)(process.env["HOME"] ?? "~", ".cortex-context", "config.json")
|
|
28218
28225
|
);
|
|
28219
28226
|
console.log(source_default.bold(" Will remove:"));
|
|
28220
28227
|
if (hasMcp) {
|
|
@@ -28313,9 +28320,9 @@ async function uninstallCommand(options) {
|
|
|
28313
28320
|
}
|
|
28314
28321
|
if (!options.keepSkills) {
|
|
28315
28322
|
for (const skill of skillsToRemove) {
|
|
28316
|
-
const skillDir = (0,
|
|
28323
|
+
const skillDir = (0, import_path14.join)(skillsPath, skill);
|
|
28317
28324
|
try {
|
|
28318
|
-
(0,
|
|
28325
|
+
(0, import_fs13.rmSync)(skillDir, { recursive: true, force: true });
|
|
28319
28326
|
console.log(source_default.green(` \u2713 .github/skills/${skill}/ \u2014 removed`));
|
|
28320
28327
|
removed++;
|
|
28321
28328
|
} catch (err) {
|
|
@@ -28329,12 +28336,12 @@ async function uninstallCommand(options) {
|
|
|
28329
28336
|
}
|
|
28330
28337
|
}
|
|
28331
28338
|
if (!options.keepHook && hasHook) {
|
|
28332
|
-
const hookPath = (0,
|
|
28339
|
+
const hookPath = (0, import_path14.join)(workspacePath, ".git", "hooks", "post-commit");
|
|
28333
28340
|
try {
|
|
28334
28341
|
const { readFileSync: readFileSync7 } = await import("fs");
|
|
28335
28342
|
const hookContent = readFileSync7(hookPath, "utf-8");
|
|
28336
28343
|
if (hookContent.includes("cortex-context")) {
|
|
28337
|
-
(0,
|
|
28344
|
+
(0, import_fs13.unlinkSync)(hookPath);
|
|
28338
28345
|
console.log(source_default.green(" \u2713 .git/hooks/post-commit \u2014 removed"));
|
|
28339
28346
|
removed++;
|
|
28340
28347
|
} else {
|
|
@@ -28383,10 +28390,10 @@ async function uninstallCommand(options) {
|
|
|
28383
28390
|
}
|
|
28384
28391
|
|
|
28385
28392
|
// src/cli.ts
|
|
28386
|
-
var
|
|
28387
|
-
var
|
|
28393
|
+
var import_fs14 = require("fs");
|
|
28394
|
+
var import_path15 = require("path");
|
|
28388
28395
|
var pkg = JSON.parse(
|
|
28389
|
-
(0,
|
|
28396
|
+
(0, import_fs14.readFileSync)((0, import_path15.join)(__dirname, "..", "package.json"), "utf-8")
|
|
28390
28397
|
);
|
|
28391
28398
|
function createCli() {
|
|
28392
28399
|
const program3 = new Command();
|