#!/usr/bin/env node /** * refresh-cache.ts - JIRA Plugin Cache Refresh * * Clears and refreshes JIRA sync cache to prevent stale data issues * * Usage: * /specweave-jira:refresh-cache */ import { existsSync, unlinkSync, readdirSync } from 'fs'; import { join } from 'path'; export async function refreshJiraCache(projectRoot: string = process.cwd()): Promise { const cacheDir = join(projectRoot, '.specweave', 'cache', 'jira'); if (!existsSync(cacheDir)) { console.log('โœ… No JIRA cache found'); return; } console.log('๐Ÿงน Clearing JIRA cache...'); const files = readdirSync(cacheDir); let cleared = 0; for (const file of files) { const filePath = join(cacheDir, file); unlinkSync(filePath); cleared++; } console.log(`โœ… Cleared ${cleared} cache files`); } // CLI entry if (require.main === module) { refreshJiraCache().catch(console.error); }