aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
43 lines (35 loc) • 1.05 kB
JavaScript
/**
* Generate a manifest.json for a directory.
*
* Usage:
* node tools/manifest/generate-manifest.mjs <dir>
*
* Note: manifest.md generation has been deprecated - manifest.json serves the same purpose.
*/
import fs from 'fs';
import path from 'path';
const dirArg = process.argv[2];
if (!dirArg) {
console.error('Usage: node tools/manifest/generate-manifest.mjs <dir>');
process.exit(1);
}
const dir = path.resolve(dirArg);
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory()) {
console.error('Not a directory:', dir);
process.exit(1);
}
const files = fs
.readdirSync(dir, { withFileTypes: true })
.filter(d => d.isFile() && !d.name.startsWith('.'))
.map(d => d.name)
.sort();
const manifest = {
name: path.basename(dir),
path: path.relative(process.cwd(), dir) || '.',
files,
ignore: ["manifest.json"]
};
const manifestPath = path.join(dir, 'manifest.json');
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n', 'utf8');
console.log('Wrote', manifestPath);