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
--input-root is resolve()-ed to an absolute path before being used, but symbolic links inside the resolved directory are not dereferenced via realpath. If a symlink inside the input root points outside it, Rulesync will follow it transparently. Because --input-root is a deliberate user-supplied flag, treat it like any other source directory: only point Rulesync at trees you control.
