Separate Input Root
The --input-root <path> flag lets you point rulesync generate at a .rulesync/ source directory that is different from the current working directory. This decouples where your rule definitions live from where the generated tool configuration files are written.
Currently supported on
generateonly. At present,--input-rootis wired into therulesync generatecommand only. Other commands (import,convert,gitignore,install,fetch,init) still read.rulesync/from the current working directory. To use the same source directory with those commands,cdinto the input-root directory first.
Primary use case: centralized rules across all repos
A common workflow is to keep a single set of AI rules in a shared directory (e.g. ~/.aiglobal) and apply them to every project without switching directories:
# In any project directory — rules are read from ~/.aiglobal/.rulesync/
rulesync generate --input-root ~/.aiglobal --targets "*" --features rulesWithout --input-root, you would have to cd ~/.aiglobal && rulesync generate and then cd - back, and the output files would land in ~/.aiglobal instead of the current project.
Step-by-step setup
Create and initialize a shared rules directory:
bashmkdir -p ~/.aiglobal cd ~/.aiglobal rulesync initEdit your shared rules (
~/.aiglobal/.rulesync/rules/overview.md, etc.) to your preferences.From any project, generate configurations using the shared rules:
bash# In your project directory rulesync generate --input-root ~/.aiglobal --targets claudecode --features rules
Comparison with --global
These two flags serve different but complementary purposes:
--input-root | --global | |
|---|---|---|
| Changes | Source location (where .rulesync/ is read from) | Output location (writes to user-scope config paths, e.g. ~/.claude/) |
| Use when | Your rule definitions live in a non-CWD directory | You want the output to go to the tool's global (user-scope) config |
They can be combined. For example, to read rules from ~/.aiglobal and write them to Claude Code's global settings:
rulesync generate --input-root ~/.aiglobal --global --targets claudecode --features rules
--input-rootdoes not enable--global. When--input-rootis explicitly provided, Rulesync reads.rulesync/from that directory, but output scope still follows the CLI flags: use--globalfor user-scope output, and omit it for project-scope output. A"global": truesetting in therulesync.jsoncunder--input-rootis not applied unless you also pass--global, and Rulesync will emit a warning when dropping it so the override is visible.
Symlinks and trust
Rulesync follows symbolic links during file discovery. A symlink inside .rulesync/ that points outside the directory will be followed transparently, and the resolved file content will be copied into the generated output. This is intentional: it lets you centralize shared skills or rules in one place and reference them via symlinks from multiple project directories without duplication.
The trust boundary is the directory you point Rulesync at. --input-root is resolve()-ed to an absolute path before use, but there is no realpath-based boundary check on individual symlinks inside it. Only run Rulesync against trees you control. Directory symlink cycles are handled safely — discovery results are deduplicated by real path, so a cycle does not produce duplicated output. See the File Formats § Symlinks note for the behavior that applies across all features.
