✨ feat(cli): add interactive update command for skill and config updates (#10)
Existing users who update the npm package often forget to update the agent skill files, leaving their AI agent working with stale workflow guidance (sizing rules, color palettes, anti-patterns). The new `update` subcommand solves this by detecting and updating all skill installations automatically. 🔧 Interactive update wizard: - Scan all agent directories (Cursor, Claude Code, Codex CLI) across global and local scopes for existing excalidraw-skill installations - Batch-update found installations with a single Y/n confirmation - Offer to install the skill for detected agents that don't have it yet - Optionally re-apply MCP config (defaults to no for non-breaking updates) 📝 Documentation: - Rewrite README "Updating" section to lead with the interactive command - Add collapsible example session showing the update flow - Retain manual update methods as fallback for each installation path 🎯 Ensures skill files stay in sync with MCP tools across releases, preventing the subtle drift where new tool capabilities exist but the agent's workflow guidance doesn't reference them.
This commit is contained in:
+6
-1
@@ -2727,12 +2727,17 @@ if (isMainModule()) {
|
||||
process.stderr.write(`Setup failed: ${(error as Error).message}\n`);
|
||||
process.exit(1);
|
||||
});
|
||||
} else if (arg === 'update') {
|
||||
import('./setup.js').then(m => m.runUpdate()).catch(error => {
|
||||
process.stderr.write(`Update failed: ${(error as Error).message}\n`);
|
||||
process.exit(1);
|
||||
});
|
||||
} else if (arg === '--help' || arg === '-h' || arg === '--version' || arg === '-v') {
|
||||
const pkgPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
|
||||
try {
|
||||
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
||||
if (arg === '--help' || arg === '-h') {
|
||||
process.stdout.write(`${pkg.name} v${pkg.version}\n\nUsage:\n mcp-excalidraw-local Start MCP server (stdio transport)\n mcp-excalidraw-local setup Interactive setup wizard\n mcp-excalidraw-local --help Show this help\n mcp-excalidraw-local --version Show version\n`);
|
||||
process.stdout.write(`${pkg.name} v${pkg.version}\n\nUsage:\n mcp-excalidraw-local Start MCP server (stdio transport)\n mcp-excalidraw-local setup Interactive setup wizard\n mcp-excalidraw-local update Update agent skills and MCP config\n mcp-excalidraw-local --help Show this help\n mcp-excalidraw-local --version Show version\n`);
|
||||
} else {
|
||||
process.stdout.write(`${pkg.version}\n`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user