Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 | --help

Arguments:

  • src_path: directory containing one or more .md files (merged by filename order) or a single .md file
  • dest_dir: target project root to receive outputs
  • --formats: comma-separated list, overrides formats from config.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 from config.js)

Available formats (default, from config.js):

chatgpt-codex, claude, cline, codex, cursor, gemini, kiro, vscode, windsurf

Example:

npx copy-agent-rules src dist --formats codex,cursor --overwrite

During execution the CLI prints the path of the loaded config:

using config from /path/to/config.js

For 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 .md in src_path are merged with a <!-- source: <file> --> marker.
  • prepend (optional) adds per-format content to the very top.

License

MIT

Releases

Contributors

Languages