@getmikk/cli 1.8.1 → 1.8.2
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 +60 -8
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -235194,6 +235194,57 @@ async function generateMikkIgnore(projectRoot, language) {
|
|
|
235194
235194
|
await fs9.writeFile(ignorePath, lines.join("\n"), "utf-8");
|
|
235195
235195
|
return true;
|
|
235196
235196
|
}
|
|
235197
|
+
async function updateGitIgnore(projectRoot) {
|
|
235198
|
+
const gitIgnorePath = path11.join(projectRoot, ".gitignore");
|
|
235199
|
+
if (!await fileExists(gitIgnorePath))
|
|
235200
|
+
return false;
|
|
235201
|
+
try {
|
|
235202
|
+
const content = await fs9.readFile(gitIgnorePath, "utf-8");
|
|
235203
|
+
const lines = content.split("\n");
|
|
235204
|
+
const alreadyIgnored = lines.some((line) => {
|
|
235205
|
+
const trimmed = line.trim();
|
|
235206
|
+
return trimmed === ".mikk" || trimmed === ".mikk/" || trimmed === "**/.mikk/**";
|
|
235207
|
+
});
|
|
235208
|
+
if (alreadyIgnored)
|
|
235209
|
+
return false;
|
|
235210
|
+
const newContent = content.endsWith("\n") ? `${content}
|
|
235211
|
+
# Mikk internal
|
|
235212
|
+
.mikk/
|
|
235213
|
+
` : `${content}
|
|
235214
|
+
|
|
235215
|
+
# Mikk internal
|
|
235216
|
+
.mikk/
|
|
235217
|
+
`;
|
|
235218
|
+
await fs9.writeFile(gitIgnorePath, newContent, "utf-8");
|
|
235219
|
+
return true;
|
|
235220
|
+
} catch {
|
|
235221
|
+
return false;
|
|
235222
|
+
}
|
|
235223
|
+
}
|
|
235224
|
+
async function cleanupGitIgnore(projectRoot) {
|
|
235225
|
+
const gitIgnorePath = path11.join(projectRoot, ".gitignore");
|
|
235226
|
+
if (!await fileExists(gitIgnorePath))
|
|
235227
|
+
return false;
|
|
235228
|
+
try {
|
|
235229
|
+
const content = await fs9.readFile(gitIgnorePath, "utf-8");
|
|
235230
|
+
const lines = content.split("\n");
|
|
235231
|
+
let modified = false;
|
|
235232
|
+
const filtered = lines.filter((line) => {
|
|
235233
|
+
const trimmed = line.trim();
|
|
235234
|
+
const isMikkEntry = trimmed === ".mikk" || trimmed === ".mikk/" || trimmed === "**/.mikk/**" || trimmed === "# Mikk internal";
|
|
235235
|
+
if (isMikkEntry)
|
|
235236
|
+
modified = true;
|
|
235237
|
+
return !isMikkEntry;
|
|
235238
|
+
});
|
|
235239
|
+
if (!modified)
|
|
235240
|
+
return false;
|
|
235241
|
+
const newContent = filtered.join("\n").trim() + "\n";
|
|
235242
|
+
await fs9.writeFile(gitIgnorePath, newContent, "utf-8");
|
|
235243
|
+
return true;
|
|
235244
|
+
} catch {
|
|
235245
|
+
return false;
|
|
235246
|
+
}
|
|
235247
|
+
}
|
|
235197
235248
|
|
|
235198
235249
|
// src/commands/init.ts
|
|
235199
235250
|
function registerInitCommand(program3) {
|
|
@@ -235215,6 +235266,11 @@ function registerInitCommand(program3) {
|
|
|
235215
235266
|
spinner.info(source_default.dim("Generated .mikkignore with smart defaults"));
|
|
235216
235267
|
spinner.start("Scanning project...");
|
|
235217
235268
|
}
|
|
235269
|
+
const gitIgnoreUpdated = await updateGitIgnore(projectRoot);
|
|
235270
|
+
if (gitIgnoreUpdated) {
|
|
235271
|
+
spinner.info(source_default.dim("Added .mikk/ to .gitignore"));
|
|
235272
|
+
spinner.start("Scanning project...");
|
|
235273
|
+
}
|
|
235218
235274
|
const { patterns, ignore } = getDiscoveryPatterns(language);
|
|
235219
235275
|
const files = await discoverFiles(projectRoot, patterns, ignore);
|
|
235220
235276
|
if (files.length === 0) {
|
|
@@ -238045,24 +238101,18 @@ var os2 = __toESM(require("node:os"));
|
|
|
238045
238101
|
function registerMcpCommand(program3) {
|
|
238046
238102
|
const mcp = program3.command("mcp").description("Start the MCP server, or install it into your AI tool config").option("-p, --project <path>", "Project root directory", process.cwd());
|
|
238047
238103
|
mcp.command("start", { isDefault: true }).description("Start the MCP (Model Context Protocol) server for AI assistants").action(async (_args, cmd) => {
|
|
238048
|
-
console.error("\n --- MIKK MCP DEBUG VERSION 2.0 ---");
|
|
238049
|
-
console.error(" [DEBUG] MCP start action entered");
|
|
238050
238104
|
const opts = { ...cmd.parent?.opts(), ...cmd.opts() };
|
|
238051
238105
|
const projectRoot = path29.resolve(opts.project || process.cwd());
|
|
238052
238106
|
process.env.MIKK_PROJECT_ROOT = projectRoot;
|
|
238053
|
-
console.error(`[DEBUG] projectRoot resolved to: ${projectRoot}`);
|
|
238054
238107
|
try {
|
|
238055
238108
|
const serverPath = path29.resolve(__dirname, "../../mcp-server/dist/index.cjs");
|
|
238056
|
-
console.error(`[DEBUG] Attempting to require server from: ${serverPath}`);
|
|
238057
238109
|
if (!fs17.existsSync(serverPath)) {
|
|
238058
238110
|
throw new Error(`MCP server bundle not found at ${serverPath}. Please run 'bun run build' in the monorepo root.`);
|
|
238059
238111
|
}
|
|
238060
238112
|
const mod = require(serverPath);
|
|
238061
|
-
console.error("[DEBUG] MCP server bundle required successfully");
|
|
238062
238113
|
if (!mod.startStdioServer) {
|
|
238063
|
-
throw new Error(`MCP server bundle at ${serverPath} is missing startStdioServer export
|
|
238114
|
+
throw new Error(`MCP server bundle at ${serverPath} is missing startStdioServer export.`);
|
|
238064
238115
|
}
|
|
238065
|
-
console.error("[DEBUG] Calling startStdioServer()...");
|
|
238066
238116
|
await mod.startStdioServer();
|
|
238067
238117
|
} catch (err) {
|
|
238068
238118
|
console.error("\n \u2716 Failed to start Mikk MCP server:", err.message);
|
|
@@ -238758,6 +238808,7 @@ var artifacts = [
|
|
|
238758
238808
|
"mikk.json",
|
|
238759
238809
|
"mikk.lock.json",
|
|
238760
238810
|
".mikk",
|
|
238811
|
+
".mikkignore",
|
|
238761
238812
|
"CLAUDE.md",
|
|
238762
238813
|
"AGENTS.md"
|
|
238763
238814
|
];
|
|
@@ -238803,6 +238854,7 @@ function registerRemoveCommand(program3) {
|
|
|
238803
238854
|
}
|
|
238804
238855
|
}
|
|
238805
238856
|
}
|
|
238857
|
+
await cleanupGitIgnore(cwd);
|
|
238806
238858
|
if (errors.length > 0) {
|
|
238807
238859
|
spinner.fail(source_default.red("Failed to cleanly remove all artifacts."));
|
|
238808
238860
|
for (const err of errors) {
|
|
@@ -238866,7 +238918,7 @@ if (process.argv.length <= 2) {
|
|
|
238866
238918
|
process.exit(0);
|
|
238867
238919
|
}
|
|
238868
238920
|
var program2 = new Command();
|
|
238869
|
-
program2.name("mikk").description("Live architectural context for your AI agent").version(true ? "1.8.
|
|
238921
|
+
program2.name("mikk").description("Live architectural context for your AI agent").version(true ? "1.8.2" : "0.0.0-dev");
|
|
238870
238922
|
registerInitCommand(program2);
|
|
238871
238923
|
registerAnalyzeCommand(program2);
|
|
238872
238924
|
registerDiffCommand(program2);
|