memax-cli 0.1.0-alpha.6 → 0.1.0-alpha.8
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/commands/delete.d.ts +1 -1
- package/dist/commands/delete.d.ts.map +1 -1
- package/dist/commands/delete.js +32 -4
- package/dist/commands/delete.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +47 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +32 -2
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/setup.d.ts +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +81 -5
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/sync.d.ts +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +22 -0
- package/dist/commands/sync.js.map +1 -1
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/delete.ts +43 -5
- package/src/commands/mcp.ts +49 -1
- package/src/commands/push.ts +47 -2
- package/src/commands/setup.ts +113 -5
- package/src/commands/sync.ts +30 -0
- package/src/index.ts +21 -2
package/src/commands/sync.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
watch,
|
|
7
7
|
existsSync,
|
|
8
8
|
} from "node:fs";
|
|
9
|
+
import { createInterface } from "node:readline";
|
|
9
10
|
import { join, relative, extname, resolve, basename } from "node:path";
|
|
10
11
|
import { homedir } from "node:os";
|
|
11
12
|
import { apiPost } from "../lib/api.js";
|
|
@@ -17,6 +18,7 @@ interface SyncOptions {
|
|
|
17
18
|
watch?: boolean;
|
|
18
19
|
ignore?: string;
|
|
19
20
|
agentMemory?: boolean;
|
|
21
|
+
yes?: boolean;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
const DEFAULT_IGNORE = new Set([
|
|
@@ -85,6 +87,21 @@ export async function syncCommand(
|
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
console.log(chalk.gray(`Found ${files.length} files to sync`));
|
|
90
|
+
|
|
91
|
+
// Confirm if many files (>10) unless -y is passed
|
|
92
|
+
if (files.length > 10 && !options.yes) {
|
|
93
|
+
console.log(
|
|
94
|
+
chalk.yellow(
|
|
95
|
+
`\n This will push ${files.length} files. Continue? (y/N) `,
|
|
96
|
+
),
|
|
97
|
+
);
|
|
98
|
+
const confirmed = await confirmSync();
|
|
99
|
+
if (!confirmed) {
|
|
100
|
+
console.log(chalk.gray(" Cancelled.\n"));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
88
105
|
console.log();
|
|
89
106
|
|
|
90
107
|
let pushed = 0;
|
|
@@ -474,3 +491,16 @@ async function syncAgentMemory(): Promise<void> {
|
|
|
474
491
|
),
|
|
475
492
|
);
|
|
476
493
|
}
|
|
494
|
+
|
|
495
|
+
function confirmSync(): Promise<boolean> {
|
|
496
|
+
return new Promise((resolve) => {
|
|
497
|
+
const rl = createInterface({
|
|
498
|
+
input: process.stdin,
|
|
499
|
+
output: process.stdout,
|
|
500
|
+
});
|
|
501
|
+
rl.question(" ", (answer) => {
|
|
502
|
+
rl.close();
|
|
503
|
+
resolve(answer.trim().toLowerCase() === "y");
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -77,7 +77,24 @@ program
|
|
|
77
77
|
program
|
|
78
78
|
.command("delete <id>")
|
|
79
79
|
.description("Delete a note")
|
|
80
|
-
.option("--
|
|
80
|
+
.option("-y, --yes", "Skip confirmation")
|
|
81
|
+
.action(deleteCommand);
|
|
82
|
+
|
|
83
|
+
// Aliases
|
|
84
|
+
program
|
|
85
|
+
.command("remember [content]")
|
|
86
|
+
.description("Alias for push — save knowledge to your Memax workspace")
|
|
87
|
+
.option("-f, --file <path>", "File to push")
|
|
88
|
+
.option("-c, --category <category>", "Category (auto-detected if omitted)")
|
|
89
|
+
.option("-t, --tags <tags>", "Comma-separated tags")
|
|
90
|
+
.option("--title <title>", "Note title")
|
|
91
|
+
.option("--stdin", "Read content from stdin")
|
|
92
|
+
.action(pushCommand);
|
|
93
|
+
|
|
94
|
+
program
|
|
95
|
+
.command("forget <id>")
|
|
96
|
+
.description("Alias for delete — remove a note from your workspace")
|
|
97
|
+
.option("-y, --yes", "Skip confirmation")
|
|
81
98
|
.action(deleteCommand);
|
|
82
99
|
|
|
83
100
|
// --- Sync ---
|
|
@@ -100,6 +117,7 @@ const syncCmd = program
|
|
|
100
117
|
"--agent-memory",
|
|
101
118
|
"Sync native AI agent memory files (Claude Code, Cursor, Codex)",
|
|
102
119
|
)
|
|
120
|
+
.option("-y, --yes", "Skip confirmation for large syncs")
|
|
103
121
|
.action(syncCommand);
|
|
104
122
|
|
|
105
123
|
syncCmd
|
|
@@ -114,7 +132,8 @@ program
|
|
|
114
132
|
.description("Set up AI agent integrations (auto-detects installed agents)")
|
|
115
133
|
.option("--mcp", "Enable MCP server (agent tools)")
|
|
116
134
|
.option("--hooks", "Enable context injection hooks")
|
|
117
|
-
.option("--
|
|
135
|
+
.option("--instructions", "Inject memax instructions into agent config files")
|
|
136
|
+
.option("--all", "Enable MCP + hooks + instructions")
|
|
118
137
|
.option("--local", "Use local stdio MCP instead of remote server")
|
|
119
138
|
.option("--print", "Print MCP config JSON to copy/paste (no changes made)")
|
|
120
139
|
.option("--only <agents>", "Only configure these agents (comma-separated)")
|