feat: add publish script for claude-mem
- Implemented a CLI tool for version bumping, building, and publishing to npm. - Added checks for uncommitted changes and current version retrieval. - Included options for patch, minor, major, and custom version bumps. - Integrated git commit and tagging after version update. - Added npm publish functionality and git push after successful publish. - Implemented error handling and user confirmations throughout the process.
This commit is contained in:
@@ -22,11 +22,6 @@ import { storeMemory } from '../commands/store-memory.js';
|
||||
import { storeOverview } from '../commands/store-overview.js';
|
||||
import { updateSessionMetadata } from '../commands/update-session-metadata.js';
|
||||
import { generateTitle } from '../commands/generate-title.js';
|
||||
import {
|
||||
executeChromaMCPTool,
|
||||
loadChromaMCPTools,
|
||||
generateCommandOptions
|
||||
} from '../commands/chroma-mcp.js';
|
||||
|
||||
const program = new Command();
|
||||
// </Block> =======================================
|
||||
@@ -230,37 +225,6 @@ program
|
||||
|
||||
// </Block> =======================================
|
||||
|
||||
// <Block> 1.12 ===================================
|
||||
// Dynamic Chroma MCP Commands
|
||||
// Natural pattern: Register all Chroma MCP tools as CLI commands
|
||||
try {
|
||||
const chromaTools = loadChromaMCPTools();
|
||||
|
||||
for (const tool of chromaTools) {
|
||||
const cmd = program
|
||||
.command(tool.name)
|
||||
.description(tool.description || `Execute ${tool.name} MCP tool`);
|
||||
|
||||
// Add options from tool schema
|
||||
const options = generateCommandOptions(tool.inputSchema);
|
||||
for (const opt of options) {
|
||||
if (opt.required) {
|
||||
cmd.requiredOption(opt.flag, opt.description);
|
||||
} else {
|
||||
cmd.option(opt.flag, opt.description);
|
||||
}
|
||||
}
|
||||
|
||||
// Set action handler
|
||||
cmd.action(async (options: OptionValues) => {
|
||||
await executeChromaMCPTool(tool.name, options);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn('Warning: Could not load Chroma MCP tools:', error);
|
||||
}
|
||||
// </Block> =======================================
|
||||
|
||||
// <Block> 1.11 ===================================
|
||||
// CLI Execution
|
||||
// Natural pattern: After defining all commands, parse and execute
|
||||
|
||||
Reference in New Issue
Block a user