copy-agent-rules
v1.0.4
Published
Merge Markdown rules and output to multiple IDE formats via a simple CLI.
Maintainers
Readme
copy-agent-rules
A zero-dependency CLI to merge Markdown rule files and write them to multiple IDE-specific locations.
Package on npm: copy-agent-rules
GitHub repository: applepig/copy-agent-rules
For npx users (quick start)
Run the CLI with command-line args only:
npx copy-agent-rules <src_path> <dest_dir> [--formats <list>] [--overwrite] [--config <file>]
npx copy-agent-rules -h | --helpArguments:
src_path: directory containing one or more.mdfiles (merged by filename order) or a single.mdfiledest_dir: target project root to receive outputs--formats: comma-separated list, overrides formats fromconfig.js--overwrite: overwrite existing files without prompt--config <file>: use config from the given file (default:./config.js)-h, --help: show help and list available formats (read fromconfig.js)
Available formats (default, from config.js):
chatgpt-codex, claude, cline, codex, cursor, gemini, kiro, vscode, windsurfExample:
npx copy-agent-rules src dist --formats codex,cursor --overwriteDuring execution the CLI prints the path of the loaded config:
using config from /path/to/config.jsFor git-cloned users (local development)
Main files:
bin/copy-agent-rules.js: CLI entry.config.js: default formats and destinations (see below).tests/tester.js: zero-dependency E2E test runner.
Common scripts:
npm run copy -- <src_path> <dest_dir> [--formats <list>] [--overwrite]npm test
Config (ESM, config.js):
export default {
overwrite: false,
formats: ['chatgpt-codex','claude','cline','codex','cursor','gemini','kiro','vscode','windsurf'],
formats_dict: {
codex: { filename: 'codex.md' },
cursor: { filename: '.cursor/rules/copy-agent-rule.mdc', prepend: `---\ndescription: "Generated by copy-agent-rules"\nalwaysApply: true\n---` },
vscode: { filename: '.github/instructions/copy-agent-rule.instructions.md' }
}
};Notes:
- All
.mdinsrc_pathare merged with a<!-- source: <file> -->marker. prepend(optional) adds per-format content to the very top.
License
MIT
